Re: Newbie question: pairswise function application
- To: mathgroup at smc.vnet.net
- Subject: [mg23883] Re: Newbie question: pairswise function application
- From: Avi Mintz <mintza1 at macs.biu.ac.il>
- Date: Thu, 15 Jun 2000 00:51:20 -0400 (EDT)
- Organization: Bar-Ilan University, Ramat-Gan, Israel
- References: <8i1t6n$jn9@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
sort the list. Avi On 12 Jun 2000, Sidney Cadot wrote: > Hi, > > Wandering through the 1500-odd pages of the Mathematica book, I can't > find the solution to the following rather silly problem: > > I have a list L consisting of (a lot of) integers, and I want to apply a > function f to all pairs of numbers; furthermore, I don't want to > calculate both f[a,b] and f[b,a]: > > L = {1,5,19,100}; > > ... and I want: > > { f[1,5], f[1,19], f[1,100], f[5,19], f[5,100], f[19,100] } > > Can anyone please tell me how to do this? I'd prefer a smart solution > (i.e., not just generating all pairs, then throwing away a lot of them) > since my lists tend to get rather large. > > Thanks in advance, > > Sidney Cadot > sidney at janis.pds.twi.tudelft.nl > > >