Re: ListConvolve?
- To: mathgroup at smc.vnet.net
- Subject: [mg42468] Re: [mg42437] ListConvolve?
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Thu, 10 Jul 2003 03:36:52 -0400 (EDT)
- References: <200307080837.EAA15790@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
guillerm at usal.es wrote: > > Dear friend: > I has two lists: > days = {t1, t2, t3}; > retention = {f[b0, c0, t], f[ b1, c1, t], f[b2, c2, t]}; > > I wish obtain this output: > > {f[b0, c0, t1], f[b0, c0, t2] + f[b1, c1, t1] , > f[b0, c0, t3] + f[b1, c1, t2] + f[b2, c2, t1] } // TableForm > > I have obtain a solution but it not efficient and my lists are alredy large > (here are examples). Any help? > > Thanks > > Guillermo Yes, ListConvolve can do this. One must get the overhangs correct (I look at the help notes and play around with examples every time to get this right). Also you need to replace the default Times with a different function. One possibility is shown below. In[27]:= days = {t1, t2, t3}; In[28]:= ret = {f[b0, c0, t], f[b1, c1, t], f[b2, c2, t]}; In[29]:= ListConvolve[days, ret, {1,1}, 0, (#2/.t->#1)&] Out[29]= {f[b0, c0, t1], f[b0, c0, t2] + f[b1, c1, t1], f[b0, c0, t3] + f[b1, c1, t2] + f[b2, c2, t1]} Daniel Lichtblau Wolfram Research
- References:
- ListConvolve?
- From: guillerm@usal.es
- ListConvolve?