# HG changeset patch # User Jaroslav Hajek # Date 1255691551 -7200 # Node ID b4fdfee405b5cab18551b0fb6705bf7b300f1da5 # Parent 7b9cbaad68d64b9c7770adb3857f700480ba5806 remove ArrayN + fix nonhom. diag-scalar ops diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-C.cc --- a/liboctave/Array-C.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-C.cc Fri Oct 16 13:12:31 2009 +0200 @@ -96,12 +96,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-b.cc --- a/liboctave/Array-b.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-b.cc Fri Oct 16 13:12:31 2009 +0200 @@ -39,12 +39,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-ch.cc --- a/liboctave/Array-ch.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-ch.cc Fri Oct 16 13:12:31 2009 +0200 @@ -39,12 +39,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-d.cc --- a/liboctave/Array-d.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-d.cc Fri Oct 16 13:12:31 2009 +0200 @@ -92,12 +92,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-f.cc --- a/liboctave/Array-f.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-f.cc Fri Oct 16 13:12:31 2009 +0200 @@ -92,12 +92,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array-fC.cc --- a/liboctave/Array-fC.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array-fC.cc Fri Oct 16 13:12:31 2009 +0200 @@ -97,12 +97,7 @@ template class OCTAVE_API Array2; -#include "ArrayN.h" -#include "ArrayN.cc" - -template class OCTAVE_API ArrayN; - -template OCTAVE_API std::ostream& operator << (std::ostream&, const ArrayN&); +template OCTAVE_API std::ostream& operator << (std::ostream&, const Array&); #include "DiagArray2.h" #include "DiagArray2.cc" diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array.cc --- a/liboctave/Array.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array.cc Fri Oct 16 13:12:31 2009 +0200 @@ -2937,6 +2937,109 @@ template <> void Array::instantiation_guard () { } \ template class API Array +// FIXME: is this used? + +template +std::ostream& +operator << (std::ostream& os, const Array& a) +{ + dim_vector a_dims = a.dims (); + + int n_dims = a_dims.length (); + + os << n_dims << "-dimensional array"; + + if (n_dims) + os << " (" << a_dims.str () << ")"; + + os <<"\n\n"; + + if (n_dims) + { + os << "data:"; + + Array ra_idx (n_dims, 0); + + // Number of times the first 2d-array is to be displayed. + + octave_idx_type m = 1; + for (int i = 2; i < n_dims; i++) + m *= a_dims(i); + + if (m == 1) + { + octave_idx_type rows = 0; + octave_idx_type cols = 0; + + switch (n_dims) + { + case 2: + rows = a_dims(0); + cols = a_dims(1); + + for (octave_idx_type j = 0; j < rows; j++) + { + ra_idx(0) = j; + for (octave_idx_type k = 0; k < cols; k++) + { + ra_idx(1) = k; + os << " " << a.elem(ra_idx); + } + os << "\n"; + } + break; + + default: + rows = a_dims(0); + + for (octave_idx_type k = 0; k < rows; k++) + { + ra_idx(0) = k; + os << " " << a.elem(ra_idx); + } + break; + } + + os << "\n"; + } + else + { + octave_idx_type rows = a_dims(0); + octave_idx_type cols = a_dims(1); + + for (int i = 0; i < m; i++) + { + os << "\n(:,:,"; + + for (int j = 2; j < n_dims - 1; j++) + os << ra_idx(j) + 1 << ","; + + os << ra_idx(n_dims - 1) + 1 << ") = \n"; + + for (octave_idx_type j = 0; j < rows; j++) + { + ra_idx(0) = j; + + for (octave_idx_type k = 0; k < cols; k++) + { + ra_idx(1) = k; + os << " " << a.elem(ra_idx); + } + + os << "\n"; + } + + os << "\n"; + + if (i != m - 1) + increment_index (ra_idx, a_dims, 2); + } + } + } + + return os; +} + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/Array.h --- a/liboctave/Array.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/Array.h Fri Oct 16 13:12:31 2009 +0200 @@ -735,6 +735,10 @@ #endif +template +std::ostream& +operator << (std::ostream& os, const Array& a); + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/ArrayN.cc --- a/liboctave/ArrayN.cc Fri Oct 16 10:28:26 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -// Template array classes -/* - -Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 3 of the License, or (at your -option) any later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, see -. - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include "Array-util.h" -#include "ArrayN.h" -#include "idx-vector.h" -#include "lo-error.h" - -// N-dimensional array class. - -template -std::ostream& -operator << (std::ostream& os, const ArrayN& a) -{ - dim_vector a_dims = a.dims (); - - int n_dims = a_dims.length (); - - os << n_dims << "-dimensional array"; - - if (n_dims) - os << " (" << a_dims.str () << ")"; - - os <<"\n\n"; - - if (n_dims) - { - os << "data:"; - - Array ra_idx (n_dims, 0); - - // Number of times the first 2d-array is to be displayed. - - octave_idx_type m = 1; - for (int i = 2; i < n_dims; i++) - m *= a_dims(i); - - if (m == 1) - { - octave_idx_type rows = 0; - octave_idx_type cols = 0; - - switch (n_dims) - { - case 2: - rows = a_dims(0); - cols = a_dims(1); - - for (octave_idx_type j = 0; j < rows; j++) - { - ra_idx(0) = j; - for (octave_idx_type k = 0; k < cols; k++) - { - ra_idx(1) = k; - os << " " << a.elem(ra_idx); - } - os << "\n"; - } - break; - - default: - rows = a_dims(0); - - for (octave_idx_type k = 0; k < rows; k++) - { - ra_idx(0) = k; - os << " " << a.elem(ra_idx); - } - break; - } - - os << "\n"; - } - else - { - octave_idx_type rows = a_dims(0); - octave_idx_type cols = a_dims(1); - - for (int i = 0; i < m; i++) - { - os << "\n(:,:,"; - - for (int j = 2; j < n_dims - 1; j++) - os << ra_idx(j) + 1 << ","; - - os << ra_idx(n_dims - 1) + 1 << ") = \n"; - - for (octave_idx_type j = 0; j < rows; j++) - { - ra_idx(0) = j; - - for (octave_idx_type k = 0; k < cols; k++) - { - ra_idx(1) = k; - os << " " << a.elem(ra_idx); - } - - os << "\n"; - } - - os << "\n"; - - if (i != m - 1) - increment_index (ra_idx, a_dims, 2); - } - } - } - - return os; -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/ArrayN.h --- a/liboctave/ArrayN.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/ArrayN.h Fri Oct 16 13:12:31 2009 +0200 @@ -25,153 +25,13 @@ #if !defined (octave_ArrayN_h) #define octave_ArrayN_h 1 -#include -#include -#include - -#include - #include "Array.h" -#include "Array2.h" -#include "lo-error.h" -#include "lo-math.h" - -class idx_vector; - -// N-dimensional array class. - -template -class -ArrayN : public Array -{ -protected: - - ArrayN (T *d, const dim_vector& dv) : Array (d, dv) { } - -public: - - // These really need to be protected (and they will be in the - // future, so don't depend on them being here!), but they can't be - // until template friends work correctly in g++. - - ArrayN (void) : Array () { } - - ArrayN (const dim_vector& dv) : Array (dv) { } - - ArrayN (const dim_vector& dv, const T& val) - : Array (dv) { Array::fill (val); } - - template - explicit ArrayN (const Array2& a) : Array (a, a.dims ()) { } - - template - ArrayN (const ArrayN& a) : Array (a, a.dims ()) { } - - template - ArrayN (const Array& a) : Array (a) { } - - template - ArrayN (const Array& a, const dim_vector& dv) - : Array (a, dv) { } - - ~ArrayN (void) { } - - ArrayN& operator = (const ArrayN& a) - { - if (this != &a) - Array::operator = (a); - - return *this; - } - - ArrayN column (octave_idx_type k) const - { return Array::column (k); } - ArrayN page (octave_idx_type k) const - { return Array::page (k); } - - ArrayN linearize (void) const - { return Array::linearize (); } - ArrayN linear_slice (octave_idx_type lo, octave_idx_type up) const - { return Array::linear_slice (lo, up); } - - ArrayN reshape (const dim_vector& new_dims) const - { return Array::reshape (new_dims); } +#define ArrayN Array - ArrayN permute (const Array& vec, bool inv = false) const - { return Array::permute (vec, inv); } - - ArrayN ipermute (const Array& vec) const - { return Array::ipermute (vec); } - - ArrayN squeeze (void) const { return Array::squeeze (); } - - ArrayN transpose (void) const { return Array::transpose (); } - ArrayN hermitian (T (*fcn) (const T&) = 0) const { return Array::hermitian (fcn); } - - ArrayN& insert (const ArrayN& a, const dim_vector& dv) - { - Array::insert (a, dv); - return *this; - } - - ArrayN& insert (const ArrayN& a, octave_idx_type r, octave_idx_type c) - { - Array::insert (a, r, c); - return *this; - } - - ArrayN index (const idx_vector& i, bool resize_ok = false, - const T& rfv = Array::resize_fill_value ()) const - { - Array tmp = Array::index (i, resize_ok, rfv); - return ArrayN (tmp, tmp.dims ()); - } - - ArrayN index (const idx_vector& i, const idx_vector& j, bool resize_ok = false, - const T& rfv = Array::resize_fill_value ()) const - { - Array tmp = Array::index (i, j, resize_ok, rfv); - return ArrayN (tmp, tmp.dims ()); - } - - ArrayN index (const Array& ra_idx, bool resize_ok = false, - const T& rfv = Array::resize_fill_value ()) const - { - Array tmp = Array::index (ra_idx, resize_ok, rfv); - return ArrayN (tmp, tmp.dims ()); - } - - ArrayN sort (int dim = 0, sortmode mode = ASCENDING) const - { - return Array::sort (dim, mode); - } - - ArrayN sort (Array &sidx, int dim = 0, - sortmode mode = ASCENDING) const - { - return Array::sort (sidx, dim, mode); - } - - ArrayN nth_element (const idx_vector& n, int dim = 0) const - { - return Array::nth_element (n, dim); - } - - ArrayN diag (octave_idx_type k) const - { - return Array::diag (k); - } - - template - ArrayN map (F fcn) const - { - return Array::template map (fcn); - } -}; - -template -std::ostream& -operator << (std::ostream&, const ArrayN&); +// If we're with GNU C++, issue a warning. +#ifdef __GNUC__ +#warning Using ArrayN is deprecated. Use Array directly. +#endif #endif diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/CNDArray.cc --- a/liboctave/CNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/CNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -714,7 +714,7 @@ } ComplexNDArray -ComplexNDArray::max (ArrayN& idx_arg, int dim) const +ComplexNDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_max); } @@ -726,7 +726,7 @@ } ComplexNDArray -ComplexNDArray::min (ArrayN& idx_arg, int dim) const +ComplexNDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_min); } @@ -738,7 +738,7 @@ } ComplexNDArray -ComplexNDArray::cummax (ArrayN& idx_arg, int dim) const +ComplexNDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummax); } @@ -750,7 +750,7 @@ } ComplexNDArray -ComplexNDArray::cummin (ArrayN& idx_arg, int dim) const +ComplexNDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummin); } @@ -765,19 +765,19 @@ boolNDArray ComplexNDArray::isnan (void) const { - return ArrayN (fastmap (xisnan)); + return Array (fastmap (xisnan)); } boolNDArray ComplexNDArray::isinf (void) const { - return ArrayN (fastmap (xisinf)); + return Array (fastmap (xisinf)); } boolNDArray ComplexNDArray::isfinite (void) const { - return ArrayN (fastmap (xfinite)); + return Array (fastmap (xfinite)); } ComplexNDArray diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/CNDArray.h --- a/liboctave/CNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/CNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -52,7 +52,7 @@ ComplexNDArray (const MArrayN& a) : MArrayN (a) { } template - ComplexNDArray (const ArrayN& a) : MArrayN (a) { } + ComplexNDArray (const Array& a) : MArrayN (a) { } ComplexNDArray (const charNDArray&); @@ -87,14 +87,14 @@ ComplexNDArray concat (const NDArray& rb, const Array& ra_idx); ComplexNDArray max (int dim = 0) const; - ComplexNDArray max (ArrayN& index, int dim = 0) const; + ComplexNDArray max (Array& index, int dim = 0) const; ComplexNDArray min (int dim = 0) const; - ComplexNDArray min (ArrayN& index, int dim = 0) const; + ComplexNDArray min (Array& index, int dim = 0) const; ComplexNDArray cummax (int dim = 0) const; - ComplexNDArray cummax (ArrayN& index, int dim = 0) const; + ComplexNDArray cummax (Array& index, int dim = 0) const; ComplexNDArray cummin (int dim = 0) const; - ComplexNDArray cummin (ArrayN& index, int dim = 0) const; + ComplexNDArray cummin (Array& index, int dim = 0) const; ComplexNDArray diff (octave_idx_type order = 1, int dim = 0) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/ChangeLog Fri Oct 16 13:12:31 2009 +0200 @@ -1,3 +1,39 @@ +2009-10-16 Jaroslav Hajek + + * ArrayN.h: Remove everything, just #define ArrayN Array. + Warn if under gcc. + * ArrayN.cc: Remove. + * Array.cc (operator >>): New operator. + * Array.h: Declare it. + + * Array-C.cc: Remove traces of ArrayN. + * Array-b.cc: Ditto. + * Array-ch.cc: Ditto. + * Array-d.cc: Ditto. + * Array-f.cc: Ditto. + * Array-fC.cc: Ditto. + * CNDArray.cc: Ditto. + * CNDArray.h: Ditto. + * MArrayN.h: Ditto. + * boolNDArray.cc: Ditto. + * boolNDArray.h: Ditto. + * chNDArray.h: Ditto. + * dNDArray.cc: Ditto. + * dNDArray.h: Ditto. + * fCNDArray.cc: Ditto. + * fCNDArray.h: Ditto. + * fNDArray.cc: Ditto. + * fNDArray.h: Ditto. + * intNDArray.cc: Ditto. + * intNDArray.h: Ditto. + * lo-specfun.cc: Ditto. + * lo-specfun.h: Ditto. + + * mx-op-defs.h (DMS_BIN_OP, SDM_BIN_OP): Rewrite. + (DMS_BIN_OPS, SDM_BIN_OPS): Define dm*s and dm/s rather than dm+s and + dm-s which are rather useless. + * mx-ops: Update. + 2009-10-16 Jaroslav Hajek * Array.cc (Array::column, Array::page, Array::linearize, diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/MArrayN.h --- a/liboctave/MArrayN.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/MArrayN.h Fri Oct 16 13:12:31 2009 +0200 @@ -25,7 +25,7 @@ #if !defined (octave_MArrayN_h) #define octave_MArrayN_h 1 -#include "ArrayN.h" +#include "Array.h" #include "MArray2.h" #include "dim-vector.h" @@ -39,34 +39,34 @@ template class -MArrayN : public ArrayN +MArrayN : public Array { protected: - MArrayN (T *d, const dim_vector& dv) : ArrayN (d, dv) { } + MArrayN (T *d, const dim_vector& dv) : Array (d, dv) { } public: - MArrayN (void) : ArrayN () {} + MArrayN (void) : Array () {} - MArrayN (const dim_vector& dv) : ArrayN (dv) { } + MArrayN (const dim_vector& dv) : Array (dv) { } - MArrayN (const dim_vector& dv, const T& val) : ArrayN (dv, val) { } + MArrayN (const dim_vector& dv, const T& val) : Array (dv, val) { } template - explicit MArrayN (const Array2& a) : ArrayN (a) { } + explicit MArrayN (const Array2& a) : Array (a) { } template - MArrayN (const ArrayN& a) : ArrayN (a) { } + MArrayN (const Array& a) : Array (a) { } template - MArrayN (const MArrayN& a) : ArrayN (a) { } + MArrayN (const MArrayN& a) : Array (a) { } ~MArrayN (void) { } MArrayN& operator = (const MArrayN& a) { - ArrayN::operator = (a); + Array::operator = (a); return *this; } @@ -88,26 +88,26 @@ } MArrayN reshape (const dim_vector& new_dims) const - { return ArrayN::reshape (new_dims); } + { return Array::reshape (new_dims); } MArrayN permute (const Array& vec, bool inv = false) const - { return ArrayN::permute (vec, inv); } + { return Array::permute (vec, inv); } MArrayN ipermute (const Array& vec) const - { return ArrayN::ipermute (vec); } + { return Array::ipermute (vec); } - MArrayN squeeze (void) const { return ArrayN::squeeze (); } + MArrayN squeeze (void) const { return Array::squeeze (); } MArrayN diag (octave_idx_type k) const { - return ArrayN::diag (k); + return Array::diag (k); } template MArrayN map (F fcn) const { - return ArrayN::template map (fcn); + return Array::template map (fcn); } void changesign (void); diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/boolNDArray.cc --- a/liboctave/boolNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/boolNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -150,7 +150,7 @@ boolNDArray boolNDArray::diag (octave_idx_type k) const { - return ArrayN::diag (k); + return Array::diag (k); } NDND_BOOL_OPS (boolNDArray, boolNDArray) diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/boolNDArray.h --- a/liboctave/boolNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/boolNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -23,7 +23,7 @@ #if !defined (octave_boolNDArray_h) #define octave_boolNDArray_h 1 -#include "ArrayN.h" +#include "Array.h" #include "mx-defs.h" #include "mx-op-decl.h" @@ -32,28 +32,28 @@ class OCTAVE_API -boolNDArray : public ArrayN +boolNDArray : public Array { public: typedef boolMatrix matrix_type; - boolNDArray (void) : ArrayN () { } + boolNDArray (void) : Array () { } - boolNDArray (const dim_vector& dv) : ArrayN (dv) { } + boolNDArray (const dim_vector& dv) : Array (dv) { } boolNDArray (const dim_vector& dv, const bool& val) - : ArrayN (dv, val) { } + : Array (dv, val) { } - boolNDArray (const boolNDArray& a) : ArrayN (a) { } + boolNDArray (const boolNDArray& a) : Array (a) { } - boolNDArray (const boolMatrix& a) : ArrayN (a) { } + boolNDArray (const boolMatrix& a) : Array (a) { } - boolNDArray (const ArrayN& a) : ArrayN (a) { } + boolNDArray (const Array& a) : Array (a) { } boolNDArray& operator = (const boolNDArray& a) { - ArrayN::operator = (a); + Array::operator = (a); return *this; } @@ -80,7 +80,7 @@ boolMatrix matrix_value (void) const; - boolNDArray squeeze (void) const { return ArrayN::squeeze (); } + boolNDArray squeeze (void) const { return Array::squeeze (); } static void increment_index (Array& ra_idx, const dim_vector& dimensions, @@ -120,7 +120,7 @@ private: - boolNDArray (bool *d, dim_vector& dv) : ArrayN (d, dv) { } + boolNDArray (bool *d, dim_vector& dv) : Array (d, dv) { } }; NDND_BOOL_OP_DECLS (boolNDArray, boolNDArray, OCTAVE_API) diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/chNDArray.h --- a/liboctave/chNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/chNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -55,7 +55,7 @@ charNDArray (const string_vector& s) : MArrayN (charMatrix (s)) { } - charNDArray (const ArrayN& a) : MArrayN (a) { } + charNDArray (const Array& a) : MArrayN (a) { } charNDArray& operator = (const charNDArray& a) { @@ -77,7 +77,7 @@ charMatrix matrix_value (void) const; - charNDArray squeeze (void) const { return ArrayN::squeeze (); } + charNDArray squeeze (void) const { return Array::squeeze (); } static void increment_index (Array& ra_idx, const dim_vector& dimensions, diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/dNDArray.cc --- a/liboctave/dNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/dNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -744,7 +744,7 @@ } NDArray -NDArray::max (ArrayN& idx_arg, int dim) const +NDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_max); } @@ -756,7 +756,7 @@ } NDArray -NDArray::min (ArrayN& idx_arg, int dim) const +NDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_min); } @@ -768,7 +768,7 @@ } NDArray -NDArray::cummax (ArrayN& idx_arg, int dim) const +NDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummax); } @@ -780,7 +780,7 @@ } NDArray -NDArray::cummin (ArrayN& idx_arg, int dim) const +NDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummin); } @@ -882,19 +882,19 @@ boolNDArray NDArray::isnan (void) const { - return ArrayN (fastmap (xisnan)); + return Array (fastmap (xisnan)); } boolNDArray NDArray::isinf (void) const { - return ArrayN (fastmap (xisinf)); + return Array (fastmap (xisinf)); } boolNDArray NDArray::isfinite (void) const { - return ArrayN (fastmap (xfinite)); + return Array (fastmap (xfinite)); } Matrix diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/dNDArray.h --- a/liboctave/dNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/dNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -57,7 +57,7 @@ NDArray (const MArrayN& a) : MArrayN (a) { } template - NDArray (const ArrayN& a) : MArrayN (a) { } + NDArray (const Array& a) : MArrayN (a) { } template explicit NDArray (const intNDArray& a) : MArrayN (a) { } @@ -99,14 +99,14 @@ charNDArray concat (const charNDArray& rb, const Array& ra_idx); NDArray max (int dim = 0) const; - NDArray max (ArrayN& index, int dim = 0) const; + NDArray max (Array& index, int dim = 0) const; NDArray min (int dim = 0) const; - NDArray min (ArrayN& index, int dim = 0) const; + NDArray min (Array& index, int dim = 0) const; NDArray cummax (int dim = 0) const; - NDArray cummax (ArrayN& index, int dim = 0) const; + NDArray cummax (Array& index, int dim = 0) const; NDArray cummin (int dim = 0) const; - NDArray cummin (ArrayN& index, int dim = 0) const; + NDArray cummin (Array& index, int dim = 0) const; NDArray diff (octave_idx_type order = 1, int dim = 0) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/fCNDArray.cc --- a/liboctave/fCNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/fCNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -709,7 +709,7 @@ } FloatComplexNDArray -FloatComplexNDArray::max (ArrayN& idx_arg, int dim) const +FloatComplexNDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_max); } @@ -721,7 +721,7 @@ } FloatComplexNDArray -FloatComplexNDArray::min (ArrayN& idx_arg, int dim) const +FloatComplexNDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_min); } @@ -733,7 +733,7 @@ } FloatComplexNDArray -FloatComplexNDArray::cummax (ArrayN& idx_arg, int dim) const +FloatComplexNDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummax); } @@ -745,7 +745,7 @@ } FloatComplexNDArray -FloatComplexNDArray::cummin (ArrayN& idx_arg, int dim) const +FloatComplexNDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummin); } @@ -760,19 +760,19 @@ boolNDArray FloatComplexNDArray::isnan (void) const { - return ArrayN (fastmap (xisnan)); + return Array (fastmap (xisnan)); } boolNDArray FloatComplexNDArray::isinf (void) const { - return ArrayN (fastmap (xisinf)); + return Array (fastmap (xisinf)); } boolNDArray FloatComplexNDArray::isfinite (void) const { - return ArrayN (fastmap (xfinite)); + return Array (fastmap (xfinite)); } FloatComplexNDArray diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/fCNDArray.h --- a/liboctave/fCNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/fCNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -52,7 +52,7 @@ FloatComplexNDArray (const MArrayN& a) : MArrayN (a) { } template - FloatComplexNDArray (const ArrayN& a) : MArrayN (a) { } + FloatComplexNDArray (const Array& a) : MArrayN (a) { } FloatComplexNDArray (const charNDArray&); @@ -87,14 +87,14 @@ FloatComplexNDArray concat (const FloatNDArray& rb, const Array& ra_idx); FloatComplexNDArray max (int dim = 0) const; - FloatComplexNDArray max (ArrayN& index, int dim = 0) const; + FloatComplexNDArray max (Array& index, int dim = 0) const; FloatComplexNDArray min (int dim = 0) const; - FloatComplexNDArray min (ArrayN& index, int dim = 0) const; + FloatComplexNDArray min (Array& index, int dim = 0) const; FloatComplexNDArray cummax (int dim = 0) const; - FloatComplexNDArray cummax (ArrayN& index, int dim = 0) const; + FloatComplexNDArray cummax (Array& index, int dim = 0) const; FloatComplexNDArray cummin (int dim = 0) const; - FloatComplexNDArray cummin (ArrayN& index, int dim = 0) const; + FloatComplexNDArray cummin (Array& index, int dim = 0) const; FloatComplexNDArray diff (octave_idx_type order = 1, int dim = 0) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/fNDArray.cc --- a/liboctave/fNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/fNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -702,7 +702,7 @@ } FloatNDArray -FloatNDArray::max (ArrayN& idx_arg, int dim) const +FloatNDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_max); } @@ -714,7 +714,7 @@ } FloatNDArray -FloatNDArray::min (ArrayN& idx_arg, int dim) const +FloatNDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_min); } @@ -726,7 +726,7 @@ } FloatNDArray -FloatNDArray::cummax (ArrayN& idx_arg, int dim) const +FloatNDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummax); } @@ -738,7 +738,7 @@ } FloatNDArray -FloatNDArray::cummin (ArrayN& idx_arg, int dim) const +FloatNDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummin); } @@ -840,19 +840,19 @@ boolNDArray FloatNDArray::isnan (void) const { - return ArrayN (fastmap (xisnan)); + return Array (fastmap (xisnan)); } boolNDArray FloatNDArray::isinf (void) const { - return ArrayN (fastmap (xisinf)); + return Array (fastmap (xisinf)); } boolNDArray FloatNDArray::isfinite (void) const { - return ArrayN (fastmap (xfinite)); + return Array (fastmap (xfinite)); } FloatMatrix diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/fNDArray.h --- a/liboctave/fNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/fNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -54,7 +54,7 @@ FloatNDArray (const MArrayN& a) : MArrayN (a) { } template - FloatNDArray (const ArrayN& a) : MArrayN (a) { } + FloatNDArray (const Array& a) : MArrayN (a) { } template explicit FloatNDArray (const intNDArray& a) : MArrayN (a) { } @@ -96,14 +96,14 @@ charNDArray concat (const charNDArray& rb, const Array& ra_idx); FloatNDArray max (int dim = 0) const; - FloatNDArray max (ArrayN& index, int dim = 0) const; + FloatNDArray max (Array& index, int dim = 0) const; FloatNDArray min (int dim = 0) const; - FloatNDArray min (ArrayN& index, int dim = 0) const; + FloatNDArray min (Array& index, int dim = 0) const; FloatNDArray cummax (int dim = 0) const; - FloatNDArray cummax (ArrayN& index, int dim = 0) const; + FloatNDArray cummax (Array& index, int dim = 0) const; FloatNDArray cummin (int dim = 0) const; - FloatNDArray cummin (ArrayN& index, int dim = 0) const; + FloatNDArray cummin (Array& index, int dim = 0) const; FloatNDArray diff (octave_idx_type order = 1, int dim = 0) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/intNDArray.cc --- a/liboctave/intNDArray.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/intNDArray.cc Fri Oct 16 13:12:31 2009 +0200 @@ -231,7 +231,7 @@ template intNDArray -intNDArray::max (ArrayN& idx_arg, int dim) const +intNDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op > (*this, idx_arg, dim, mx_inline_max); } @@ -245,7 +245,7 @@ template intNDArray -intNDArray::min (ArrayN& idx_arg, int dim) const +intNDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op > (*this, idx_arg, dim, mx_inline_min); } @@ -259,7 +259,7 @@ template intNDArray -intNDArray::cummax (ArrayN& idx_arg, int dim) const +intNDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op > (*this, idx_arg, dim, mx_inline_cummax); } @@ -273,7 +273,7 @@ template intNDArray -intNDArray::cummin (ArrayN& idx_arg, int dim) const +intNDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op > (*this, idx_arg, dim, mx_inline_cummin); } diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/intNDArray.h --- a/liboctave/intNDArray.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/intNDArray.h Fri Oct 16 13:12:31 2009 +0200 @@ -48,9 +48,6 @@ explicit intNDArray (const Array& a) : MArrayN (a) { } template - explicit intNDArray (const ArrayN& a) : MArrayN (a) { } - - template intNDArray (const MArrayN& a) : MArrayN (a) { } template @@ -81,14 +78,14 @@ boolNDArray any (int dim = -1) const; intNDArray max (int dim = 0) const; - intNDArray max (ArrayN& index, int dim = 0) const; + intNDArray max (Array& index, int dim = 0) const; intNDArray min (int dim = 0) const; - intNDArray min (ArrayN& index, int dim = 0) const; + intNDArray min (Array& index, int dim = 0) const; intNDArray cummax (int dim = 0) const; - intNDArray cummax (ArrayN& index, int dim = 0) const; + intNDArray cummax (Array& index, int dim = 0) const; intNDArray cummin (int dim = 0) const; - intNDArray cummin (ArrayN& index, int dim = 0) const; + intNDArray cummin (Array& index, int dim = 0) const; intNDArray sum (int dim) const; NDArray dsum (int dim) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/lo-specfun.cc --- a/liboctave/lo-specfun.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/lo-specfun.cc Fri Oct 16 13:12:31 2009 +0200 @@ -1071,7 +1071,7 @@ static inline ComplexNDArray do_bessel (dptr f, const char *, double alpha, const ComplexNDArray& x, - bool scaled, ArrayN& ierr) + bool scaled, Array& ierr) { dim_vector dv = x.dims (); octave_idx_type nel = dv.numel (); @@ -1087,7 +1087,7 @@ static inline ComplexNDArray do_bessel (dptr f, const char *, const NDArray& alpha, const Complex& x, - bool scaled, ArrayN& ierr) + bool scaled, Array& ierr) { dim_vector dv = alpha.dims (); octave_idx_type nel = dv.numel (); @@ -1103,7 +1103,7 @@ static inline ComplexNDArray do_bessel (dptr f, const char *fn, const NDArray& alpha, - const ComplexNDArray& x, bool scaled, ArrayN& ierr) + const ComplexNDArray& x, bool scaled, Array& ierr) { dim_vector dv = x.dims (); ComplexNDArray retval; @@ -1177,7 +1177,7 @@ #define SN_BESSEL(name, fcn) \ ComplexNDArray \ name (double alpha, const ComplexNDArray& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1185,7 +1185,7 @@ #define NS_BESSEL(name, fcn) \ ComplexNDArray \ name (const NDArray& alpha, const Complex& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1193,7 +1193,7 @@ #define NN_BESSEL(name, fcn) \ ComplexNDArray \ name (const NDArray& alpha, const ComplexNDArray& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1668,7 +1668,7 @@ static inline FloatComplexNDArray do_bessel (fptr f, const char *, float alpha, const FloatComplexNDArray& x, - bool scaled, ArrayN& ierr) + bool scaled, Array& ierr) { dim_vector dv = x.dims (); octave_idx_type nel = dv.numel (); @@ -1684,7 +1684,7 @@ static inline FloatComplexNDArray do_bessel (fptr f, const char *, const FloatNDArray& alpha, const FloatComplex& x, - bool scaled, ArrayN& ierr) + bool scaled, Array& ierr) { dim_vector dv = alpha.dims (); octave_idx_type nel = dv.numel (); @@ -1700,7 +1700,7 @@ static inline FloatComplexNDArray do_bessel (fptr f, const char *fn, const FloatNDArray& alpha, - const FloatComplexNDArray& x, bool scaled, ArrayN& ierr) + const FloatComplexNDArray& x, bool scaled, Array& ierr) { dim_vector dv = x.dims (); FloatComplexNDArray retval; @@ -1774,7 +1774,7 @@ #define SN_BESSEL(name, fcn) \ FloatComplexNDArray \ name (float alpha, const FloatComplexNDArray& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1782,7 +1782,7 @@ #define NS_BESSEL(name, fcn) \ FloatComplexNDArray \ name (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1790,7 +1790,7 @@ #define NN_BESSEL(name, fcn) \ FloatComplexNDArray \ name (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, \ - ArrayN& ierr) \ + Array& ierr) \ { \ return do_bessel (fcn, #name, alpha, x, scaled, ierr); \ } @@ -1931,7 +1931,7 @@ } ComplexNDArray -airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr) +airy (const ComplexNDArray& z, bool deriv, bool scaled, Array& ierr) { dim_vector dv = z.dims (); octave_idx_type nel = dv.numel (); @@ -1946,7 +1946,7 @@ } ComplexNDArray -biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr) +biry (const ComplexNDArray& z, bool deriv, bool scaled, Array& ierr) { dim_vector dv = z.dims (); octave_idx_type nel = dv.numel (); @@ -2061,7 +2061,7 @@ } FloatComplexNDArray -airy (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr) +airy (const FloatComplexNDArray& z, bool deriv, bool scaled, Array& ierr) { dim_vector dv = z.dims (); octave_idx_type nel = dv.numel (); @@ -2076,7 +2076,7 @@ } FloatComplexNDArray -biry (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr) +biry (const FloatComplexNDArray& z, bool deriv, bool scaled, Array& ierr) { dim_vector dv = z.dims (); octave_idx_type nel = dv.numel (); diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/lo-specfun.h --- a/liboctave/lo-specfun.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/lo-specfun.h Fri Oct 16 13:12:31 2009 +0200 @@ -25,7 +25,7 @@ #define octave_liboctave_specfun_h 1 #include "oct-cmplx.h" -#include "ArrayN.h" +#include "Array.h" template class Array2; class Matrix; @@ -202,75 +202,75 @@ extern OCTAVE_API ComplexNDArray besselj (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray bessely (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besseli (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselk (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh1 (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh2 (double alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha, const Complex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API ComplexMatrix besselj (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, @@ -388,75 +388,75 @@ extern OCTAVE_API FloatComplexNDArray besselj (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray bessely (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besseli (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselk (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh1 (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh2 (float alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselj (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray bessely (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besseli (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselk (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh1 (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh2 (const FloatNDArray& alpha, const FloatComplex& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselj (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray bessely (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besseli (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselk (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh1 (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexNDArray besselh2 (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled, - ArrayN& ierr); + Array& ierr); extern OCTAVE_API FloatComplexMatrix besselj (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled, @@ -492,10 +492,10 @@ biry (const ComplexMatrix& z, bool deriv, bool scaled, Array2& ierr); extern OCTAVE_API ComplexNDArray -airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr); +airy (const ComplexNDArray& z, bool deriv, bool scaled, Array& ierr); extern OCTAVE_API ComplexNDArray -biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr); +biry (const ComplexNDArray& z, bool deriv, bool scaled, Array& ierr); extern OCTAVE_API FloatComplex airy (const FloatComplex& z, bool deriv, bool scaled, octave_idx_type& ierr); extern OCTAVE_API FloatComplex biry (const FloatComplex& z, bool deriv, bool scaled, octave_idx_type& ierr); @@ -507,10 +507,10 @@ biry (const FloatComplexMatrix& z, bool deriv, bool scaled, Array2& ierr); extern OCTAVE_API FloatComplexNDArray -airy (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr); +airy (const FloatComplexNDArray& z, bool deriv, bool scaled, Array& ierr); extern OCTAVE_API FloatComplexNDArray -biry (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN& ierr); +biry (const FloatComplexNDArray& z, bool deriv, bool scaled, Array& ierr); extern OCTAVE_API double betainc (double x, double a, double b); extern OCTAVE_API Matrix betainc (double x, double a, const Matrix& b); diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/mx-op-decl.h --- a/liboctave/mx-op-decl.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/mx-op-decl.h Fri Oct 16 13:12:31 2009 +0200 @@ -237,8 +237,7 @@ // scalar by diagonal matrix operations. #define SDM_BIN_OP_DECLS(R, S, DM, API) \ - BIN_OP_DECL (R, operator +, S, DM, API); \ - BIN_OP_DECL (R, operator -, S, DM, API); + BIN_OP_DECL (R, operator *, S, DM, API); \ #define SDM_OP_DECLS(R, S, DM, API) \ SDM_BIN_OP_DECLS(R, S, DM, API) @@ -246,8 +245,8 @@ // diagonal matrix by scalar operations. #define DMS_BIN_OP_DECLS(R, DM, S, API) \ - BIN_OP_DECL (R, operator +, DM, S, API); \ - BIN_OP_DECL (R, operator -, DM, S, API); + BIN_OP_DECL (R, operator *, DM, S, API); \ + BIN_OP_DECL (R, operator /, DM, S, API); #define DMS_OP_DECLS(R, DM, S, API) \ DMS_BIN_OP_DECLS(R, DM, S, API) diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/mx-op-defs.h --- a/liboctave/mx-op-defs.h Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/mx-op-defs.h Fri Oct 16 13:12:31 2009 +0200 @@ -334,45 +334,38 @@ // scalar by diagonal matrix operations. -#define SDM_BIN_OP(R, OP, S, DM, OPEQ) \ +#define SDM_BIN_OP(R, OP, S, DM) \ R \ - OP (const S& s, const DM& dm) \ + operator OP (const S& s, const DM& dm) \ { \ - octave_idx_type nr = dm.rows (); \ - octave_idx_type nc = dm.cols (); \ - \ - R r (nr, nc, s); \ + R r (dm.rows (), dm.cols ()); \ \ for (octave_idx_type i = 0; i < dm.length (); i++) \ - r.elem(i, i) OPEQ dm.elem(i, i); \ + r.dgxelem (i) = s OP dm.dgelem (i); \ \ return r; \ } #define SDM_BIN_OPS(R, S, DM) \ - SDM_BIN_OP (R, operator +, S, DM, +=) \ - SDM_BIN_OP (R, operator -, S, DM, -=) + SDM_BIN_OP (R, *, S, DM) // diagonal matrix by scalar operations. -#define DMS_BIN_OP(R, OP, DM, S, SGN) \ +#define DMS_BIN_OP(R, OP, DM, S) \ R \ - OP (const DM& dm, const S& s) \ + operator OP (const DM& dm, const S& s) \ { \ - octave_idx_type nr = dm.rows (); \ - octave_idx_type nc = dm.cols (); \ - \ - R r (nr, nc, SGN s); \ + R r (dm.rows (), dm.cols ()); \ \ for (octave_idx_type i = 0; i < dm.length (); i++) \ - r.elem(i, i) += dm.elem(i, i); \ + r.dgxelem (i) = dm.dgelem (i) OP s; \ \ return r; \ } #define DMS_BIN_OPS(R, DM, S) \ - DMS_BIN_OP (R, operator +, DM, S, ) \ - DMS_BIN_OP (R, operator -, DM, S, -) + DMS_BIN_OP (R, *, DM, S) \ + DMS_BIN_OP (R, /, DM, S) // matrix by diagonal matrix operations. diff -r 7b9cbaad68d6 -r b4fdfee405b5 liboctave/mx-ops --- a/liboctave/mx-ops Fri Oct 16 10:28:26 2009 +0200 +++ b/liboctave/mx-ops Fri Oct 16 13:12:31 2009 +0200 @@ -82,65 +82,57 @@ # cdm cdm dm B cdm dm cdm B -cm cs cdm B -cm cs dm B +cdm cs dm B cm cs m BCL real NONE boolMatrix.h cnda cs nda BCL real NONE boolMatrix.h boolNDArray.h -cm cdm cs B cm cdm cm B cm cdm m B -cm cdm s B +cdm cdm s B cm cm cdm B cm cm dm B cm cm m BCL real NONE boolMatrix.h cnda cnda nda BCL real NONE boolMatrix.h boolNDArray.h cm cm s BCL real NONE boolMatrix.h cnda cnda s BCL real NONE boolMatrix.h boolNDArray.h -cm dm cs B +cdm dm cs B cm dm cm B cm m cs BCL NONE real boolMatrix.h cnda nda cs BCL NONE real boolMatrix.h boolNDArray.h cm m cdm B cm m cm BCL NONE real boolMatrix.h cnda nda cnda BCL NONE real boolMatrix.h boolNDArray.h -cm s cdm B +cdm s cdm B cm s cm BCL NONE real boolMatrix.h cnda s cnda BCL NONE real boolMatrix.h boolNDArray.h m dm m B -m dm s B m m dm B -m s dm B # fcdm fcdm fdm B fcdm fdm fcdm B -fcm fcs fcdm B -fcm fcs fdm B +fcdm fcs fdm B fcm fcs fm BCL real NONE boolMatrix.h fcnda fcs fnda BCL real NONE boolMatrix.h boolNDArray.h -fcm fcdm fcs B fcm fcdm fcm B fcm fcdm fm B -fcm fcdm fs B +fcdm fcdm fs B fcm fcm fcdm B fcm fcm fdm B fcm fcm fm BCL real NONE boolMatrix.h fcnda fcnda fnda BCL real NONE boolMatrix.h boolNDArray.h fcm fcm fs BCL real NONE boolMatrix.h fcnda fcnda fs BCL real NONE boolMatrix.h boolNDArray.h -fcm fdm fcs B +fcdm fdm fcs B fcm fdm fcm B fcm fm fcs BCL NONE real boolMatrix.h fcnda fnda fcs BCL NONE real boolMatrix.h boolNDArray.h fcm fm fcdm B fcm fm fcm BCL NONE real boolMatrix.h fcnda fnda fcnda BCL NONE real boolMatrix.h boolNDArray.h -fcm fs fcdm B +fcdm fs fcdm B fcm fs fcm BCL NONE real boolMatrix.h fcnda fs fcnda BCL NONE real boolMatrix.h boolNDArray.h fm fdm fm B -fm fdm fs B fm fm fdm B -fm fs fdm B # m pm m B m m pm B diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/Cell.cc --- a/src/Cell.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/Cell.cc Fri Oct 16 13:12:31 2009 +0200 @@ -33,12 +33,12 @@ #include "oct-obj.h" Cell::Cell (const octave_value_list& ovl) - : ArrayN (ovl.cell_value ()) + : Array (ovl.cell_value ()) { } Cell::Cell (const string_vector& sv, bool trim) - : ArrayN () + : Array () { octave_idx_type n = sv.length (); @@ -63,7 +63,7 @@ } Cell::Cell (const Array& sa) - : ArrayN (sa.dims ()) + : Array (sa.dims ()) { octave_idx_type n = sa.numel (); @@ -78,7 +78,7 @@ // SV as possible. Cell::Cell (const dim_vector& dv, const string_vector& sv, bool trim) - : ArrayN (dv, resize_fill_value ()) + : Array (dv, resize_fill_value ()) { octave_idx_type n = sv.length (); @@ -139,7 +139,7 @@ idx_vector i = idx_arg(0).index_vector (); if (! error_state) - retval = ArrayN::index (i, resize_ok, resize_fill_value ()); + retval = Array::index (i, resize_ok, resize_fill_value ()); } break; @@ -152,7 +152,7 @@ idx_vector j = idx_arg(1).index_vector (); if (! error_state) - retval = ArrayN::index (i, j, resize_ok, + retval = Array::index (i, j, resize_ok, resize_fill_value ()); } } @@ -171,7 +171,7 @@ } if (!error_state) - retval = ArrayN::index (iv, resize_ok, + retval = Array::index (iv, resize_ok, resize_fill_value ()); } break; @@ -282,7 +282,7 @@ Cell Cell::diag (octave_idx_type k) const { - return ArrayN::diag (k); + return Array::diag (k); } /* diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/Cell.h --- a/src/Cell.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/Cell.h Fri Oct 16 13:12:31 2009 +0200 @@ -26,7 +26,7 @@ #include -#include "ArrayN.h" +#include "Array.h" #include "oct-alloc.h" #include "str-vec.h" #include "ov.h" @@ -35,33 +35,30 @@ class OCTINTERP_API -Cell : public ArrayN +Cell : public Array { public: Cell (void) - : ArrayN (dim_vector (0, 0)) { } + : Array (dim_vector (0, 0)) { } Cell (const octave_value& val) - : ArrayN (dim_vector (1, 1), val) { } + : Array (dim_vector (1, 1), val) { } Cell (const octave_value_list& ovl); Cell (octave_idx_type n, octave_idx_type m, const octave_value& val = resize_fill_value ()) - : ArrayN (dim_vector (n, m), val) { } + : Array (dim_vector (n, m), val) { } Cell (const dim_vector& dv, const octave_value& val = resize_fill_value ()) - : ArrayN (dv, val) { } - - Cell (const ArrayN& c) - : ArrayN (c) { } + : Array (dv, val) { } Cell (const Array& c) - : ArrayN (c) { } + : Array (c) { } Cell (const Array& c, octave_idx_type nr, octave_idx_type nc) - : ArrayN (c, dim_vector (nr, nc)) { } + : Array (c, dim_vector (nr, nc)) { } Cell (const string_vector& sv, bool trim = false); @@ -70,7 +67,7 @@ Cell (const dim_vector& dv, const string_vector& sv, bool trim = false); Cell (const Cell& c) - : ArrayN (c) { } + : Array (c) { } bool is_cellstr (void) const; @@ -82,7 +79,7 @@ const octave_value& fill_val = resize_fill_value ()); Cell reshape (const dim_vector& new_dims) const - { return ArrayN::reshape (new_dims); } + { return Array::reshape (new_dims); } octave_idx_type nnz (void) const; diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ChangeLog --- a/src/ChangeLog Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ChangeLog Fri Oct 16 13:12:31 2009 +0200 @@ -1,3 +1,31 @@ +2009-10-16 Jaroslav Hajek + + * Cell.cc: Remove traces of ArrayN. + * Cell.h: Ditto. + * DLD-FUNCTIONS/besselj.cc: Ditto. + * DLD-FUNCTIONS/find.cc: Ditto. + * DLD-FUNCTIONS/lookup.cc: Ditto. + * DLD-FUNCTIONS/max.cc: Ditto. + * TEMPLATE-INST/Array-tc.cc: Ditto. + * data.cc: Ditto. + * oct-map.cc: Ditto. + * ov-cx-mat.h: Ditto. + * ov-flt-cx-mat.cc: Ditto. + * ov-flt-cx-mat.h: Ditto. + * ov-flt-re-mat.cc: Ditto. + * ov-flt-re-mat.h: Ditto. + * ov-intx.h: Ditto. + * ov-re-mat.h: Ditto. + * ov.cc: Ditto. + * ov.h: Ditto. + * pr-output.cc: Ditto. + * pr-output.h: Ditto. + * variables.cc: Ditto. + + * OPERATORS/op-dm-scm.cc: Avoid using dm + s, dm - s operators. + * OPERATORS/op-dm-sm.cc: Ditto. + * OPERATORS/op-dms-template.cc: Ditto. + 2009-10-16 Jaroslav Hajek * DLD-FUNCTIONS/cellfun.cc (Fnum2cell): Use Array::column here. diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/DLD-FUNCTIONS/besselj.cc --- a/src/DLD-FUNCTIONS/besselj.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/DLD-FUNCTIONS/besselj.cc Fri Oct 16 13:12:31 2009 +0200 @@ -133,7 +133,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -197,7 +197,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -216,7 +216,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -268,7 +268,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -332,7 +332,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -351,7 +351,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; DO_BESSEL (type, alpha, x, scaled, ierr, result); @@ -587,7 +587,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; if (kind > 1) @@ -609,7 +609,7 @@ if (! error_state) { - ArrayN ierr; + Array ierr; octave_value result; if (kind > 1) diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/DLD-FUNCTIONS/find.cc --- a/src/DLD-FUNCTIONS/find.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/DLD-FUNCTIONS/find.cc Fri Oct 16 13:12:31 2009 +0200 @@ -53,7 +53,7 @@ { default: case 3: - retval(2) = ArrayN (nda.index (idx_vector (idx))); + retval(2) = Array (nda.index (idx_vector (idx))); // Fall through! case 2: @@ -175,7 +175,7 @@ Matrix i_idx (result_nr, result_nc); Matrix j_idx (result_nr, result_nc); - ArrayN val (dim_vector (result_nr, result_nc)); + Array val (dim_vector (result_nr, result_nc)); if (count > 0) { @@ -285,7 +285,7 @@ Matrix i_idx (count, 1); Matrix j_idx (count, 1); // Every value is 1. - ArrayN val (dim_vector (count, 1), 1.0); + Array val (dim_vector (count, 1), 1.0); if (count > 0) { diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/DLD-FUNCTIONS/lookup.cc --- a/src/DLD-FUNCTIONS/lookup.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/DLD-FUNCTIONS/lookup.cc Fri Oct 16 13:12:31 2009 +0200 @@ -113,7 +113,7 @@ if (match_bool) { - boolNDArray match = ArrayN (array.lookupb (values)); + boolNDArray match = Array (array.lookupb (values)); retval = match; } else diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/DLD-FUNCTIONS/max.cc --- a/src/DLD-FUNCTIONS/max.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/DLD-FUNCTIONS/max.cc Fri Oct 16 13:12:31 2009 +0200 @@ -71,7 +71,7 @@ } \ else if (nargout == 2) \ { \ - ArrayN index; \ + Array index; \ \ if (arg1.is_real_type ()) \ { \ @@ -238,7 +238,7 @@ } \ else if (nargout == 2) \ { \ - ArrayN index; \ + Array index; \ \ if (arg1.is_real_type ()) \ { \ @@ -390,7 +390,7 @@ } \ else if (nargout == 2) \ { \ - ArrayN index; \ + Array index; \ \ TYP ## NDArray m = arg1. TYP ## _array_value (); \ \ diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/OPERATORS/op-dm-scm.cc --- a/src/OPERATORS/op-dm-scm.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/OPERATORS/op-dm-scm.cc Fri Oct 16 13:12:31 2009 +0200 @@ -148,7 +148,7 @@ { std::complex d = v2.complex_value (); - return octave_value (v1.diag_matrix_value () + d); + return octave_value (v1.matrix_value () + d); } else return v1.diag_matrix_value () + v2.sparse_complex_matrix_value (); @@ -164,7 +164,7 @@ { double d = v2.scalar_value (); - return octave_value (v1.complex_diag_matrix_value () + d); + return octave_value (v1.complex_matrix_value () + d); } else return v1.complex_diag_matrix_value () + v2.sparse_matrix_value (); @@ -180,7 +180,7 @@ { std::complex d = v2.complex_value (); - return octave_value (v1.complex_diag_matrix_value () + d); + return octave_value (v1.complex_matrix_value () + d); } else return v1.complex_diag_matrix_value () + v2.sparse_complex_matrix_value (); @@ -196,7 +196,7 @@ { std::complex d = v2.complex_value (); - return octave_value (v1.diag_matrix_value () + (-d)); + return octave_value (v1.matrix_value () + (-d)); } else return v1.diag_matrix_value () - v2.sparse_complex_matrix_value (); @@ -212,7 +212,7 @@ { double d = v2.scalar_value (); - return octave_value (v1.complex_diag_matrix_value () + (-d)); + return octave_value (v1.complex_matrix_value () + (-d)); } else return v1.complex_diag_matrix_value () - v2.sparse_matrix_value (); @@ -228,7 +228,7 @@ { std::complex d = v2.complex_value (); - return octave_value (v1.complex_diag_matrix_value () + (-d)); + return octave_value (v1.complex_matrix_value () + (-d)); } else return v1.complex_diag_matrix_value () - v2.sparse_complex_matrix_value (); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/OPERATORS/op-dm-sm.cc --- a/src/OPERATORS/op-dm-sm.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/OPERATORS/op-dm-sm.cc Fri Oct 16 13:12:31 2009 +0200 @@ -78,7 +78,7 @@ { double d = v2.scalar_value (); - return octave_value (v1.diag_matrix_value () + d); + return octave_value (v1.matrix_value () + d); } else return v1.diag_matrix_value () + v2.sparse_matrix_value (); @@ -94,7 +94,7 @@ { double d = v2.scalar_value (); - return octave_value (v1.diag_matrix_value () - d); + return octave_value (v1.matrix_value () - d); } else return v1.diag_matrix_value () - v2.sparse_matrix_value (); @@ -155,7 +155,7 @@ { double d = v1.scalar_value (); - return octave_value (d + v2.diag_matrix_value ()); + return octave_value (d + v2.matrix_value ()); } else return v1.sparse_matrix_value () + v2.diag_matrix_value (); @@ -171,7 +171,7 @@ { double d = v1.scalar_value (); - return octave_value (d - v2.diag_matrix_value ()); + return octave_value (d - v2.matrix_value ()); } else return v1.sparse_matrix_value () - v2.diag_matrix_value (); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/OPERATORS/op-dms-template.cc --- a/src/OPERATORS/op-dms-template.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/OPERATORS/op-dms-template.cc Fri Oct 16 13:12:31 2009 +0200 @@ -40,11 +40,7 @@ #define MATRIXV MATRIX #endif -DEFNDBINOP_OP (sdmadd, SCALAR, MATRIX, SCALARV, MATRIXV, +) -DEFNDBINOP_OP (sdmsub, SCALAR, MATRIX, SCALARV, MATRIXV, -) DEFNDBINOP_OP (sdmmul, SCALAR, MATRIX, SCALARV, MATRIXV, *) -DEFNDBINOP_OP (dmsadd, MATRIX, SCALAR, MATRIXV, SCALARV, +) -DEFNDBINOP_OP (dmssub, MATRIX, SCALAR, MATRIXV, SCALARV, -) DEFNDBINOP_OP (dmsmul, MATRIX, SCALAR, MATRIXV, SCALARV, *) #define OCTAVE_MATRIX CONCAT2(octave_, MATRIX) @@ -88,12 +84,8 @@ void INST_NAME (void) { - INSTALL_BINOP (op_add, OCTAVE_MATRIX, OCTAVE_SCALAR, dmsadd); - INSTALL_BINOP (op_sub, OCTAVE_MATRIX, OCTAVE_SCALAR, dmssub); INSTALL_BINOP (op_mul, OCTAVE_MATRIX, OCTAVE_SCALAR, dmsmul); INSTALL_BINOP (op_div, OCTAVE_MATRIX, OCTAVE_SCALAR, dmsdiv); - INSTALL_BINOP (op_add, OCTAVE_SCALAR, OCTAVE_MATRIX, sdmadd); - INSTALL_BINOP (op_sub, OCTAVE_SCALAR, OCTAVE_MATRIX, sdmsub); INSTALL_BINOP (op_mul, OCTAVE_SCALAR, OCTAVE_MATRIX, sdmmul); INSTALL_BINOP (op_ldiv, OCTAVE_SCALAR, OCTAVE_MATRIX, sdmldiv); INSTALL_BINOP (op_pow, OCTAVE_MATRIX, OCTAVE_SCALAR, dmspow); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/TEMPLATE-INST/Array-tc.cc --- a/src/TEMPLATE-INST/Array-tc.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/TEMPLATE-INST/Array-tc.cc Fri Oct 16 13:12:31 2009 +0200 @@ -32,9 +32,6 @@ #include "Array2.h" -#include "ArrayN.h" -#include "ArrayN.cc" - #include "ov.h" #include "oct-sort.cc" @@ -45,8 +42,6 @@ template class OCTINTERP_API Array2; -template class OCTINTERP_API ArrayN; - /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/data.cc --- a/src/data.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/data.cc Fri Oct 16 13:12:31 2009 +0200 @@ -6263,7 +6263,7 @@ else error ("accumarray: dimensions mismatch"); - return NDT (MArrayN (ArrayN (array))); + return NDT (MArrayN (Array (array))); } DEFUN (__accumarray_sum__, args, , diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/oct-map.cc --- a/src/oct-map.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/oct-map.cc Fri Oct 16 13:12:31 2009 +0200 @@ -509,7 +509,7 @@ { Cell tmp = contents (p); - tmp = tmp.ArrayN::index (ra_idx, resize_ok); + tmp = tmp.Array::index (ra_idx, resize_ok); if (error_state) break; diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-cx-mat.h --- a/src/ov-cx-mat.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-cx-mat.h Fri Oct 16 13:12:31 2009 +0200 @@ -66,7 +66,7 @@ octave_complex_matrix (const ComplexMatrix& m, const MatrixType& t) : octave_base_matrix (m, t) { } - octave_complex_matrix (const ArrayN& m) + octave_complex_matrix (const Array& m) : octave_base_matrix (ComplexNDArray (m)) { } octave_complex_matrix (const ComplexDiagMatrix& d) diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-flt-cx-mat.cc --- a/src/ov-flt-cx-mat.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-flt-cx-mat.cc Fri Oct 16 13:12:31 2009 +0200 @@ -259,7 +259,7 @@ gripe_implicit_conversion ("Octave:imag-to-real", "complex matrix", "real matrix"); - retval = SparseMatrix (::real (matrix.matrix_value ())); + retval = SparseMatrix (::real (complex_matrix_value ())); return retval; } @@ -267,7 +267,7 @@ SparseComplexMatrix octave_float_complex_matrix::sparse_complex_matrix_value (bool) const { - return SparseComplexMatrix (matrix.matrix_value ()); + return SparseComplexMatrix (complex_matrix_value ()); } octave_value diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-flt-cx-mat.h --- a/src/ov-flt-cx-mat.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-flt-cx-mat.h Fri Oct 16 13:12:31 2009 +0200 @@ -66,7 +66,7 @@ octave_float_complex_matrix (const FloatComplexMatrix& m, const MatrixType& t) : octave_base_matrix (m, t) { } - octave_float_complex_matrix (const ArrayN& m) + octave_float_complex_matrix (const Array& m) : octave_base_matrix (FloatComplexNDArray (m)) { } octave_float_complex_matrix (const FloatComplexDiagMatrix& d) diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-flt-re-mat.cc --- a/src/ov-flt-re-mat.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-flt-re-mat.cc Fri Oct 16 13:12:31 2009 +0200 @@ -238,7 +238,7 @@ SparseMatrix octave_float_matrix::sparse_matrix_value (bool) const { - return SparseMatrix (matrix.matrix_value ()); + return SparseMatrix (matrix_value ()); } SparseComplexMatrix diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-flt-re-mat.h --- a/src/ov-flt-re-mat.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-flt-re-mat.h Fri Oct 16 13:12:31 2009 +0200 @@ -66,7 +66,7 @@ octave_float_matrix (const FloatNDArray& nda) : octave_base_matrix (nda) { } - octave_float_matrix (const ArrayN& m) + octave_float_matrix (const Array& m) : octave_base_matrix (FloatNDArray (m)) { } octave_float_matrix (const FloatDiagMatrix& d) diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-intx.h --- a/src/ov-intx.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-intx.h Fri Oct 16 13:12:31 2009 +0200 @@ -52,7 +52,7 @@ OCTAVE_VALUE_INT_MATRIX_T (const intNDArray& nda) : octave_base_int_matrix > (nda) { } - OCTAVE_VALUE_INT_MATRIX_T (const ArrayN& nda) + OCTAVE_VALUE_INT_MATRIX_T (const Array& nda) : octave_base_int_matrix > (intNDArray (nda)) { } diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov-re-mat.h --- a/src/ov-re-mat.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov-re-mat.h Fri Oct 16 13:12:31 2009 +0200 @@ -66,7 +66,7 @@ octave_matrix (const NDArray& nda) : octave_base_matrix (nda) { } - octave_matrix (const ArrayN& m) + octave_matrix (const Array& m) : octave_base_matrix (NDArray (m)) { } octave_matrix (const DiagMatrix& d) diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov.cc --- a/src/ov.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov.cc Fri Oct 16 13:12:31 2009 +0200 @@ -586,7 +586,7 @@ { } -octave_value::octave_value (const ArrayN& a, bool is_csl) +octave_value::octave_value (const Array& a, bool is_csl) : rep (is_csl ? dynamic_cast (new octave_cs_list (Cell (a))) : dynamic_cast (new octave_cell (Cell (a)))) @@ -617,13 +617,13 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& a) +octave_value::octave_value (const Array& a) : rep (new octave_matrix (a)) { maybe_mutate (); } -octave_value::octave_value (const ArrayN& a) +octave_value::octave_value (const Array& a) : rep (new octave_float_matrix (a)) { maybe_mutate (); @@ -701,13 +701,13 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& a) +octave_value::octave_value (const Array& a) : rep (new octave_complex_matrix (a)) { maybe_mutate (); } -octave_value::octave_value (const ArrayN& a) +octave_value::octave_value (const Array& a) : rep (new octave_float_complex_matrix (a)) { maybe_mutate (); @@ -772,7 +772,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& bnda) +octave_value::octave_value (const Array& bnda) : rep (new octave_bool_matrix (bnda)) { maybe_mutate (); @@ -826,7 +826,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& chm, char type) +octave_value::octave_value (const Array& chm, char type) : rep (type == '"' ? new octave_char_matrix_dq_str (chm) : new octave_char_matrix_sq_str (chm)) @@ -850,7 +850,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& chm, bool, char type) +octave_value::octave_value (const Array& chm, bool, char type) : rep (type == '"' ? new octave_char_matrix_dq_str (chm) : new octave_char_matrix_sq_str (chm)) @@ -948,7 +948,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_int8_matrix (inda)) { maybe_mutate (); @@ -960,7 +960,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_uint8_matrix (inda)) { maybe_mutate (); @@ -972,7 +972,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_int16_matrix (inda)) { maybe_mutate (); @@ -984,7 +984,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_uint16_matrix (inda)) { maybe_mutate (); @@ -996,7 +996,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_int32_matrix (inda)) { maybe_mutate (); @@ -1008,7 +1008,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_uint32_matrix (inda)) { maybe_mutate (); @@ -1020,7 +1020,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_int64_matrix (inda)) { maybe_mutate (); @@ -1032,7 +1032,7 @@ maybe_mutate (); } -octave_value::octave_value (const ArrayN& inda) +octave_value::octave_value (const Array& inda) : rep (new octave_uint64_matrix (inda)) { maybe_mutate (); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/ov.h --- a/src/ov.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/ov.h Fri Oct 16 13:12:31 2009 +0200 @@ -190,14 +190,14 @@ octave_value (octave_time t); octave_value (double d); octave_value (float d); - octave_value (const ArrayN& a, bool is_cs_list = false); + octave_value (const Array& a, bool is_cs_list = false); octave_value (const Cell& c, bool is_cs_list = false); octave_value (const Matrix& m, const MatrixType& t = MatrixType()); octave_value (const FloatMatrix& m, const MatrixType& t = MatrixType()); octave_value (const NDArray& nda); octave_value (const FloatNDArray& nda); - octave_value (const ArrayN& m); - octave_value (const ArrayN& m); + octave_value (const Array& m); + octave_value (const Array& m); octave_value (const DiagMatrix& d); octave_value (const FloatDiagMatrix& d); octave_value (const RowVector& v); @@ -210,8 +210,8 @@ octave_value (const FloatComplexMatrix& m, const MatrixType& t = MatrixType()); octave_value (const ComplexNDArray& cnda); octave_value (const FloatComplexNDArray& cnda); - octave_value (const ArrayN& m); - octave_value (const ArrayN& m); + octave_value (const Array& m); + octave_value (const Array& m); octave_value (const ComplexDiagMatrix& d); octave_value (const FloatComplexDiagMatrix& d); octave_value (const ComplexRowVector& v); @@ -222,19 +222,19 @@ octave_value (bool b); octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType()); octave_value (const boolNDArray& bnda); - octave_value (const ArrayN& bnda); + octave_value (const Array& bnda); octave_value (char c, char type = '\''); octave_value (const char *s, char type = '\''); octave_value (const std::string& s, char type = '\''); octave_value (const string_vector& s, char type = '\''); octave_value (const charMatrix& chm, char type = '\''); octave_value (const charNDArray& chnda, char type = '\''); - octave_value (const ArrayN& chnda, char type = '\''); + octave_value (const Array& chnda, char type = '\''); octave_value (const charMatrix& chm, bool is_string, char type = '\'') GCC_ATTR_DEPRECATED; octave_value (const charNDArray& chnda, bool is_string, char type = '\'') GCC_ATTR_DEPRECATED; - octave_value (const ArrayN& chnda, bool is_string, + octave_value (const Array& chnda, bool is_string, char type = '\'') GCC_ATTR_DEPRECATED; octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ()); octave_value (const Sparse& m, const MatrixType& t = MatrixType ()); @@ -253,21 +253,21 @@ octave_value (const octave_uint32& i); octave_value (const octave_uint64& i); octave_value (const int8NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const int16NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const int32NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const int64NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const uint8NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const uint16NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const uint32NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const uint64NDArray& inda); - octave_value (const ArrayN& inda); + octave_value (const Array& inda); octave_value (const Array& inda, bool zero_based = false, bool cache_index = false); octave_value (const Array& cellstr); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/pr-output.cc --- a/src/pr-output.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/pr-output.cc Fri Oct 16 13:12:31 2009 +0200 @@ -2661,13 +2661,13 @@ octave_print_internal (std::ostream& os, const std::string& s, bool pr_as_read_syntax, int extra_indent) { - ArrayN nda (dim_vector (1, 1), s); + Array nda (dim_vector (1, 1), s); octave_print_internal (os, nda, pr_as_read_syntax, extra_indent); } void -octave_print_internal (std::ostream& os, const ArrayN& nda, +octave_print_internal (std::ostream& os, const Array& nda, bool pr_as_read_syntax, int /* extra_indent */) { // FIXME -- this mostly duplicates the code in the diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/pr-output.h --- a/src/pr-output.h Fri Oct 16 10:28:26 2009 +0200 +++ b/src/pr-output.h Fri Oct 16 13:12:31 2009 +0200 @@ -28,7 +28,7 @@ #include "oct-cmplx.h" -template class ArrayN; +template class Array; class ComplexMatrix; class FloatComplexMatrix; class ComplexDiagMatrix; @@ -171,7 +171,7 @@ int extra_indent = 0); extern OCTINTERP_API void -octave_print_internal (std::ostream& os, const ArrayN& sa, +octave_print_internal (std::ostream& os, const Array& sa, bool pr_as_read_syntax = false, int extra_indent = 0); diff -r 7b9cbaad68d6 -r b4fdfee405b5 src/variables.cc --- a/src/variables.cc Fri Oct 16 10:28:26 2009 +0200 +++ b/src/variables.cc Fri Oct 16 13:12:31 2009 +0200 @@ -1088,15 +1088,15 @@ { size_t len = lst.size (); - Array name_info (len, 1); - Array size_info (len, 1); - Array bytes_info (len, 1); - Array class_info (len, 1); - Array global_info (len, 1); - Array sparse_info (len, 1); - Array complex_info (len, 1); - Array nesting_info (len, 1); - Array persistent_info (len, 1); + Cell name_info (len, 1); + Cell size_info (len, 1); + Cell bytes_info (len, 1); + Cell class_info (len, 1); + Cell global_info (len, 1); + Cell sparse_info (len, 1); + Cell complex_info (len, 1); + Cell nesting_info (len, 1); + Cell persistent_info (len, 1); std::list::const_iterator p = lst.begin ();