comparison liboctave/fMatrix.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 6dfebfa334cb
children 72c96de7a403
comparison
equal deleted inserted replaced
13827:822f80b90866 13828:f1b023fd098d
1237 FloatMatrix::determinant (MatrixType& mattype, 1237 FloatMatrix::determinant (MatrixType& mattype,
1238 octave_idx_type& info, float& rcon, int calc_cond) const 1238 octave_idx_type& info, float& rcon, int calc_cond) const
1239 { 1239 {
1240 FloatDET retval (1.0); 1240 FloatDET retval (1.0);
1241 1241
1242 info = 0;
1243 rcon = 0.0;
1244
1242 octave_idx_type nr = rows (); 1245 octave_idx_type nr = rows ();
1243 octave_idx_type nc = cols (); 1246 octave_idx_type nc = cols ();
1244 1247
1245 if (nr != nc) 1248 if (nr != nc)
1246 (*current_liboctave_error_handler) ("matrix must be square"); 1249 (*current_liboctave_error_handler) ("matrix must be square");
1265 else if (typ == MatrixType::Hermitian) 1268 else if (typ == MatrixType::Hermitian)
1266 { 1269 {
1267 FloatMatrix atmp = *this; 1270 FloatMatrix atmp = *this;
1268 float *tmp_data = atmp.fortran_vec (); 1271 float *tmp_data = atmp.fortran_vec ();
1269 1272
1270 info = 0;
1271 float anorm = 0; 1273 float anorm = 0;
1272 if (calc_cond) anorm = xnorm (*this, 1); 1274 if (calc_cond) anorm = xnorm (*this, 1);
1273 1275
1274 1276
1275 char job = 'L'; 1277 char job = 'L';