Skip to main content
8 events
when toggle format what by license comment
Oct 2, 2014 at 9:07 comment added Leonid Shifrin @Jansen Glad I could help, thanks for the accept. Re: book - good to know that it is useful!
Sep 26, 2014 at 8:30 vote accept Jansen
Sep 26, 2014 at 8:30 comment added Jansen Thanks, it works exactly as I wanted. Don't know what you mean by custom expression parser/code generator though. Btw, also thanks for writing the book on mathematica, learned a lot from it :)
Sep 25, 2014 at 16:53 comment added Leonid Shifrin @Jansen Ok, the problem there was that on one hand, you want it to be partially evaluated, on another hand, Plus and Times are Listable, so one has to fight that during the partial computation of your expression. I didn't have the time to make the code pretty, but that part has now been corrected. At this point, it becomes clear that your problem is complex enough that a custom expression parser / code generator would be much cleaner than what I wrote. No time for this at the moment though. But I do realize that the code above can be hard to digest.
Sep 25, 2014 at 16:50 history edited Leonid Shifrin CC BY-SA 3.0
Corrected to fight listability in Plus and Times
Sep 25, 2014 at 16:37 comment added Jansen And the reason that I'm using these Ma variables is that in the actual expressions they occur multiple times, so this limits the number of matrix multiplications to the minimum.
Sep 25, 2014 at 16:26 comment added Jansen Thanks, I have to study this to see how it works, but for me it doesn't give the result I want. When i apply the first function to the arguments {1,2},{3,4} I get a 2x2 matrix, whereas it should be a vector. Maybe I should have mentioned this: the multiplication in the expressions should be interpreted as element wise multiplication of lists.
Sep 25, 2014 at 15:58 history answered Leonid Shifrin CC BY-SA 3.0