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" |
|
32 // Two dimensional array with math ops. |
|
33 |
|
34 // But first, some preprocessor abuse... |
|
35 |
|
36 #include "MArray-defs.h" |
|
37 |
|
38 class Matrix; |
|
39 |
|
40 MARRAY_OPS_FORWARD_DECLS (MArrayN) |
|
41 |
|
42 template <class T> |
|
43 class |
|
44 MArrayN : public ArrayN<T> |
|
45 { |
|
46 protected: |
|
47 |
|
48 MArrayN (T *d, const Array<int>& dims) : ArrayN<T> (d, dims) |
|
49 { } |
|
50 |
|
51 public: |
|
52 |
|
53 MArrayN (void) : ArrayN<T> () {} |
|
54 |
|
55 MArrayN (const Array<int>& dims) : ArrayN<T> (dims) |
|
56 { } |
|
57 |
|
58 MArrayN (const Array<int>& dims, const T& val) |
|
59 : ArrayN<T> (dims, val) { } |
|
60 |
|
61 MArrayN (const ArrayN<T>& a) : ArrayN<T> (a) { } |
|
62 |
|
63 //MArrayN (const Array<T>& a) : ArrayN<T> (a) { } |
|
64 |
|
65 MArrayN (const MArrayN<T>& a) : ArrayN<T> (a) { } |
|
66 |
|
67 MArrayN (const Matrix& m) : ArrayN<T> (m) { } |
|
68 |
|
69 ~MArrayN (void) { } |
|
70 |
|
71 MArrayN<T>& operator = (const MArrayN<T>& a) |
|
72 { |
|
73 ArrayN<T>::operator = (a); |
|
74 return *this; |
|
75 } |
|
76 |
|
77 }; |
|
78 |
|
79 extern void |
|
80 gripe_nonconformant (const char *op, Array<int>& op1_dims, Array<int>& op2_dims); |
|
81 |
|
82 #endif |