# HG changeset patch # User Jaroslav Hajek # Date 1266930934 -3600 # Node ID 5150ceb4dbb4d10dd019c68f131019745ddd8cac # Parent 12884915a8e46a2a876d47083ea8c788e2ed1126 base charMatrix and boolMatrix on Array diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +2010-02-23 Jaroslav Hajek + + * chMatrix.h (charMatrix): Base on Array. + * chMatrix.cc (charMatrix): Update. + * boolMatrix.h (boolMatrix): Ditto. + * boolMatrix.h (boolMatrix): Update. + 2010-02-23 Jaroslav Hajek * Array.h (Array): Define 2D constructors. Remove conflicting 1D diff --git a/liboctave/boolMatrix.cc b/liboctave/boolMatrix.cc --- a/liboctave/boolMatrix.cc +++ b/liboctave/boolMatrix.cc @@ -56,7 +56,7 @@ boolMatrix& boolMatrix::insert (const boolMatrix& a, octave_idx_type r, octave_idx_type c) { - Array2::insert (a, r, c); + Array::insert (a, r, c); return *this; } @@ -82,7 +82,7 @@ boolMatrix boolMatrix::diag (octave_idx_type k) const { - return Array2::diag (k); + return Array::diag (k); } // FIXME Do these really belong here? Maybe they should be diff --git a/liboctave/boolMatrix.h b/liboctave/boolMatrix.h --- a/liboctave/boolMatrix.h +++ b/liboctave/boolMatrix.h @@ -24,35 +24,35 @@ #if !defined (octave_boolMatrix_int_h) #define octave_boolMatrix_int_h 1 -#include "Array2.h" +#include "Array.h" #include "mx-defs.h" #include "mx-op-decl.h" class OCTAVE_API -boolMatrix : public Array2 +boolMatrix : public Array { public: - boolMatrix (void) : Array2 () { } - boolMatrix (octave_idx_type r, octave_idx_type c) : Array2 (r, c) { } - boolMatrix (octave_idx_type r, octave_idx_type c, bool val) : Array2 (r, c, val) { } - boolMatrix (const dim_vector& dv) : Array2 (dv) { } - boolMatrix (const dim_vector& dv, bool val) : Array2 (dv, val) { } - boolMatrix (const Array2& a) : Array2 (a) { } - boolMatrix (const boolMatrix& a) : Array2 (a) { } + boolMatrix (void) : Array () { } + boolMatrix (octave_idx_type r, octave_idx_type c) : Array (r, c) { } + boolMatrix (octave_idx_type r, octave_idx_type c, bool val) : Array (r, c, val) { } + boolMatrix (const dim_vector& dv) : Array (dv) { } + boolMatrix (const dim_vector& dv, bool val) : Array (dv, val) { } + boolMatrix (const Array& a) : Array (a) { } + boolMatrix (const boolMatrix& a) : Array (a) { } boolMatrix& operator = (const boolMatrix& a) { - Array2::operator = (a); + Array::operator = (a); return *this; } bool operator == (const boolMatrix& a) const; bool operator != (const boolMatrix& a) const; - boolMatrix transpose (void) const { return Array2::transpose (); } + boolMatrix transpose (void) const { return Array::transpose (); } // destructive insert/delete/reorder operations @@ -80,7 +80,7 @@ private: - boolMatrix (bool *b, octave_idx_type r, octave_idx_type c) : Array2 (b, r, c) { } + boolMatrix (bool *b, octave_idx_type r, octave_idx_type c) : Array (b, r, c) { } }; MM_BOOL_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API) diff --git a/liboctave/chMatrix.cc b/liboctave/chMatrix.cc --- a/liboctave/chMatrix.cc +++ b/liboctave/chMatrix.cc @@ -40,7 +40,7 @@ // charMatrix class. charMatrix::charMatrix (char c) - : Array2 () + : Array () { octave_idx_type nc = 1; octave_idx_type nr = 1; @@ -51,7 +51,7 @@ } charMatrix::charMatrix (const char *s) - : Array2 () + : Array () { octave_idx_type nc = s ? strlen (s) : 0; octave_idx_type nr = s && nc > 0 ? 1 : 0; @@ -63,7 +63,7 @@ } charMatrix::charMatrix (const std::string& s) - : Array2 () + : Array () { octave_idx_type nc = s.length (); octave_idx_type nr = nc > 0 ? 1 : 0; @@ -75,7 +75,7 @@ } charMatrix::charMatrix (const string_vector& s) - : Array2 (s.length (), s.max_length (), 0) + : Array (s.length (), s.max_length (), 0) { octave_idx_type nr = rows (); @@ -125,7 +125,7 @@ charMatrix& charMatrix::insert (const charMatrix& a, octave_idx_type r, octave_idx_type c) { - Array2::insert (a, r, c); + Array::insert (a, r, c); return *this; } @@ -196,7 +196,7 @@ charMatrix charMatrix::diag (octave_idx_type k) const { - return Array2::diag (k); + return Array::diag (k); } // FIXME Do these really belong here? Maybe they should be diff --git a/liboctave/chMatrix.h b/liboctave/chMatrix.h --- a/liboctave/chMatrix.h +++ b/liboctave/chMatrix.h @@ -26,7 +26,7 @@ #include -#include "Array2.h" +#include "Array.h" #include "mx-defs.h" #include "mx-op-decl.h" @@ -34,19 +34,19 @@ class OCTAVE_API -charMatrix : public Array2 +charMatrix : public Array { friend class ComplexMatrix; public: - charMatrix (void) : Array2 () { } - charMatrix (octave_idx_type r, octave_idx_type c) : Array2 (r, c) { } - charMatrix (octave_idx_type r, octave_idx_type c, char val) : Array2 (r, c, val) { } - charMatrix (const dim_vector& dv) : Array2 (dv) { } - charMatrix (const dim_vector& dv, char val) : Array2 (dv, val) { } - charMatrix (const Array2& a) : Array2 (a) { } - charMatrix (const charMatrix& a) : Array2 (a) { } + charMatrix (void) : Array () { } + charMatrix (octave_idx_type r, octave_idx_type c) : Array (r, c) { } + charMatrix (octave_idx_type r, octave_idx_type c, char val) : Array (r, c, val) { } + charMatrix (const dim_vector& dv) : Array (dv) { } + charMatrix (const dim_vector& dv, char val) : Array (dv, val) { } + charMatrix (const Array& a) : Array (a) { } + charMatrix (const charMatrix& a) : Array (a) { } charMatrix (char c); charMatrix (const char *s); charMatrix (const std::string& s); @@ -54,14 +54,14 @@ charMatrix& operator = (const charMatrix& a) { - Array2::operator = (a); + Array::operator = (a); return *this; } bool operator == (const charMatrix& a) const; bool operator != (const charMatrix& a) const; - charMatrix transpose (void) const { return Array2::transpose (); } + charMatrix transpose (void) const { return Array::transpose (); } // destructive insert/delete/reorder operations @@ -90,7 +90,7 @@ private: - charMatrix (char *ch, octave_idx_type r, octave_idx_type c) : Array2 (ch, r, c) { } + charMatrix (char *ch, octave_idx_type r, octave_idx_type c) : Array (ch, r, c) { } }; MS_CMP_OP_DECLS (charMatrix, char, OCTAVE_API) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2010-02-23 Jaroslav Hajek + + * ov-bool-mat.h (octave_bool_matrix::octave_bool_matrix (const + Array&)): New ctor. + * ov-ch-mat.h (octave_char_matrix::octave_char_matrix (const + Array&)): New ctor. + * ov-str-mat.h (octave_char_matrix_str::octave_char_matrix_str (const + Array&)): New ctor. + (octave_char_matrix_sq_str::octave_char_matrix_sq_str (const + Array&)): New ctor. + 2010-02-23 Jaroslav Hajek * Cell.cc: Reflect Array API changes. diff --git a/src/ov-bool-mat.h b/src/ov-bool-mat.h --- a/src/ov-bool-mat.h +++ b/src/ov-bool-mat.h @@ -59,6 +59,9 @@ octave_bool_matrix (const boolNDArray& bnda) : octave_base_matrix (bnda) { } + octave_bool_matrix (const Array& bnda) + : octave_base_matrix (bnda) { } + octave_bool_matrix (const boolMatrix& bm) : octave_base_matrix (bm) { } diff --git a/src/ov-ch-mat.h b/src/ov-ch-mat.h --- a/src/ov-ch-mat.h +++ b/src/ov-ch-mat.h @@ -61,6 +61,9 @@ octave_char_matrix (const charNDArray& chm) : octave_base_matrix (chm) { } + octave_char_matrix (const Array& chm) + : octave_base_matrix (chm) { } + octave_char_matrix (char c) : octave_base_matrix (c) { } diff --git a/src/ov-str-mat.h b/src/ov-str-mat.h --- a/src/ov-str-mat.h +++ b/src/ov-str-mat.h @@ -62,6 +62,9 @@ octave_char_matrix_str (const charNDArray& chm) : octave_char_matrix (chm) { } + octave_char_matrix_str (const Array& chm) + : octave_char_matrix (chm) { } + octave_char_matrix_str (char c) : octave_char_matrix (c) { } @@ -184,6 +187,9 @@ octave_char_matrix_sq_str (const charNDArray& chm) : octave_char_matrix_str (chm) { } + octave_char_matrix_sq_str (const Array& chm) + : octave_char_matrix_str (chm) { } + octave_char_matrix_sq_str (char c) : octave_char_matrix_str (c) { }