# HG changeset patch # User Jaroslav Hajek # Date 1265290609 -3600 # Node ID 479c7df0cc9635208b9b7ef3980c9e2e05a2cd82 # Parent 82db36545def309989b921223a2586beec177f2a don't instantiate MArray diff -r 82db36545def -r 479c7df0cc96 liboctave/ChangeLog --- a/liboctave/ChangeLog Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/ChangeLog Thu Feb 04 14:36:49 2010 +0100 @@ -1,3 +1,12 @@ +2010-02-04 Jaroslav Hajek + + * chMatrix.h (charMatrix): Rebase directly on Array. + * chNDArray.h (charNDArray): Ditto. + * chMatrix.cc: Update. + * chNDArray.cc: Update. + * MArray-ch.cc: Remove. + * Makefile.am: Update. + 2010-02-04 John W. Eaton * lo-cutils.c (gethostname): Delete function. diff -r 82db36545def -r 479c7df0cc96 liboctave/MArray-ch.cc --- a/liboctave/MArray-ch.cc Thu Feb 04 04:43:08 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - -Copyright (C) 1995, 1996, 1997, 2000, 2005, 2007 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 - -// Instantiate MArrays of char values. - -#include "MArray.h" -#include "MArray.cc" - -template class OCTAVE_API MArray; - -INSTANTIATE_MARRAY_FRIENDS (char, OCTAVE_API) - -#include "MArray2.h" -#include "MArray2.cc" - -template class OCTAVE_API MArray2; - -INSTANTIATE_MARRAY2_FRIENDS (char, OCTAVE_API) - -#include "MDiagArray2.h" -#include "MDiagArray2.cc" - -template class OCTAVE_API MDiagArray2; - -INSTANTIATE_MDIAGARRAY2_FRIENDS (char, OCTAVE_API) diff -r 82db36545def -r 479c7df0cc96 liboctave/Makefile.am --- a/liboctave/Makefile.am Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/Makefile.am Thu Feb 04 14:36:49 2010 +0100 @@ -296,7 +296,6 @@ Array-str.cc \ Array-voidp.cc \ MArray-C.cc \ - MArray-ch.cc \ MArray-d.cc \ MArray-f.cc \ MArray-fC.cc \ diff -r 82db36545def -r 479c7df0cc96 liboctave/chMatrix.cc --- a/liboctave/chMatrix.cc Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/chMatrix.cc Thu Feb 04 14:36:49 2010 +0100 @@ -40,7 +40,7 @@ // charMatrix class. charMatrix::charMatrix (char c) - : MArray2 () + : Array2 () { octave_idx_type nc = 1; octave_idx_type nr = 1; @@ -51,7 +51,7 @@ } charMatrix::charMatrix (const char *s) - : MArray2 () + : Array2 () { 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) - : MArray2 () + : Array2 () { octave_idx_type nc = s.length (); octave_idx_type nr = nc > 0 ? 1 : 0; @@ -75,7 +75,7 @@ } charMatrix::charMatrix (const string_vector& s) - : MArray2 (s.length (), s.max_length (), 0) + : Array2 (s.length (), s.max_length (), 0) { octave_idx_type nr = rows (); @@ -196,7 +196,7 @@ charMatrix charMatrix::diag (octave_idx_type k) const { - return MArray2::diag (k); + return Array2::diag (k); } // FIXME Do these really belong here? Maybe they should be diff -r 82db36545def -r 479c7df0cc96 liboctave/chMatrix.h --- a/liboctave/chMatrix.h Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/chMatrix.h Thu Feb 04 14:36:49 2010 +0100 @@ -26,7 +26,7 @@ #include -#include "MArray2.h" +#include "Array2.h" #include "mx-defs.h" #include "mx-op-decl.h" @@ -34,19 +34,19 @@ class OCTAVE_API -charMatrix : public MArray2 +charMatrix : public Array2 { friend class ComplexMatrix; public: - charMatrix (void) : MArray2 () { } - charMatrix (octave_idx_type r, octave_idx_type c) : MArray2 (r, c) { } - charMatrix (octave_idx_type r, octave_idx_type c, char val) : MArray2 (r, c, val) { } - charMatrix (const dim_vector& dv) : MArray2 (dv) { } - charMatrix (const dim_vector& dv, char val) : MArray2 (dv, val) { } - charMatrix (const MArray2& a) : MArray2 (a) { } - charMatrix (const charMatrix& a) : MArray2 (a) { } + 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 (char c); charMatrix (const char *s); charMatrix (const std::string& s); @@ -54,14 +54,14 @@ charMatrix& operator = (const charMatrix& a) { - MArray2::operator = (a); + Array2::operator = (a); return *this; } bool operator == (const charMatrix& a) const; bool operator != (const charMatrix& a) const; - charMatrix transpose (void) const { return MArray2::transpose (); } + charMatrix transpose (void) const { return Array2::transpose (); } // destructive insert/delete/reorder operations @@ -90,7 +90,7 @@ private: - charMatrix (char *ch, octave_idx_type r, octave_idx_type c) : MArray2 (ch, r, c) { } + charMatrix (char *ch, octave_idx_type r, octave_idx_type c) : Array2 (ch, r, c) { } }; MS_CMP_OP_DECLS (charMatrix, char, OCTAVE_API) @@ -102,6 +102,4 @@ MM_CMP_OP_DECLS (charMatrix, charMatrix, OCTAVE_API) MM_BOOL_OP_DECLS (charMatrix, charMatrix, OCTAVE_API) -MARRAY_FORWARD_DEFS (MArray2, charMatrix, char) - #endif diff -r 82db36545def -r 479c7df0cc96 liboctave/chNDArray.cc --- a/liboctave/chNDArray.cc Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/chNDArray.cc Thu Feb 04 14:36:49 2010 +0100 @@ -151,7 +151,7 @@ charNDArray charNDArray::diag (octave_idx_type k) const { - return MArrayN::diag (k); + return Array::diag (k); } NDS_CMP_OPS (charNDArray, char) diff -r 82db36545def -r 479c7df0cc96 liboctave/chNDArray.h --- a/liboctave/chNDArray.h Thu Feb 04 04:43:08 2010 -0500 +++ b/liboctave/chNDArray.h Thu Feb 04 14:36:49 2010 +0100 @@ -23,7 +23,7 @@ #if !defined (octave_charNDArray_h) #define octave_charNDArray_h 1 -#include "MArrayN.h" +#include "Array.h" #include "chMatrix.h" #include "mx-defs.h" @@ -32,35 +32,35 @@ class OCTAVE_API -charNDArray : public MArrayN +charNDArray : public Array { public: typedef charMatrix matrix_type; - charNDArray (void) : MArrayN () { } + charNDArray (void) : Array () { } - charNDArray (const dim_vector& dv) : MArrayN (dv) { } + charNDArray (const dim_vector& dv) : Array (dv) { } - charNDArray (const dim_vector& dv, char val) : MArrayN (dv, val) { } + charNDArray (const dim_vector& dv, char val) : Array (dv, val) { } - charNDArray (const charNDArray& a) : MArrayN (a) { } + charNDArray (const charNDArray& a) : Array (a) { } - charNDArray (const charMatrix& a) : MArrayN (a) { } + charNDArray (const charMatrix& a) : Array (a) { } - charNDArray (char c) : MArrayN (charMatrix (c)) { } + charNDArray (char c) : Array (charMatrix (c)) { } - charNDArray (const char *s) : MArrayN (charMatrix (s)) { } + charNDArray (const char *s) : Array (charMatrix (s)) { } - charNDArray (const std::string& s) : MArrayN (charMatrix (s)) { } + charNDArray (const std::string& s) : Array (charMatrix (s)) { } - charNDArray (const string_vector& s) : MArrayN (charMatrix (s)) { } + charNDArray (const string_vector& s) : Array (charMatrix (s)) { } - charNDArray (const Array& a) : MArrayN (a) { } + charNDArray (const Array& a) : Array (a) { } charNDArray& operator = (const charNDArray& a) { - MArrayN::operator = (a); + Array::operator = (a); return *this; } @@ -98,7 +98,7 @@ private: - charNDArray (char *d, dim_vector& dv) : MArrayN (d, dv) { } + charNDArray (char *d, dim_vector& dv) : Array (d, dv) { } }; NDS_CMP_OP_DECLS (charNDArray, char, OCTAVE_API) @@ -110,8 +110,6 @@ NDND_CMP_OP_DECLS (charNDArray, charNDArray, OCTAVE_API) NDND_BOOL_OP_DECLS (charNDArray, charNDArray, OCTAVE_API) -MARRAY_FORWARD_DEFS (MArrayN, charNDArray, char) - BSXFUN_STDREL_DECLS (charNDArray, OCTAVE_API) #endif