Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/sparse.cc @ 5760:8d7162924bd3
[project @ 2006-04-14 04:01:37 by jwe]
author | jwe |
---|---|
date | Fri, 14 Apr 2006 04:01:40 +0000 |
parents | ce79d238f142 |
children | 080c08b192d8 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/sparse.cc Thu Apr 13 13:04:33 2006 +0000 +++ b/src/DLD-FUNCTIONS/sparse.cc Fri Apr 14 04:01:40 2006 +0000 @@ -149,23 +149,17 @@ { if (use_complex) { - SparseComplexMatrix sm (((const octave_sparse_complex_matrix&) arg - .get_rep ()) - .sparse_complex_matrix_value ()); + SparseComplexMatrix sm = arg.sparse_complex_matrix_value (); retval = new octave_sparse_complex_matrix (sm); } else if (use_bool) { - SparseBoolMatrix sm (((const octave_sparse_bool_matrix&) arg - .get_rep ()) - .sparse_bool_matrix_value ()); + SparseBoolMatrix sm = arg.sparse_bool_matrix_value (); retval = new octave_sparse_bool_matrix (sm); } else { - SparseMatrix sm (((const octave_sparse_matrix&) arg - .get_rep ()) - .sparse_matrix_value ()); + SparseMatrix sm = arg.sparse_matrix_value (); retval = new octave_sparse_matrix (sm); } } @@ -380,10 +374,11 @@ { octave_value retval; - if (args.length() < 1) { - print_usage ("full"); - return retval; - } + if (args.length() < 1) + { + print_usage ("full"); + return retval; + } if (args(0).is_sparse_type ()) { @@ -430,18 +425,19 @@ if (dv(0) == 1) { - retval(0)= I.transpose (); - retval(1)= J.transpose (); - retval(2)= S.transpose (); + retval(0) = I.transpose (); + retval(1) = J.transpose (); + retval(2) = S.transpose (); } else { - retval(0)= I; - retval(1)= J; - retval(2)= S; + retval(0) = I; + retval(1) = J; + retval(2) = S; } - retval(3)= (double) nr; - retval(4)= (double) nc; + retval(3) = static_cast<double> (nr); + retval(4) = static_cast<double> (nc); + return retval; } @@ -471,18 +467,19 @@ if (dv(0) == 1) { - retval(0)= I.transpose (); - retval(1)= J.transpose (); - retval(2)= S.transpose (); + retval(0) = I.transpose (); + retval(1) = J.transpose (); + retval(2) = S.transpose (); } else { - retval(0)= I; - retval(1)= J; - retval(2)= S; + retval(0) = I; + retval(1) = J; + retval(2) = S; } - retval(3)= (double) nr; - retval(4)= (double) nc; + retval(3) = static_cast<double> (nr); + retval(4) = static_cast<double> (nc); + return retval; } @@ -512,18 +509,19 @@ if (dv(0) == 1) { - retval(0)= I.transpose (); - retval(1)= J.transpose (); - retval(2)= S.transpose (); + retval(0) = I.transpose (); + retval(1) = J.transpose (); + retval(2) = S.transpose (); } else { - retval(0)= I; - retval(1)= J; - retval(2)= S; + retval(0) = I; + retval(1) = J; + retval(2) = S; } - retval(3)= (double) nr; - retval(4)= (double) nc; + retval(3) = static_cast<double> (nr); + retval(4) = static_cast<double> (nc); + return retval; }