MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: element selection

  • To: mathgroup at
  • Subject: [mg53623] Re: element selection
  • From: Roland Franzius <roland.franzius at>
  • Date: Fri, 21 Jan 2005 06:35:27 -0500 (EST)
  • Organization: Universitaet Hannover
  • References: <csnt7e$4ec$>
  • Sender: owner-wri-mathgroup at

Bruyndonckx P. wrote:
> I have two long sorted lists of Integers.  If the difference between a number in list 1 and a 
> number in list 2 is less than a certain value, both are selected to create a couple.  I am 
> looking for a fast way to go through both lists and extract these elements to create a new list 
> of couples.  I tried a number of things, but all of them were rather slow so I need some expert 
> advice here.

Depends on your task. If you want pairs at the same index position


If you want all possible ordered pairs

replace "Transpose[{list1,list2}]" by



Roland Franzius

  • Prev by Date: Re: element selection
  • Next by Date: Re: TableForm and MatrixForm
  • Previous by thread: Re: element selection
  • Next by thread: Re: element selection