Mercurial > hg > octave-nkf
comparison liboctave/array/CSparse.cc @ 18831:5bd1ca29c5f0
Clean up questionable code bits identified by clang sanitize.
* data.cc (Fnorm): in %!test, don't test with a single value which exceeds
range of single.
* find.cc (find_nonzero_elem_idx): Remove unused variable assignment to
n_to_find.
* load-save.cc (Fsave): Declare argc just before usage.
* ls-hdf5.cc (hdf5_read_next_data): Return from function immediately if type is
unrecognized.
* oct-stream.cc (octave_stream::read): Eliminate unnecessary initialization of
elts_to_read.
* octave-link.cc (F__octave_link_file_dialog__): Eliminate unnecessary
initialization of nel.
* pr-output.cc (set_real_format): Don't assign to function input variable
digits.
* str2double.cc (single_num): Initialize return value num at start of function.
* ov-complex.cc (octave_complex::double_value, octave_complex::float_value):
Eliminate unnecessary initialization of retval.
* ov-flt-complex.cc (octave_float_complex::double_value,
octave_float_complex::float_value):
Eliminate unnecessary initialization of retval.
* CSparse.cc (SparseComplexMatrix::inverse): Remove useless asignment to typ.
* CSparse.cc (SparseComplexMatrix::bsolve): Initialize anorm before using in
comparison.
* MatrixType.cc (matrix_complex_probe): Initialize typ to MatrixType::Unknown.
* dSparse.cc (SparseMatrix::inverse): Remove useless assignment to typ.
* dSparse.cc (SparseMatrix::bsolve): Initialize anorm before using in
comparison.
* lo-specfun.cc (gammainc): Remove useless assignment to err.
* data-conv.cc (oct_data_conv::string_to_data_type): Remove useless assignment
to input_is_output.
* str-vec.cc (string_vector::list_in_columns): Remove useless assignment to nc.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 25 Apr 2014 10:02:10 -0700 |
parents | 2217bc116aa9 |
children | 6113e0c6920b |
comparison
equal
deleted
inserted
replaced
18828:1dcc9539234c | 18831:5bd1ca29c5f0 |
---|---|
1116 } | 1116 } |
1117 else | 1117 else |
1118 { | 1118 { |
1119 // Matrix is either singular or not positive definite | 1119 // Matrix is either singular or not positive definite |
1120 mattype.mark_as_unsymmetric (); | 1120 mattype.mark_as_unsymmetric (); |
1121 typ = MatrixType::Full; | |
1122 } | 1121 } |
1123 } | 1122 } |
1124 | 1123 |
1125 if (!mattype.is_hermitian ()) | 1124 if (!mattype.is_hermitian ()) |
1126 { | 1125 { |
4527 for (octave_idx_type j = 0; j < nc; j++) | 4526 for (octave_idx_type j = 0; j < nc; j++) |
4528 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) | 4527 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) |
4529 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); | 4528 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); |
4530 | 4529 |
4531 // Calculate the norm of the matrix, for later use. | 4530 // Calculate the norm of the matrix, for later use. |
4532 double anorm; | 4531 double anorm = 0.0; |
4533 if (calc_cond) | 4532 if (calc_cond) |
4534 { | 4533 { |
4535 for (octave_idx_type j = 0; j < nr; j++) | 4534 for (octave_idx_type j = 0; j < nr; j++) |
4536 { | 4535 { |
4537 double atmp = 0.; | 4536 double atmp = 0.; |
4809 for (octave_idx_type j = 0; j < nc; j++) | 4808 for (octave_idx_type j = 0; j < nc; j++) |
4810 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) | 4809 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) |
4811 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); | 4810 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); |
4812 | 4811 |
4813 // Calculate the norm of the matrix, for later use. | 4812 // Calculate the norm of the matrix, for later use. |
4814 double anorm; | 4813 double anorm = 0.0; |
4815 if (calc_cond) | 4814 if (calc_cond) |
4816 { | 4815 { |
4817 for (octave_idx_type j = 0; j < nr; j++) | 4816 for (octave_idx_type j = 0; j < nr; j++) |
4818 { | 4817 { |
4819 double atmp = 0.; | 4818 double atmp = 0.; |
5094 for (octave_idx_type j = 0; j < nc; j++) | 5093 for (octave_idx_type j = 0; j < nc; j++) |
5095 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) | 5094 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) |
5096 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); | 5095 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); |
5097 | 5096 |
5098 // Calculate the norm of the matrix, for later use. | 5097 // Calculate the norm of the matrix, for later use. |
5099 double anorm; | 5098 double anorm = 0.0; |
5100 if (calc_cond) | 5099 if (calc_cond) |
5101 { | 5100 { |
5102 for (octave_idx_type j = 0; j < nr; j++) | 5101 for (octave_idx_type j = 0; j < nr; j++) |
5103 { | 5102 { |
5104 double atmp = 0.; | 5103 double atmp = 0.; |
5381 for (octave_idx_type j = 0; j < nc; j++) | 5380 for (octave_idx_type j = 0; j < nc; j++) |
5382 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) | 5381 for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) |
5383 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); | 5382 m_band(ridx (i) - j + n_lower + n_upper, j) = data (i); |
5384 | 5383 |
5385 // Calculate the norm of the matrix, for later use. | 5384 // Calculate the norm of the matrix, for later use. |
5386 double anorm; | 5385 double anorm = 0.0; |
5387 if (calc_cond) | 5386 if (calc_cond) |
5388 { | 5387 { |
5389 for (octave_idx_type j = 0; j < nr; j++) | 5388 for (octave_idx_type j = 0; j < nr; j++) |
5390 { | 5389 { |
5391 double atmp = 0.; | 5390 double atmp = 0.; |