Map-like behaviour for functions of more than a single argument?
- To: mathgroup at smc.vnet.net
- Subject: [mg64519] Map-like behaviour for functions of more than a single argument?
- From: "Matt" <anonmous69 at netscape.net>
- Date: Mon, 20 Feb 2006 06:29:56 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, I was wondering if there's a way to achieve the functionality of Map, but with functions of more than one argument? An example of how I'm 'working around' my perceived limitation of Map functionality: Clear[f, g]; f[z_, func_] := Module[{result}, result = func[Complex[Sequence @@ z]]; {Re[result], Im[result]}]; g[z_] := f[z, #1^2 & ]; Which, using 'g', I can use Map on a list of ordered pairs: g /@ {{x,y}, {x,y}, {x,y}, {x,y}, etc.} If I wanted to use Sin, I would redefine g as follows: g[z_] := f[z, Sin]; then reapply to the list of ordered pairs. So, I'm wondering if there's a way to accomplish my task without the intermediary function definition 'g'? Also, if what I'm attempting is totally wrong, I'd appreciate any pointers as to the correct 'path' as well. Thanks, Matt
- Follow-Ups:
- Re: Map-like behaviour for functions of more than a single argument?
- From: Pratik Desai <pdesai1@umbc.edu>
- Re: Map-like behaviour for functions of more than a single argument?