# HG changeset patch # User Jaroslav Hajek # Date 1279015688 -7200 # Node ID c2041adcf2342b63c5b5a90c2e7a5b774a369c58 # Parent ca2df6737d6b54d63d95d53cc4b26aaf8ac36fe1 remove unnecessary sparse indexing overloads diff -r ca2df6737d6b -r c2041adcf234 liboctave/CSparse.cc --- a/liboctave/CSparse.cc Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/CSparse.cc Tue Jul 13 12:08:08 2010 +0200 @@ -7180,18 +7180,6 @@ } SparseComplexMatrix -SparseComplexMatrix::index (const idx_vector& i, bool resize_ok) const -{ - return MSparse::index (i, resize_ok); -} - -SparseComplexMatrix -SparseComplexMatrix::index (const idx_vector& i, const idx_vector& j, bool resize_ok) const -{ - return MSparse::index (i, j, resize_ok); -} - -SparseComplexMatrix SparseComplexMatrix::reshape (const dim_vector& new_dims) const { return MSparse::reshape (new_dims); diff -r ca2df6737d6b -r c2041adcf234 liboctave/CSparse.h --- a/liboctave/CSparse.h Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/CSparse.h Tue Jul 13 12:08:08 2010 +0200 @@ -395,10 +395,6 @@ SparseComplexMatrix squeeze (void) const; - SparseComplexMatrix index (const idx_vector& i, bool resize_ok) const; - - SparseComplexMatrix index (const idx_vector& i, const idx_vector& j, bool resize_ok) const; - SparseComplexMatrix reshape (const dim_vector& new_dims) const; SparseComplexMatrix permute (const Array& vec, diff -r ca2df6737d6b -r c2041adcf234 liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/ChangeLog Tue Jul 13 12:08:08 2010 +0200 @@ -1,3 +1,11 @@ +2010-07-13 Jaroslav Hajek + + * MSparse.h (MSparse::index): Remove overloads. + * dSparse.h (SparseMatrix::index): Likewise. + * dSparse.cc (SparseMatrix::index): Likewise. + * CSparse.h (SparseComplexMatrix::index): Likewise. + * CSparse.cc (SparseComplexMatrix::index): Likewise. + 2010-07-09 Jaroslav Hajek * CMatrix.cc (ComplexMatrix::lssolve (const ComplexMatrix&)): diff -r ca2df6737d6b -r c2041adcf234 liboctave/MSparse.h --- a/liboctave/MSparse.h Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/MSparse.h Tue Jul 13 12:08:08 2010 +0200 @@ -91,12 +91,6 @@ MSparse squeeze (void) const { return Sparse::squeeze (); } - MSparse index (const idx_vector& i, bool resize_ok) const - { return Sparse::index (i, resize_ok); } - - MSparse index (const idx_vector& i, const idx_vector& j, bool resize_ok) const - { return Sparse::index (i, j, resize_ok); } - MSparse reshape (const dim_vector& new_dims) const { return Sparse::reshape (new_dims); } diff -r ca2df6737d6b -r c2041adcf234 liboctave/dSparse.cc --- a/liboctave/dSparse.cc Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/dSparse.cc Tue Jul 13 12:08:08 2010 +0200 @@ -7594,18 +7594,6 @@ } SparseMatrix -SparseMatrix::index (const idx_vector& i, bool resize_ok) const -{ - return MSparse::index (i, resize_ok); -} - -SparseMatrix -SparseMatrix::index (const idx_vector& i, const idx_vector& j, bool resize_ok) const -{ - return MSparse::index (i, j, resize_ok); -} - -SparseMatrix SparseMatrix::reshape (const dim_vector& new_dims) const { return MSparse::reshape (new_dims); diff -r ca2df6737d6b -r c2041adcf234 liboctave/dSparse.h --- a/liboctave/dSparse.h Mon Jul 12 21:32:18 2010 +0200 +++ b/liboctave/dSparse.h Tue Jul 13 12:08:08 2010 +0200 @@ -406,10 +406,6 @@ SparseMatrix squeeze (void) const; - SparseMatrix index (const idx_vector& i, bool resize_ok) const; - - SparseMatrix index (const idx_vector& i, const idx_vector& j, bool resize_ok) const; - SparseMatrix reshape (const dim_vector& new_dims) const; SparseMatrix permute (const Array& vec, bool inv = false) const; diff -r ca2df6737d6b -r c2041adcf234 src/ChangeLog --- a/src/ChangeLog Mon Jul 12 21:32:18 2010 +0200 +++ b/src/ChangeLog Tue Jul 13 12:08:08 2010 +0200 @@ -1,3 +1,7 @@ +2010-07-13 Jaroslav Hajek + + * data.cc (do_sparse_diff): Use typecasts where needed. + 2010-07-12 Jaroslav Hajek * DLD-FUNCTIONS/rand.cc (do_rand): Pass the distribution name as an diff -r ca2df6737d6b -r c2041adcf234 src/data.cc --- a/src/data.cc Mon Jul 12 21:32:18 2010 +0200 +++ b/src/data.cc Tue Jul 13 12:08:08 2010 +0200 @@ -6299,7 +6299,7 @@ while (order > 0 && k > 0) { idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); - retval = retval.index (col1, sl1, 0) - retval.index (col2, sl2, 0); + retval = SparseT (retval.index (col1, sl1)) - SparseT (retval.index (col2, sl2)); assert (retval.columns () == k-1); order--; k--; @@ -6311,7 +6311,7 @@ while (order > 0 && k > 0) { idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); - retval = retval.index (sl1, col1, 0) - retval.index (sl2, col2, 0); + retval = SparseT (retval.index (sl1, col1)) - SparseT (retval.index (sl2, col2)); assert (retval.rows () == k-1); order--; k--;