Re: defining a function of functions
- To: mathgroup at smc.vnet.net
- Subject: [mg110479] Re: defining a function of functions
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Sun, 20 Jun 2010 03:45:59 -0400 (EDT)
- References: <hviav7$hbl$1@smc.vnet.net>
J Davis wrote: > I want to define an inner product function such as > > (here mylist is a specified list and L is a specified constant) > > innerprod[f_, g_] = Sum[f[k]Conjugate[g[k]]Part[mylist,k],{k,1,L}] > > This works fine but now I need to apply it in a situation where f is a > function of 2 variables while g is a function of only one variable, > i.e. I want to compute something like the inner product of f[2,n] and > g[n]. > > Of course, I want the ability to freely vary the first input of f. > > I have accomplish this before rather easily but I'm presently drawing > a blank. > > Thanks for your help. > > Best, > JD > I don't know the form of your lists, but using ip[par_]:=innerprod[f[par,#]&, g] should work. -- _________________________________________________________________ Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de