4508
|
1 // Template array classes with like-type math ops |
|
2 /* |
|
3 |
|
4 Copyright (C) 1996, 1997 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
|
25 #pragma interface |
|
26 #endif |
|
27 |
|
28 #if !defined (octave_MArrayN_h) |
|
29 #define octave_MArrayN_h 1 |
|
30 |
|
31 #include "ArrayN.h" |
4513
|
32 #include "MArray2.h" |
|
33 #include "dim-vector.h" |
|
34 |
|
35 // N-dimensional array with math ops. |
4508
|
36 |
|
37 // But first, some preprocessor abuse... |
|
38 |
|
39 #include "MArray-defs.h" |
|
40 |
|
41 MARRAY_OPS_FORWARD_DECLS (MArrayN) |
|
42 |
|
43 template <class T> |
|
44 class |
|
45 MArrayN : public ArrayN<T> |
|
46 { |
4513
|
47 protected: |
4508
|
48 |
4587
|
49 MArrayN (T *d, const dim_vector& dv) : ArrayN<T> (d, dv) { } |
4508
|
50 |
4513
|
51 public: |
4508
|
52 |
|
53 MArrayN (void) : ArrayN<T> () {} |
|
54 |
4587
|
55 MArrayN (const dim_vector& dv) : ArrayN<T> (dv) { } |
4508
|
56 |
4587
|
57 MArrayN (const dim_vector& dv, const T& val) : ArrayN<T> (dv, val) { } |
4513
|
58 |
|
59 MArrayN (const Array2<T>& a) : ArrayN<T> (a) { } |
4508
|
60 |
|
61 MArrayN (const ArrayN<T>& a) : ArrayN<T> (a) { } |
|
62 |
|
63 MArrayN (const MArrayN<T>& a) : ArrayN<T> (a) { } |
|
64 |
|
65 ~MArrayN (void) { } |
|
66 |
|
67 MArrayN<T>& operator = (const MArrayN<T>& a) |
|
68 { |
|
69 ArrayN<T>::operator = (a); |
|
70 return *this; |
|
71 } |
|
72 }; |
|
73 |
|
74 #endif |
4513
|
75 |
|
76 /* |
|
77 ;;; Local Variables: *** |
|
78 ;;; mode: C++ *** |
|
79 ;;; End: *** |
|
80 */ |