Re: Re: "vector" Map[] / functional outer product?
- To: mathgroup at smc.vnet.net
- Subject: [mg83801] Re: [mg83773] Re: "vector" Map[] / functional outer product?
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sat, 1 Dec 2007 05:37:33 -0500 (EST)
- References: <fim8tq$rmd$1@smc.vnet.net> <474ED0C0.9030008@gmail.com> <200711301019.FAA04891@smc.vnet.net>
Mitch Murphy wrote: > based on the solution from Jean-Marc Gulliet, here's a slight > improvement based on overloading Map[] for List arguments. this solves > my issue perfectly without having to type in esc sequences for infix > operators > > Unprotect[Map]; > Map[f_List, a_List] := Transpose@Outer[Compose, f, a] > Protect[Map]; > > {f, g} /@ {a, b, c} > > -> {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}} > > > cheers, > Mitch Map is a heavily used function, in the Mathematica kernel as well as by users. I would not recommend redefining it unless you have convinced a BRPOE (Blue Ribbon Panel Of Experts) that your results will improve the world for generations to come. Generally such redefinition will bite, and hard, when doing some unrelated computations. Daniel Lichtblau Wolfram Research