1993
|
1 // Template array classes with like-type math ops |
1988
|
2 /* |
|
3 |
7017
|
4 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2007 |
|
5 John W. Eaton |
1988
|
6 |
|
7 This file is part of Octave. |
|
8 |
|
9 Octave is free software; you can redistribute it and/or modify it |
|
10 under the terms of the GNU General Public License as published by the |
7016
|
11 Free Software Foundation; either version 3 of the License, or (at your |
|
12 option) any later version. |
1988
|
13 |
|
14 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
17 for more details. |
|
18 |
|
19 You should have received a copy of the GNU General Public License |
7016
|
20 along with Octave; see the file COPYING. If not, see |
|
21 <http://www.gnu.org/licenses/>. |
1988
|
22 |
|
23 */ |
|
24 |
|
25 #if !defined (octave_MArray2_h) |
|
26 #define octave_MArray2_h 1 |
|
27 |
|
28 #include "Array2.h" |
|
29 |
3573
|
30 // Two dimensional array with math ops. |
3107
|
31 |
3573
|
32 // But first, some preprocessor abuse... |
3107
|
33 |
3573
|
34 #include "MArray-defs.h" |
3107
|
35 |
6708
|
36 MARRAY_OPS_FORWARD_DECLS (MArray2, ) |
1988
|
37 |
|
38 template <class T> |
3585
|
39 class |
|
40 MArray2 : public Array2<T> |
1988
|
41 { |
|
42 protected: |
|
43 |
5275
|
44 MArray2 (T *d, octave_idx_type n, octave_idx_type m) : Array2<T> (d, n, m) { } |
1988
|
45 |
|
46 public: |
|
47 |
|
48 MArray2 (void) : Array2<T> () { } |
3585
|
49 |
5275
|
50 MArray2 (octave_idx_type n, octave_idx_type m) : Array2<T> (n, m) { } |
3585
|
51 |
5275
|
52 MArray2 (octave_idx_type n, octave_idx_type m, const T& val) : Array2<T> (n, m, val) { } |
3585
|
53 |
6979
|
54 MArray2 (const dim_vector& dv) : Array2<T> (dv) { } |
|
55 |
|
56 MArray2 (const dim_vector& dv, const T& val) : Array2<T> (dv, val) { } |
|
57 |
3585
|
58 MArray2 (const MArray2<T>& a) : Array2<T> (a) { } |
|
59 |
1988
|
60 MArray2 (const Array2<T>& a) : Array2<T> (a) { } |
|
61 |
|
62 ~MArray2 (void) { } |
|
63 |
|
64 MArray2<T>& operator = (const MArray2<T>& a) |
|
65 { |
|
66 Array2<T>::operator = (a); |
|
67 return *this; |
|
68 } |
|
69 |
5275
|
70 MArray2<T>& insert (const Array2<T>& a, octave_idx_type r, octave_idx_type c) |
3225
|
71 { |
|
72 Array2<T>::insert (a, r, c); |
|
73 return *this; |
|
74 } |
|
75 |
|
76 MArray2<T> transpose (void) const { return Array2<T>::transpose (); } |
1988
|
77 |
3573
|
78 // Currently, the OPS functions don't need to be friends, but that |
|
79 // may change. |
|
80 |
3610
|
81 // MARRAY_OPS_FRIEND_DECLS (MArray2) |
3573
|
82 }; |
3107
|
83 |
1988
|
84 #endif |
|
85 |
|
86 /* |
|
87 ;;; Local Variables: *** |
|
88 ;;; mode: C++ *** |
|
89 ;;; End: *** |
|
90 */ |