Quantcast
Channel: PTC Community : Discussion List - PTC Mathcad
Viewing all articles
Browse latest Browse all 2936

Prime 3.1 Column vs Row operator performance difference?

$
0
0

In the thread Re: Similar to vector matrix product, but different… the poster put the return value from a program inside the loop, which you don't normally see.

 

 

Out of idle curiosity, I wondered if it had any effect on Mathcad's performance by doing this rather than placing the return value outside of the loop.   I also wondered what effect using the Prime row operator would make and doing without the vectorized multiplication.  What I found rather surprised me, in that the row operator method was considerably faster than the original column method.   I looked at doing array expansion by replicating a column-wise to conform with b and then doing Hademard (element-by-element) multiplication.   I also tried transposing b, multiplying each "column" by its corresponding vector element and then transposing the result.  This is what I found (on an i7 with 8 GiB RAM running Windows 10).

 

 

I was surprised to see that the row operator method was so quick.  I wonder if the internal order of array storage is row-wise rather than column-wise (which I'd kind of expect given that Mathcad deals with column vectors)?  I also did the same test (minus the row operator) in Mathcad M15 M040 and got the following result ... considerably slower in all cases and not much to choose between them.

 

 

Stuart


Viewing all articles
Browse latest Browse all 2936

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>