
9 Jun
2011
9 Jun
'11
8:57 p.m.
Attached is code to calculate the inner product of 2 multi_arrays. As indicated in comments, the code was adapted from the Budd book. It may be faster than doing subscripting to get the array elements; however, I've done no benchmarks, but I'd guess it would be faster since there's no calls to subscripting operators. Instead, there's just one div call and 3 multiplications per element of the result array. The .txt attachment shows relevant quotes from the book and reasons why changes were made to the book's code to accommodate multi_array's different storage orders. I've not done too much testing, but did do a simple test for 2 by 2 arrays whose output seems correct. Any interest? -regards, Larry