MathGroup Archive 2006

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

Search the Archive

Re: Problem with Thread over Plus?


Virgilio, Vincent - SSD wrote:
> Hello,
> 
> Why does this work:
> 
> 	Thread[ Plus[ {1,1} , { {1,1} , {2,2} } ] ]
> 
> but this doesn't?
> 
> 	Thread[ Plus[ {1,1} , { {1,1} , {2,2} , {3,3} } ] ]
> 
> Thanks,
> 
> Vince Virgilio

As stated by the error message returned by In[1], both list must be of 
equal lengths. Therefore, In[2], with three 1s rather than two, works as 
expected.

In[1]:=
Thread[{1, 1} + {{1, 1}, {2, 2}, {3, 3}}]

Thread::tdlen: Objects of unequal length in {1, 1} + {{1, 1}, {2, 2}, 
{3, 3}} cannot be combined.

Thread::tdlen: Objects of unequal length in {1, 1} + {{1, 1}, {2, 2}, 
{3, 3}} cannot be combined.

Out[1]=
{1, 1} + {{1, 1}, {2, 2}, {3, 3}}

In[2]:=
Thread[{1, 1, 1} + {{1, 1}, {2, 2}, {3, 3}}]

Out[2]=
{{2, 3, 4}, {2, 3, 4}}

Regards,
JM


  • Prev by Date: Implicit integration of finite alternating series of hypergeometric (2F1) functions
  • Next by Date: Bug with Series[] - help wanted
  • Previous by thread: Re: Problem with Thread over Plus?
  • Next by thread: Re: Problem with Thread over Plus?