Mercurial > hg > octave-nkf
comparison liboctave/CMatrix.cc @ 13828:f1b023fd098d
always initialize info and rcon in Matrix determinant methods
* dMatrix.cc (Matrix::determinant): Always initialize info and rcon.
* CMatrix.cc (ComplexMatrix::determinant): Likewise.
* fMatrix.cc (FloatMatrix::determinant): Likewise.
* fCMatrix.cc (FloatComplexMatrix::determinant): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 05 Nov 2011 01:59:40 -0400 |
parents | 353c71c76f22 |
children | 8e25d6d1db10 |
comparison
equal
deleted
inserted
replaced
13827:822f80b90866 | 13828:f1b023fd098d |
---|---|
1569 octave_idx_type& info, double& rcon, | 1569 octave_idx_type& info, double& rcon, |
1570 int calc_cond) const | 1570 int calc_cond) const |
1571 { | 1571 { |
1572 ComplexDET retval (1.0); | 1572 ComplexDET retval (1.0); |
1573 | 1573 |
1574 info = 0; | |
1575 rcon = 0.0; | |
1576 | |
1574 octave_idx_type nr = rows (); | 1577 octave_idx_type nr = rows (); |
1575 octave_idx_type nc = cols (); | 1578 octave_idx_type nc = cols (); |
1576 | 1579 |
1577 if (nr != nc) | 1580 if (nr != nc) |
1578 (*current_liboctave_error_handler) ("matrix must be square"); | 1581 (*current_liboctave_error_handler) ("matrix must be square"); |
1597 else if (typ == MatrixType::Hermitian) | 1600 else if (typ == MatrixType::Hermitian) |
1598 { | 1601 { |
1599 ComplexMatrix atmp = *this; | 1602 ComplexMatrix atmp = *this; |
1600 Complex *tmp_data = atmp.fortran_vec (); | 1603 Complex *tmp_data = atmp.fortran_vec (); |
1601 | 1604 |
1602 info = 0; | |
1603 double anorm = 0; | 1605 double anorm = 0; |
1604 if (calc_cond) anorm = xnorm (*this, 1); | 1606 if (calc_cond) anorm = xnorm (*this, 1); |
1605 | 1607 |
1606 | 1608 |
1607 char job = 'L'; | 1609 char job = 'L'; |