Mercurial > hg > octave-terminal
changeset 9020:728e7943752d
EIG.cc: avoid volatile decl for tmp variable
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Mar 2009 22:04:58 -0400 |
parents | 12ca81f1fa99 |
children | 47152db528ff |
files | liboctave/ChangeLog liboctave/EIG.cc |
diffstat | 2 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,9 @@ 2009-03-25 John W. Eaton <jwe@octave.org> + * EIG.cc (EIG::init (const Matrix&, bool), + EIG::init (const Matrix&, const Matrix&, bool)): + Avoid volaatile declaration for tmp variable. + * Makefile.in (MATRIX_INC): Add Sparse-diag-op-defs.h and Sparse-perm-op-defs.h to the list.
--- a/liboctave/EIG.cc +++ b/liboctave/EIG.cc @@ -161,8 +161,8 @@ Array<double> wi (n); double *pwi = wi.fortran_vec (); - volatile octave_idx_type nvr = calc_ev ? n : 0; - Matrix vr (nvr, nvr); + octave_idx_type tnvr = calc_ev ? n : 0; + Matrix vr (tnvr, tnvr); double *pvr = vr.fortran_vec (); octave_idx_type lwork = -1; @@ -204,6 +204,7 @@ } lambda.resize (n); + octave_idx_type nvr = calc_ev ? n : 0; v.resize (nvr, nvr); for (octave_idx_type j = 0; j < n; j++) @@ -507,8 +508,8 @@ Array<double> beta (n); double *pbeta = beta.fortran_vec (); - volatile octave_idx_type nvr = calc_ev ? n : 0; - Matrix vr (nvr, nvr); + octave_idx_type tnvr = calc_ev ? n : 0; + Matrix vr (tnvr, tnvr); double *pvr = vr.fortran_vec (); octave_idx_type lwork = -1; @@ -554,6 +555,7 @@ } lambda.resize (n); + octave_idx_type nvr = calc_ev ? n : 0; v.resize (nvr, nvr); for (octave_idx_type j = 0; j < n; j++)