Re: How to map a list on function
- To: mathgroup at smc.vnet.net
- Subject: [mg97546] Re: [mg97472] How to map a list on function
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Sat, 14 Mar 2009 18:18:19 -0500 (EST)
- References: <200903141035.FAA12757@smc.vnet.net>
- Reply-to: drmajorbob at bigfoot.com
list = {{10, 3, 5, 7}, {4, 6, 8, 9}, {0, 8, 3, 6}} {{10, 3, 5, 7}, {4, 6, 8, 9}, {0, 8, 3, 6}} g[list_List] := Plus @@ (Times @@ ({x, y, z, u}^#) & /@ list) g[list] u^6 y^8 z^3 + u^7 x^10 y^3 z^5 + u^9 x^4 y^6 z^8 Bobby On Sat, 14 Mar 2009 05:35:16 -0500, buts <manger31 at yahoo.com> wrote: > Hello, > > Could anyone explain me how to do the following: > I have a long list of integer numbers in groups of four: > > list= {{10,3,5,7},{4,6,8,9},{0,8,3,6}, ...... } > > or its Flatten version. > > How to write a fast function g[list] which does this: > > g[list] =x^10*y^3*z^5*u^7 + x^4*y^6*z^8*u^9 + y^8*z^3*u^6+ ... > > It should be done many times (say, 10^4-6) on lists with length > 1000, > so taking parts is not a good idea. > How to use Map or similar ? > Thanks. > -- DrMajorBob at bigfoot.com
- References:
- How to map a list on function
- From: buts <manger31@yahoo.com>
- How to map a list on function