[multi_array]inner_product interest?

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

On 06/09/11 15:57, Larry Evans wrote:
OOPS, the output for fortran storage order is not the same as output for c storage order for 2 by 2 array. A print trace in inner_product shows offset_left getting value of 4, which can't be right since the max offset for a 2 by 2 array should be 3. Will investigate. -regards, Larry
participants (1)
-
Larry Evans