MathGroup Archive 2007

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

Search the Archive

Re: Re: "vector" Map[] / functional outer product?

  • To: mathgroup at
  • Subject: [mg83801] Re: [mg83773] Re: "vector" Map[] / functional outer product?
  • From: Daniel Lichtblau <danl at>
  • Date: Sat, 1 Dec 2007 05:37:33 -0500 (EST)
  • References: <fim8tq$rmd$> <> <>

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

  • Prev by Date: a definite integral
  • Next by Date: Re: how draw box with open front
  • Previous by thread: Re: a definite integral
  • Next by thread: Question about exponent shorthand