Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

"vector" Map[] / functional outer product?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83746] "vector" Map[] / functional outer product?
  • From: Mitch Murphy <mitch at lemma.ca>
  • Date: Thu, 29 Nov 2007 06:36:04 -0500 (EST)

greetings,

is there a simpler way to express

	{f@#,g@#}& /@ {a,b,c}

	-> {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}

ie. is there some mathematica function ??? such that

	{f,g} ??? {a,b,c}

	-> {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}

you might be asking what's so difficult about the "@#,@#,... & /@"  
syntax, but what about when you don't have two functions f,g but 8-10  
functions... the syntax gets ugly fast and hard to read.

note that

	Outer[{f, g}, {a, b, c}]

	-> {{f, g}[a], {f, g}[b], {f, g}[c]}

doesn't work, neither does

	Outer[Apply, {f, g}, {a, b, c}]

	->{{a, b, c},{a, b, c}}


thanks,
Mitch




  • Prev by Date: Re: Convert nxn matrix to a column vector with (n^2) elements
  • Next by Date: Unable to access v6 internal data sources (paclets)
  • Previous by thread: Re: Convert nxn matrix to a column vector with (n^2)
  • Next by thread: Re: "vector" Map[] / functional outer product?