Mercurial > hg > octave-avbm
changeset 6867:83619ae96c1d
[project @ 2007-09-06 12:08:44 by dbateman]
author | dbateman |
---|---|
date | Thu, 06 Sep 2007 12:08:45 +0000 |
parents | f7bc1c20800e |
children | 975fcdfb0d2d |
files | liboctave/Array.cc liboctave/Array.h liboctave/ArrayN.h liboctave/CMatrix.cc liboctave/ChangeLog liboctave/MArrayN.h liboctave/so-array.cc liboctave/so-array.h src/ChangeLog src/data.cc src/ov.cc src/ov.h src/pt-mat.cc |
diffstat | 13 files changed, 49 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -333,7 +333,7 @@ template <class T> T -Array<T>::range_error (const char *fcn, const Array<int>& ra_idx) const +Array<T>::range_error (const char *fcn, const Array<octave_idx_type>& ra_idx) const { std::ostringstream buf; @@ -358,7 +358,7 @@ template <class T> T& -Array<T>::range_error (const char *fcn, const Array<int>& ra_idx) +Array<T>::range_error (const char *fcn, const Array<octave_idx_type>& ra_idx) { std::ostringstream buf;
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -284,8 +284,8 @@ T range_error (const char *fcn, octave_idx_type i, octave_idx_type j, octave_idx_type k) const; T& range_error (const char *fcn, octave_idx_type i, octave_idx_type j, octave_idx_type k); - T range_error (const char *fcn, const Array<int>& ra_idx) const; - T& range_error (const char *fcn, const Array<int>& ra_idx); + T range_error (const char *fcn, const Array<octave_idx_type>& ra_idx) const; + T& range_error (const char *fcn, const Array<octave_idx_type>& ra_idx); // No checking, even for multiple references, ever. @@ -298,10 +298,10 @@ T& xelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) { return xelem (i, dim2()*k+j); } T xelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const { return xelem (i, dim2()*k+j); } - T& xelem (const Array<int>& ra_idx) + T& xelem (const Array<octave_idx_type>& ra_idx) { return xelem (compute_index (ra_idx)); } - T xelem (const Array<int>& ra_idx) const + T xelem (const Array<octave_idx_type>& ra_idx) const { return xelem (compute_index (ra_idx)); } // FIXME -- would be nice to fix this so that we don't @@ -335,7 +335,7 @@ return elem (i, dim2()*k+j); } - T& checkelem (const Array<int>& ra_idx) + T& checkelem (const Array<octave_idx_type>& ra_idx) { octave_idx_type i = compute_index (ra_idx); @@ -355,19 +355,19 @@ T& elem (octave_idx_type i, octave_idx_type j, octave_idx_type k) { return elem (i, dim2()*k+j); } - T& elem (const Array<int>& ra_idx) + T& elem (const Array<octave_idx_type>& ra_idx) { return Array<T>::elem (compute_index (ra_idx)); } #if defined (BOUNDS_CHECKING) T& operator () (octave_idx_type n) { return checkelem (n); } T& operator () (octave_idx_type i, octave_idx_type j) { return checkelem (i, j); } T& operator () (octave_idx_type i, octave_idx_type j, octave_idx_type k) { return checkelem (i, j, k); } - T& operator () (const Array<int>& ra_idx) { return checkelem (ra_idx); } + T& operator () (const Array<octave_idx_type>& ra_idx) { return checkelem (ra_idx); } #else T& operator () (octave_idx_type n) { return elem (n); } T& operator () (octave_idx_type i, octave_idx_type j) { return elem (i, j); } T& operator () (octave_idx_type i, octave_idx_type j, octave_idx_type k) { return elem (i, j, k); } - T& operator () (const Array<int>& ra_idx) { return elem (ra_idx); } + T& operator () (const Array<octave_idx_type>& ra_idx) { return elem (ra_idx); } #endif T checkelem (octave_idx_type n) const @@ -394,7 +394,7 @@ return Array<T>::elem (i, Array<T>::dim1()*k+j); } - T checkelem (const Array<int>& ra_idx) const + T checkelem (const Array<octave_idx_type>& ra_idx) const { octave_idx_type i = compute_index (ra_idx); @@ -410,19 +410,19 @@ T elem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const { return elem (i, dim2()*k+j); } - T elem (const Array<int>& ra_idx) const + T elem (const Array<octave_idx_type>& ra_idx) const { return Array<T>::elem (compute_index (ra_idx)); } #if defined (BOUNDS_CHECKING) T operator () (octave_idx_type n) const { return checkelem (n); } T operator () (octave_idx_type i, octave_idx_type j) const { return checkelem (i, j); } T operator () (octave_idx_type i, octave_idx_type j, octave_idx_type k) const { return checkelem (i, j, k); } - T operator () (const Array<int>& ra_idx) const { return checkelem (ra_idx); } + T operator () (const Array<octave_idx_type>& ra_idx) const { return checkelem (ra_idx); } #else T operator () (octave_idx_type n) const { return elem (n); } T operator () (octave_idx_type i, octave_idx_type j) const { return elem (i, j); } T operator () (octave_idx_type i, octave_idx_type j, octave_idx_type k) const { return elem (i, j, k); } - T operator () (const Array<int>& ra_idx) const { return elem (ra_idx); } + T operator () (const Array<octave_idx_type>& ra_idx) const { return elem (ra_idx); } #endif Array<T> reshape (const dim_vector& new_dims) const;
--- a/liboctave/ArrayN.h +++ b/liboctave/ArrayN.h @@ -87,10 +87,10 @@ ArrayN<T> reshape (const dim_vector& new_dims) const { return Array<T>::reshape (new_dims); } - ArrayN<T> permute (const Array<int>& vec, bool inv = false) const + ArrayN<T> permute (const Array<octave_idx_type>& vec, bool inv = false) const { return Array<T>::permute (vec, inv); } - ArrayN<T> ipermute (const Array<int>& vec) const + ArrayN<T> ipermute (const Array<octave_idx_type>& vec) const { return Array<T>::ipermute (vec); } void resize (const dim_vector& dv)
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -2761,14 +2761,14 @@ OCTAVE_QUIT; // construct balancing permutation vector - Array<int> iperm (nc); + Array<octave_idx_type> iperm (nc); for (octave_idx_type i = 0; i < nc; i++) iperm(i) = i; // initialize to identity permutation // leading permutations in forward order for (octave_idx_type i = 0; i < (ilo-1); i++) { - octave_idx_type swapidx = static_cast<int> (dpermute(i)) - 1; + octave_idx_type swapidx = static_cast<octave_idx_type> (dpermute(i)) - 1; octave_idx_type tmp = iperm(i); iperm(i) = iperm(swapidx); iperm(swapidx) = tmp; @@ -2777,14 +2777,14 @@ // trailing permutations must be done in reverse order for (octave_idx_type i = nc - 1; i >= ihi; i--) { - octave_idx_type swapidx = static_cast<int> (dpermute(i)) - 1; + octave_idx_type swapidx = static_cast<octave_idx_type> (dpermute(i)) - 1; octave_idx_type tmp = iperm(i); iperm(i) = iperm(swapidx); iperm(swapidx) = tmp; } // construct inverse balancing permutation vector - Array<int> invpvec (nc); + Array<octave_idx_type> invpvec (nc); for (octave_idx_type i = 0; i < nc; i++) invpvec(iperm(i)) = i; // Thanks to R. A. Lippert for this method
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,15 @@ +2007-09-06 David Bateman <dbateman@free.fr> + + * Array.h (range_error, xelem, checkelem, elem, operator ()): + Modify use of Array<int> to Array<octave_idx_type> and adjust + where necessary. + * Array.cc (range_error): ditto. + * MArrayN.h (permute, ipermute): ditto. + * ArrayN.h (permute, ipermute): ditto. + * so-array.cc (streamoff_array::compute_index): ditto. + * so-array.h (compute_index): ditto. + * CMattrix.cc (ComplexMatrix::exmpm): ditto. + 2007-08-29 David Bateman <dbateman@free.fr> * dSparse.cc (SparseMatrix SparseMatrix::inverse (MatrixType &,
--- a/liboctave/MArrayN.h +++ b/liboctave/MArrayN.h @@ -90,10 +90,11 @@ MArrayN<T> reshape (const dim_vector& new_dims) const { return ArrayN<T>::reshape (new_dims); } - MArrayN<T> permute (const Array<int>& vec, bool inv = false) const + MArrayN<T> permute (const Array<octave_idx_type>& vec, + bool inv = false) const { return ArrayN<T>::permute (vec, inv); } - MArrayN<T> ipermute (const Array<int>& vec) const + MArrayN<T> ipermute (const Array<octave_idx_type>& vec) const { return ArrayN<T>::ipermute (vec); } MArrayN squeeze (void) const { return ArrayN<T>::squeeze (); }
--- a/liboctave/so-array.cc +++ b/liboctave/so-array.cc @@ -97,7 +97,7 @@ } octave_idx_type -streamoff_array::compute_index (Array<int>& ra_idx, +streamoff_array::compute_index (Array<octave_idx_type>& ra_idx, const dim_vector& dimensions) { return ::compute_index (ra_idx, dimensions);
--- a/liboctave/so-array.h +++ b/liboctave/so-array.h @@ -82,7 +82,7 @@ boolNDArray all (int dim = -1) const; boolNDArray any (int dim = -1) const; - static octave_idx_type compute_index (Array<int>& ra_idx, + static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx, const dim_vector& dimensions); static std::streamoff resize_fill_value (void) { return 0; }
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2007-09-06 David Bateman <dbateman@free.fr> + + * ov.cc (do_cat_op): Modify use of Array<int> to + Array<octave_idx_type> and adjust where necessary. + * ov.h (do_cat_op): ditto. + * data.cc (do_cat): ditto. + * pt-mat.cc (tree_matrix::rvalue): ditto. + 2007-09-05 Michael Goffioul <michael.goffioul@gmail.com> * oct-stream.cc (octave_base_stream::do_printf): Ignore precision
--- a/src/data.cc +++ b/src/data.cc @@ -759,7 +759,7 @@ if (error_state) return retval; - Array<int> ra_idx (dv.length (), 0); + Array<octave_idx_type> ra_idx (dv.length (), 0); for (int j = i; j < n_args; j++) {
--- a/src/ov.cc +++ b/src/ov.cc @@ -1403,7 +1403,7 @@ octave_value do_cat_op (const octave_value& v1, const octave_value& v2, - const Array<int>& ra_idx) + const Array<octave_idx_type>& ra_idx) { octave_value retval;
--- a/src/ov.h +++ b/src/ov.h @@ -796,7 +796,7 @@ friend OCTINTERP_API octave_value do_cat_op (const octave_value& a, const octave_value& b, - const Array<int>& ra_idx); + const Array<octave_idx_type>& ra_idx); const octave_base_value& get_rep (void) const { return *rep; }
--- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -910,7 +910,7 @@ // insert them in the result matrix. int dv_len = dv.length (); - Array<int> ra_idx (dv_len > 1 ? dv_len : 2, 0); + Array<octave_idx_type> ra_idx (dv_len > 1 ? dv_len : 2, 0); for (tm_const::iterator p = tmp.begin (); p != tmp.end (); p++) {