Re-order the matrix.
y = accsum_order ( x , o )
a m-by-n, matrix of doubles
a 1-by-1 matrix of doubles, a positive integer, the order. o = 1: no-op i.e. y=x, o = 2: increasing order, o = 3: decreasing order, o = 4: increasing magnitude order, o = 5: decreasing magnitude order (good order for DCS), o = 6: positive reverse from order 2, o = 7: negative reverse from order 2, o = 8: random order
a m-by-n, matrix of doubles, the same content as x, but in different order.
Re-order the matrix. If o=8, then this function uses the grand function and modifies its state.
The increasing magnitude order (o=4) is good when summing nonnegative numbers by recursive summation (i.e. with accsum_straight), in the sense of having the smallest a priori forward error bound.
The decreasing magnitude ordering order (o=5) is good when there is heavy cancellation, i.e. when the condition number returned by accsum_sumcond is large. In this case, the recursive summation (i.e. accsum_straight) can be used with decreasing magnitude ordering.
x = [-9.9 5.5 2.2 -3.3 -6.6 0 1.1] for o = 1 : 8 y = accsum_order ( x , o ); disp([o y']) end | ![]() | ![]() |
"Stability and numerical accuracy of algorithms", Nicolas Higham
"Handbook of Floating Point Computations", Muller et al
https://hpcrd.lbl.gov/SCG/ocean/NRS/ECMWF/img16.htm