Mercurial > octave-nkf
comparison liboctave/dSparse.cc @ 10431:5dd7a7bf4950
simplify sparse->full conversions in liboctave
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 22 Mar 2010 12:05:33 +0100 |
parents | 99e9bae2d81e |
children | 4d1fc073fbb7 |
comparison
equal
deleted
inserted
replaced
10430:f1567b3e1108 | 10431:5dd7a7bf4950 |
---|---|
7552 } | 7552 } |
7553 | 7553 |
7554 Matrix | 7554 Matrix |
7555 SparseMatrix::matrix_value (void) const | 7555 SparseMatrix::matrix_value (void) const |
7556 { | 7556 { |
7557 octave_idx_type nr = rows (); | 7557 return Sparse<double>::array_value (); |
7558 octave_idx_type nc = cols (); | |
7559 | |
7560 Matrix retval (nr, nc, 0.0); | |
7561 for (octave_idx_type j = 0; j < nc; j++) | |
7562 for (octave_idx_type i = cidx(j); i < cidx(j+1); i++) | |
7563 retval.elem (ridx(i), j) = data (i); | |
7564 | |
7565 return retval; | |
7566 } | 7558 } |
7567 | 7559 |
7568 std::ostream& | 7560 std::ostream& |
7569 operator << (std::ostream& os, const SparseMatrix& a) | 7561 operator << (std::ostream& os, const SparseMatrix& a) |
7570 { | 7562 { |