Discussion: Introducing new operators for matrix computation

Huaiyu Zhu hzhu at localhost.localdomain
Sat Jul 15 16:13:20 EDT 2000


On Sat, 15 Jul 2000 10:15:38 +0300 (IDT), Moshe Zadka
<moshez at math.huji.ac.il> wrote: 
>> How would you write this in list compresension (in less than 10 lines)?
>> 
>> B*(sin(A*x+b).*(A*y)/3)/C
>
>B*[sin(a)*b/3; for a,b in transpose([A*x+b, A*y])]/C
>

Questions:

Presumably the [ ... ] is a double list.  What does B*[...]/C mean?  Maybe
you need a cast?

The x, b and y are matrices, so presumably 'for a, b in' contains loops
around all the indices?

Perhaps you meant 'for a, c in'?  Do these two b's live in the same scope? 

What would the error message look like for such errors?

How do you write something like B*(A(a.*b).*c).*d?

Huaiyu



More information about the Python-list mailing list