Mercurial > hg > octave-terminal
changeset 1545:8bdfa6fe5d69
[project @ 1995-10-06 06:13:28 by jwe]
author | jwe |
---|---|
date | Fri, 06 Oct 1995 06:14:45 +0000 |
parents | f1931fc63ce9 |
children | a272c4056bab |
files | liboctave/CmplxSVD.cc liboctave/dbleSVD.cc |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CmplxSVD.cc +++ b/liboctave/CmplxSVD.cc @@ -100,7 +100,7 @@ case SVD::sigma_only: jobu = jobv ="N"; - ncol_u = nrow_vt = 0; + ncol_u = nrow_vt = 1; break; default: @@ -109,9 +109,9 @@ type_computed = svd_type; - Complex *u = (ncol_u > 0 ? new Complex[m * ncol_u] : 0); + Complex *u = (*jobu == 'N' ? 0 : new Complex[m * ncol_u]); double *s_vec = new double[min_mn]; - Complex *vt = (nrow_vt > 0 ? new Complex[nrow_vt * n] : 0); + Complex *vt = (*jobv == 'N' ? 0 : new Complex[nrow_vt * n]); int lwork = 2*min_mn + max_mn; Complex *work = new Complex[lwork]; @@ -123,12 +123,12 @@ m, vt, nrow_vt, work, lwork, rwork, info, 1L, 1L); - if (ncol_u > 0) + if (*jobu != 'N') left_sm = ComplexMatrix (u, m, ncol_u); sigma = DiagMatrix (s_vec, nrow_s, ncol_s); - if (nrow_vt > 0) + if (*jobv != 'N') { ComplexMatrix vt_m (vt, nrow_vt, n); right_sm = vt_m.hermitian ();
--- a/liboctave/dbleSVD.cc +++ b/liboctave/dbleSVD.cc @@ -43,7 +43,7 @@ } Matrix -left_singular_matrix (void) const +SVD::left_singular_matrix (void) const { if (type_computed == SVD::sigma_only) { @@ -56,7 +56,7 @@ } Matrix -right_singular_matrix (void) const +SVD::right_singular_matrix (void) const { if (type_computed == SVD::sigma_only) { @@ -98,7 +98,7 @@ case SVD::sigma_only: jobu = jobv ="N"; - ncol_u = nrow_vt = 0; + ncol_u = nrow_vt = 1; break; default: @@ -107,9 +107,9 @@ type_computed = svd_type; - double *u = (ncol_u > 0 ? new double[m * ncol_u] : 0); + double *u = (*jobu == 'N' ? 0 : new double[m * ncol_u]); double *s_vec = new double[min_mn]; - double *vt = (ncol_vt > 0 ? new double[nrow_vt * n] : 0); + double *vt = (*jobv == 'N' ? 0 : new double[nrow_vt * n]); int tmp1 = 3*min_mn + max_mn; int tmp2 = 5*min_mn - 4; @@ -120,12 +120,12 @@ m, vt, nrow_vt, work, lwork, info, 1L, 1L); - if (ncol_u > 0) + if (*jobu != 'N') left_sm = Matrix (u, m, ncol_u); sigma = DiagMatrix (s_vec, nrow_s, ncol_s); - if (nrow_vt > 0) + if (*jobv != 'N') { Matrix vt_m (vt, nrow_vt, n); right_sm = vt_m.transpose ();