Mercurial > hg > octave-avbm
changeset 5611:5be3463fed41
[project @ 2006-02-09 19:12:14 by jwe]
author | jwe |
---|---|
date | Thu, 09 Feb 2006 19:12:15 +0000 |
parents | 9761b7d24e9e |
children | aa3858187ee3 |
files | liboctave/ChangeLog liboctave/mx-inlines.cc |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2006-02-09 John W. Eaton <jwe@octave.org> + + * mx-inlines.cc (MX_ND_CUMULATIVE_OP): Store in cummulative + product of all dimensions in CP. + 2006-02-09 David Bateman <dbateman@free.fr> * SparseQR.cc: new file for real sparse QR class.
--- a/liboctave/mx-inlines.cc +++ b/liboctave/mx-inlines.cc @@ -528,10 +528,12 @@ \ The strategy here is to access the elements of A along the \ dimension specified by DIM. This means that we loop over each \ - element of R and adjust the index into A as needed. */ \ + element of R and adjust the index into A as needed. Store the \ + cummulative product of all dimensions of A in CP. The last \ + element of CP is the total number of elements of A. */ \ \ - Array<octave_idx_type> cp_sz (nd, 1); \ - for (int i = 1; i < nd; i++) \ + Array<octave_idx_type> cp_sz (nd+1, 1); \ + for (int i = 1; i <= nd; i++) \ cp_sz(i) = cp_sz(i-1)*dv(i-1); \ \ octave_idx_type reset_at = cp_sz(dim); \