Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5475

Re: list equation

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: list equation
Date 2011-10-07 08:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j6meja$7cu$1@smc.vnet.net> (permalink)
References <j6jpek$me8$1@smc.vnet.net>

Show all headers | View raw


On Thu, 06 Oct 2011 09:38:44 +0100, dimitris <dimmechan@yahoo.com> wrote:

> Hello to all.
>
> Let
>
> lst = Tuples[Range[100], 2];
>
> In the previous list appear elements such us {x,y} and {y,x}. (e.g.
> {3,4} and {4,3}).
> I want to create a new list with {y,x} dropped (that is, in the new
> list appears only {3,4}
> and not {4,3}).
>
> I use
>
> lstnew = Union[lst, SameTest -> (#1 == Reverse[#2] &)]
>
> However it is needed almost 150 sec for this procedure ($Version->5.2
> for Windows)
> I know that my laptop is too old but I guess there is a more efficient
> way to
> create lstnew.
>
> Any ideas?
>
> Thanks a lot
>
> Dimitris
>

New in 5.1:

Subsets[Range[100], {2}]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

list equation dimitris <dimmechan@yahoo.com> - 2011-10-06 08:38 +0000
  Re: list equation Peter Pein <petsie@dordos.net> - 2011-10-07 08:46 +0000
  Re: list equation "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-07 08:45 +0000
  Re: list equation "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-10-07 08:51 +0000
  Re: list equation Simon <simonjtyler@gmail.com> - 2011-10-07 09:07 +0000
  Re: list equation Ray Koopman <koopman@sfu.ca> - 2011-10-08 18:45 +0000

csiph-web