Mercurial > hg > octave-terminal
changeset 2561:96b57a9485b6
[project @ 1996-12-04 18:26:33 by jwe]
author | jwe |
---|---|
date | Wed, 04 Dec 1996 18:26:33 +0000 |
parents | 6fa1ac46c980 |
children | 0c978e147a3a |
files | liboctave/ChangeLog liboctave/dMatrix.cc |
diffstat | 2 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 4 12:24:24 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dMatrix.cc (Qzval): Don't try to use same memory three times. + Create result using Complex constructor, not multiplication. + Order elements as they are returned from Eispack. + Mon Dec 2 00:26:41 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * lo-ieee.cc (octave_ieee_init): Kluge for octave_Inf on SCO.
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -3228,10 +3228,10 @@ double *palfr = alfr.fortran_vec (); ColumnVector alfi (a_nr); - double *palfi = alfr.fortran_vec (); + double *palfi = alfi.fortran_vec (); ColumnVector beta (a_nr); - double *pbeta = alfr.fortran_vec (); + double *pbeta = beta.fortran_vec (); Matrix atmp = a; double *pa = atmp.fortran_vec (); @@ -3259,22 +3259,20 @@ int cnt = 0; for (int i = 0; i < a_nr; i++) - if (beta.elem (i) != 0) + if (beta(i) != 0) cnt++; - ComplexColumnVector cx (cnt, 0.0); - - Complex Im (0, 1); + ComplexColumnVector cx (cnt); + + cnt = 0; for (int i = 0; i < a_nr; i++) { - if (beta.elem (i) != 0) + if (beta(i) != 0) { // Finite generalized eigenvalue. - cnt--; - cx.elem (cnt) = (alfr.elem (i) + Im * alfi.elem (i)) - / beta.elem (i); + cx(cnt++) = Complex (alfr(i), alfi(i)) / beta(i); } }