Mercurial > hg > octave-nkf
diff liboctave/fCMatrix.cc @ 15382:197774b411ec stable
rcond: use new copy of data for full factorization if positive definite cholesky factorization fails (bug #37336)
* dMatrix.cc (Matrix::rcond): Don't reuse modified matrix data if
positive definite cholesky factorization was attempted but fails.
* CMatrix.cc (ComplexMatrix::rcond): Likewise.
* fMatrix.cc (FloatMatrix::rcond): Likewise.
* fCMatrix.cc (FloatComplexMatrix::rcond): Likewise.
* rcond.cc: New tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Sep 2012 15:14:47 -0400 |
parents | 72c96de7a403 |
children |
line wrap: on
line diff
--- a/liboctave/fCMatrix.cc +++ b/liboctave/fCMatrix.cc @@ -1782,13 +1782,15 @@ else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) { float anorm = -1.0; - FloatComplexMatrix atmp = *this; - FloatComplex *tmp_data = atmp.fortran_vec (); if (typ == MatrixType::Hermitian) { octave_idx_type info = 0; char job = 'L'; + + FloatComplexMatrix atmp = *this; + FloatComplex *tmp_data = atmp.fortran_vec (); + anorm = atmp.abs().sum(). row(static_cast<octave_idx_type>(0)).max(); @@ -1825,6 +1827,9 @@ { octave_idx_type info = 0; + FloatComplexMatrix atmp = *this; + FloatComplex *tmp_data = atmp.fortran_vec (); + Array<octave_idx_type> ipvt (dim_vector (nr, 1)); octave_idx_type *pipvt = ipvt.fortran_vec (); @@ -2094,8 +2099,10 @@ { info = 0; char job = 'L'; + FloatComplexMatrix atmp = *this; FloatComplex *tmp_data = atmp.fortran_vec (); + anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max(); F77_XFCN (cpotrf, CPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,