Mercurial > hg > octave-lyh
changeset 4932:43f4ebd2704c
[project @ 2004-08-05 13:26:10 by jwe]
author | jwe |
---|---|
date | Thu, 05 Aug 2004 13:26:15 +0000 |
parents | 1ed883f251e8 |
children | cd58733c326b |
files | liboctave/ChangeLog liboctave/intNDArray.cc liboctave/mx-inlines.cc src/Cell.h src/ChangeLog src/ov-base-int.cc |
diffstat | 6 files changed, 60 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2004-08-05 John W. Eaton <jwe@octave.org> + + * intNDArray.cc (intNDArray<T>::operator !, intNDArray<T>::all, + intNDArray<T>::any): Sprinkle with this-> as needed. + * mx-inlines.cc (MX_ND_REDUCTION, MX_ND_CUMULATIVE_OP): Likewise. + 2004-08-03 John W. Eaton <jwe@octave.org> * Array.cc (Array<T>::squeeze): Do nothing for 2-d arrays. For
--- a/liboctave/intNDArray.cc +++ b/liboctave/intNDArray.cc @@ -39,10 +39,10 @@ boolNDArray intNDArray<T>::operator ! (void) const { - boolNDArray b (dims ()); + boolNDArray b (this->dims ()); - for (int i = 0; i < length (); i++) - b.elem (i) = ! elem (i); + for (int i = 0; i < this->length (); i++) + b.elem (i) = ! this->elem (i); return b; } @@ -53,14 +53,14 @@ boolNDArray intNDArray<T>::all (int dim) const { - MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (elem (iter_idx) == T (0)), true); + MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (this->elem (iter_idx) == T (0)), true); } template <class T> boolNDArray intNDArray<T>::any (int dim) const { - MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (elem (iter_idx) == T (0)), false); + MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (this->elem (iter_idx) == T (0)), false); } template <class T>
--- a/liboctave/mx-inlines.cc +++ b/liboctave/mx-inlines.cc @@ -383,7 +383,7 @@ \ RET_TYPE retval; \ \ - dim_vector dv = dims (); \ + dim_vector dv = this->dims (); \ \ int empty = true; \ \ @@ -454,7 +454,7 @@ dv(dim) = 1; \ \ /* This finds the number of elements in retval */ \ - int num_iter = (numel () / dim_length); \ + int num_iter = (this->numel () / dim_length); \ \ /* Make sure retval has correct dimensions */ \ retval.resize (dv, RET_ELT_TYPE ()); \ @@ -501,7 +501,7 @@ #define MX_ND_CUMULATIVE_OP(RET_TYPE, ACC_TYPE, VAL, OP) \ RET_TYPE retval; \ \ - dim_vector dv = dims (); \ + dim_vector dv = this->dims (); \ \ int empty = true; \ \ @@ -574,7 +574,7 @@ dv (dim) = 1; \ \ /* This finds the number of elements in retval */ \ - int num_iter = (numel () / dim_length); \ + int num_iter = (this->numel () / dim_length); \ \ Array<int> iter_idx (dv.length (), 0); \ \
--- a/src/Cell.h +++ b/src/Cell.h @@ -94,10 +94,10 @@ { return ArrayN<octave_value>::reshape (new_dims); } // XXX FIXME XXX - boolMatrix all (int dim = 0) const { return boolMatrix (); } + boolMatrix all (int /* dim */ = 0) const { return boolMatrix (); } // XXX FIXME XXX - boolMatrix any (int dim = 0) const { return boolMatrix (); } + boolMatrix any (int /* dim */ = 0) const { return boolMatrix (); } friend Cell concat (const Cell& ra, const Cell& rb, const Array<int>& ra_idx);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,26 @@ 2004-08-05 John W. Eaton <jwe@octave.org> + * ov-base-int.cc (octave_base_int_matrix<T>::save_ascii, + octave_base_int_matrix<T>::load_ascii, + octave_base_int_matrix<T>::save_binary, + octave_base_int_matrix<T>::load_binary, + octave_base_int_matrix<T>::save_hdf5, + octave_base_int_matrix<T>::load_hdf5, + octave_base_int_matrix<T>::try_narrowing_conversion, + octave_base_int_scalar<T>::print_raw, + octave_base_int_scalar<T>::save_ascii, + octave_base_int_scalar<T>::load_ascii, + octave_base_int_scalar<T>::save_binary, + octave_base_int_scalar<T>::load_binary, + octave_base_int_scalar<T>::save_hdf5, + octave_base_int_scalar<T>::load_hdf5): + Sprinkle with this-> as needed. + + * Makefile.in (EXTRAS): New macro. Move ov-base-int.cc here from + OV_INTTYPE_SRC. + (INCLUDES_FOR_INSTALL): New macro. + (install-inc, uninstall): Use it instead of INCLUDES. + * variables.h (symbol_exist): Default for type is now "any". 2004-08-05 David Bateman <dbateman@free.fr>
--- a/src/ov-base-int.cc +++ b/src/ov-base-int.cc @@ -64,8 +64,8 @@ { octave_value *retval = 0; - if (matrix.nelem () == 1) - retval = new typename octave_value_int_traits<T>::scalar_type (matrix (0)); + if (this->matrix.nelem () == 1) + retval = new typename octave_value_int_traits<T>::scalar_type (this->matrix (0)); return retval; } @@ -74,14 +74,14 @@ bool octave_base_int_matrix<T>::save_ascii (std::ostream& os, bool&, bool) { - dim_vector d = dims (); + dim_vector d = this->dims (); os << "# ndims: " << d.length () << "\n"; for (int i = 0; i < d.length (); i++) os << " " << d (i); - os << "\n" << matrix; + os << "\n" << this->matrix; return true; } @@ -113,7 +113,7 @@ success = false; } - matrix = tmp; + this->matrix = tmp; } else { @@ -131,7 +131,7 @@ bool octave_base_int_matrix<T>::save_binary (std::ostream& os, bool&) { - dim_vector d = dims (); + dim_vector d = this->dims (); if (d.length() < 1) return false; @@ -144,7 +144,7 @@ os.write (X_CAST (char *, &tmp), 4); } - os.write (X_CAST(char *, matrix.data()), byte_size()); + os.write (X_CAST(char *, this->matrix.data()), this->byte_size()); return true; } @@ -203,7 +203,7 @@ } } - matrix = m; + this->matrix = m; return true; } @@ -215,7 +215,7 @@ { hid_t save_type_hid = HDF5_SAVE_TYPE; bool retval = true; - dim_vector dv = dims (); + dim_vector dv = this->dims (); int empty = save_hdf5_empty (loc_id, name, dv); if (empty) return (empty > 0); @@ -241,7 +241,7 @@ } retval = H5Dwrite (data_hid, save_type_hid, H5S_ALL, H5S_ALL, - H5P_DEFAULT, matrix.data()) >= 0; + H5P_DEFAULT, this->matrix.data()) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); @@ -259,7 +259,7 @@ dim_vector dv; int empty = load_hdf5_empty (loc_id, name, dv); if (empty > 0) - matrix.resize(dv); + this->matrix.resize(dv); if (empty) return (empty > 0); @@ -299,7 +299,7 @@ H5P_DEFAULT, m.fortran_vec()) >= 0) { retval = true; - matrix = m; + this->matrix = m; } H5Sclose (space_id); @@ -315,15 +315,15 @@ octave_base_int_matrix<T>::print_raw (std::ostream& os, bool pr_as_read_syntax) const { - octave_print_internal (os, matrix, pr_as_read_syntax, - current_print_indent_level ()); + octave_print_internal (os, this->matrix, pr_as_read_syntax, + this->current_print_indent_level ()); } template <class T> bool octave_base_int_scalar<T>::save_ascii (std::ostream& os, bool& , bool) { - os << scalar << "\n"; + os << this->scalar << "\n"; return true; } @@ -331,7 +331,7 @@ bool octave_base_int_scalar<T>::load_ascii (std::istream& is) { - is >> scalar; + is >> this->scalar; if (!is) { error ("load: failed to load scalar constant"); @@ -344,7 +344,7 @@ bool octave_base_int_scalar<T>::save_binary (std::ostream& os, bool&) { - os.write (X_CAST(char *, &scalar), byte_size()); + os.write (X_CAST(char *, &(this->scalar)), this->byte_size()); return true; } @@ -354,11 +354,11 @@ oct_mach_info::float_format) { T tmp; - if (! is.read (X_CAST (char *, &tmp), byte_size())) + if (! is.read (X_CAST (char *, &tmp), this->byte_size())) return false; if (swap) - switch (byte_size()) + switch (this->byte_size()) { case 8: swap_8_bytes (X_CAST (char *, &tmp)); @@ -373,7 +373,7 @@ default: break; } - scalar = tmp; + this->scalar = tmp; return true; } @@ -399,7 +399,7 @@ } retval = H5Dwrite (data_hid, save_type_hid, H5S_ALL, H5S_ALL, - H5P_DEFAULT, &scalar) >= 0; + H5P_DEFAULT, &(this->scalar)) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); @@ -432,7 +432,7 @@ return false; } - scalar = tmp; + this->scalar = tmp; H5Dclose (data_hid);