Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #if !defined (octave_MArray_h)
00026 #define octave_MArray_h 1
00027
00028 #include "Array.h"
00029
00030
00031
00032
00033
00034 #include "MArray-decl.h"
00035
00036 MARRAY_OPS_FORWARD_DECLS (MArray, )
00037
00038 template <class T>
00039 class
00040 MArray : public Array<T>
00041 {
00042 public:
00043
00044 MArray (void) : Array<T> () {}
00045
00046 explicit MArray (octave_idx_type n) GCC_ATTR_DEPRECATED
00047 : Array<T> (dim_vector (n, 1)) { }
00048
00049 MArray (octave_idx_type n, const T& val) GCC_ATTR_DEPRECATED
00050 : Array<T> (dim_vector (n, 1), val) { }
00051
00052 explicit MArray (const dim_vector& dv)
00053 : Array<T> (dv) { }
00054
00055 explicit MArray (const dim_vector& dv, const T& val)
00056 : Array<T> (dv, val) { }
00057
00058 MArray (const MArray<T>& a) : Array<T> (a) { }
00059
00060 template <class U>
00061 MArray (const Array<U>& a) : Array<T> (a) { }
00062
00063 ~MArray (void) { }
00064
00065 MArray<T>& operator = (const MArray<T>& a)
00066 {
00067 Array<T>::operator = (a);
00068 return *this;
00069 }
00070
00071 MArray<T> reshape (const dim_vector& new_dims) const
00072 { return Array<T>::reshape (new_dims); }
00073
00074 MArray<T> permute (const Array<octave_idx_type>& vec,
00075 bool inv = false) const
00076 { return Array<T>::permute (vec, inv); }
00077
00078 MArray<T> ipermute (const Array<octave_idx_type>& vec) const
00079 { return Array<T>::ipermute (vec); }
00080
00081 MArray squeeze (void) const { return Array<T>::squeeze (); }
00082
00083 MArray<T> transpose (void) const
00084 { return Array<T>::transpose (); }
00085
00086 MArray<T> hermitian (T (*fcn) (const T&) = 0) const
00087 { return Array<T>::hermitian (fcn); }
00088
00089
00090
00091 void idx_add (const idx_vector& idx, T val);
00092
00093 void idx_add (const idx_vector& idx, const MArray<T>& vals);
00094
00095 void idx_min (const idx_vector& idx, const MArray<T>& vals);
00096
00097 void idx_max (const idx_vector& idx, const MArray<T>& vals);
00098
00099 void idx_add_nd (const idx_vector& idx, const MArray<T>& vals, int dim = -1);
00100
00101 void changesign (void);
00102 };
00103
00104 #endif