Mercurial > hg > octave-nkf
changeset 1677:ef7f804cb722
[project @ 1995-12-28 20:20:29 by jwe]
author | jwe |
---|---|
date | Thu, 28 Dec 1995 20:22:03 +0000 |
parents | 628c9dcd081d |
children | 1ef83ee34815 |
files | liboctave/CRowVector.cc liboctave/dRowVector.cc |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CRowVector.cc +++ b/liboctave/CRowVector.cc @@ -436,8 +436,8 @@ return ComplexRowVector (); } - if (len == 0 || a.cols () == 0) - return ComplexRowVector (0); + if (len == 0) + return ComplexRowVector (a.cols (), 0.0); // Transpose A to form A'*x == (x'*A)' @@ -446,12 +446,12 @@ int ld = a_nr; - Complex *y = new Complex [len]; + Complex *y = new Complex [a_nc]; F77_FCN (zgemv, ZGEMV) ("T", a_nc, a_nr, 1.0, a.data (), ld, v.data (), 1, 0.0, y, 1, 1L); - return ComplexRowVector (y, len); + return ComplexRowVector (y, a_nc); } ComplexRowVector
--- a/liboctave/dRowVector.cc +++ b/liboctave/dRowVector.cc @@ -220,8 +220,8 @@ return RowVector (); } - if (len == 0 || a.cols () == 0) - return RowVector (0); + if (len == 0) + return RowVector (a.cols (), 0.0); // Transpose A to form A'*x == (x'*A)' @@ -230,12 +230,12 @@ int ld = a_nr; - double *y = new double [len]; + double *y = new double [a_nc]; F77_FCN (dgemv, DGEMV) ("T", a_nc, a_nr, 1.0, a.data (), ld, v.data (), 1, 0.0, y, 1, 1L); - return RowVector (y, len); + return RowVector (y, a_nc); } // other operations