MathGroup Archive 2010

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

Search the Archive

Re: innerApply[{f, g}, {{a, b}, {c, d}}] = {f[a, b], g[c, d]} ?


Fred Klingener schrieb:
> This seems to work fine, but there must be a less clumsy way to do it:
> 
> Clear[innerApply, functionList, argumentList, f, g, a, b, c, d]
> 
> innerApply[functionList_, argumentList_] :=
>  Table[functionList[[j]] @@ argumentList[[j]], {j, 1,
>    Length[functionList]}]
> 
> In[770]:= innerApply[{f, g}, {{a, b}, {c, d}}]
> Out[770]= {f[a, b], g[c, d]}

Many ways, eg

In: Apply @@@ Transpose[{{f, g}, {{a, b}, {c, d}}}]

Out: {f[a,b],g[c,d]}

-- 

Roland Franzius


  • Prev by Date: Converting colors to height values
  • Next by Date: Re: innerApply[{f, g}, {{a, b}, {c, d}}] = {f[a, b],
  • Previous by thread: innerApply[{f, g}, {{a, b}, {c, d}}] = {f[a, b], g[c, d]} ?
  • Next by thread: Re: innerApply[{f, g}, {{a, b}, {c, d}}] = {f[a, b], g[c, d]} ?