23 vector< boost::shared_ptr<CORE_Vector<T> > > mMatrix;
55 static inline boost::shared_ptr<CORE_Matrix<T> >
New(
const boost::shared_ptr<
CORE_Matrix<T> >& v ) {
79 if (v!=
null) p->copy(*v);
84 static inline boost::shared_ptr<CORE_Matrix<T> >
New() {
93 static inline boost::shared_ptr<CORE_Matrix<T> >
New(
const int& dim) {
119 inline boost::shared_ptr<CORE_Matrix<T> > getThis() {
120 boost::shared_ptr<CORE_Matrix<T> > p;
126 inline boost::shared_ptr<const CORE_Matrix<T> > getThis()
const {
127 boost::shared_ptr<const CORE_Matrix<T> > p;
140 return *(mMatrix[i].get());
150 return *(mMatrix[i].get());
163 inline void setValue(
const int& i,
const int& j,
const T& v) {
164 (*(mMatrix[i]).
get())[j]=v;
182 int n=mMatrix.size();
183 for(
int i=0;i<n;i++) mMatrix[i]->initValues(v);
191 mMatrix.pusch_back(c);
196 mMatrix.puch_back(v);
204 for (
int i=0;i<n;i++) {
213 if (array!=
null) copy(*array);
224 if (i>=mMatrix.size())
return false;
226 if (vect==
null)
return false;
227 if (vect->
getSize()<=j)
return false;
244 inline const T&
get(
const int& i,
const int& j)
const {
247 return *(mMatrix[i].get())[j];
254 inline T&
get(
const int& i,
const int& j) {
257 return *(mMatrix[i].get())[j];
261 inline int size()
const {
return mMatrix.size();};
264 inline int getSize()
const {
return mMatrix.size();};
267 inline int getSize(
const int& i)
const {
return mMatrix[i]->getSize();};
270 inline int getDimension(
const int& i)
const {
return mMatrix[i]->getSize();};
278 inline const T&
getValue(
const int& i,
const int& j)
const {
return* (mMatrix[i].get())[j];};
285 return *(mMatrix[index].get());
290 return *(mMatrix[index].get());
297 virtual tString toString()
const;
void clear()
clear the array
Definition: CORE_Matrix.h:234
tBoolean set(const int i, const int &j, const T &v)
set the pointer at the index i
Definition: CORE_Matrix.h:223
static boost::shared_ptr< CORE_Matrix< T > > New(const int &dim)
create a shared pointer of vector of size dim
Definition: CORE_Matrix.h:93
this class describes an array
Definition: CORE_Vector.h:18
CORE_Matrix< tComplex > CORE_ComplexMatrix
Definition: CORE_Matrix.h:308
int getSize() const
return the size of the vector
Definition: CORE_Matrix.h:264
void setValue(const int &i, const int &j, const T &v)
set value
Definition: CORE_Matrix.h:163
CORE_Matrix< tShort > CORE_ShortMatrix
Definition: CORE_Matrix.h:310
TYPEDEF_SPTR(CORE_BooleanMatrix)
int size() const
return the size of the vector
Definition: CORE_Matrix.h:261
const CORE_Vector< T > & getVector(const int &index) const
get vector
Definition: CORE_Matrix.h:289
#define tBoolean
Definition: types.h:35
void addValue(const int &i, const T &v)
set value
Definition: CORE_Matrix.h:169
void copy(const CORE_Matrix< Y > *array)
copy
Definition: CORE_Matrix.h:212
this class describes a vector of boost vectors
Definition: CORE_Matrix.h:19
int getSize(const int &i) const
return the size of the vector
Definition: CORE_Matrix.h:267
#define null
Definition: types.h:13
static boost::shared_ptr< CORE_Matrix< T > > New(const CORE_Matrix< T > *v)
create a shared pointer of vector which is a copy of vector v
Definition: CORE_Matrix.h:75
static boost::shared_ptr< CORE_Matrix< T > > New(const CORE_Matrix< T > &v)
create a shared pointer of vector which is a copy of vector v
Definition: CORE_Matrix.h:65
void add(boost::shared_ptr< CORE_Vector< T > >v)
init the value to v
Definition: CORE_Matrix.h:195
CORE_Matrix< tCharacter > CORE_CharacterMatrix
Definition: CORE_Matrix.h:305
int getDimension() const
return the dimension of the vector
Definition: CORE_Matrix.h:273
CORE_Matrix< tReal > CORE_RealMatrix
Definition: CORE_Matrix.h:307
int getDimension(const int &i) const
return the size of the vector
Definition: CORE_Matrix.h:270
static boost::shared_ptr< CORE_Matrix< T > > New()
create a shared pointer of vector
Definition: CORE_Matrix.h:84
CORE_Matrix< tString > CORE_StringMatrix
Definition: CORE_Matrix.h:311
void getSharedPointer(boost::shared_ptr< const CORE_Matrix< T > > &p) const
get the shared pointer into P
Definition: CORE_Matrix.h:111
const CORE_Vector< T > & operator[](const int &i) const
get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mMatrix.size()));
Definition: CORE_Matrix.h:137
CORE_Vector< T > & operator[](const int &i)
get the i-th element ASSERT_IN(i>-1); ASSERT_IN(i<((int)mMatrix.size()));
Definition: CORE_Matrix.h:147
CORE_Vector< T > & getVector(const int &index)
get vector
Definition: CORE_Matrix.h:284
void copy(const boost::shared_ptr< CORE_Matrix< T > > &array)
copy
Definition: CORE_Matrix.h:218
void getSharedPointer(SP::CORE_Object &p)
get the shared pointer of this class into p
Definition: CORE_Object.h:65
void getSharedPointer(boost::shared_ptr< CORE_Matrix< T > > &p)
get the shared pointer into P
Definition: CORE_Matrix.h:104
static boost::shared_ptr< CORE_Matrix< T > > New(const boost::shared_ptr< CORE_Matrix< T > > &v)
create a shared pointer of vector which is a copy of vector v
Definition: CORE_Matrix.h:55
void copy(const CORE_Matrix< Y > &cmat)
copy
Definition: CORE_Matrix.h:201
int getSize() const
return the size of the vector
Definition: CORE_Vector.h:387
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
static boost::shared_ptr< CORE_Vector< T > > New()
create a shared pointer of vector
Definition: CORE_Vector.h:84
const T & get(int i) const
get the pointer at index i ASSERT_IN(i>-1); ASSERT_IN(i<((int)mVector.size()));
Definition: CORE_Vector.h:367
CORE_Matrix< tBoolean > CORE_BooleanMatrix
Definition: CORE_Matrix.h:304
void setSize(const int &n)
set the size of the array
Definition: CORE_Matrix.h:175
void add(const boost::shared_ptr< const CORE_Vector< T > > v)
init the value to v
Definition: CORE_Matrix.h:189
CORE_Matrix< tInteger > CORE_IntegerMatrix
Definition: CORE_Matrix.h:312
CORE_Matrix< tRelativeInteger > CORE_RelativeIntegerMatrix
Definition: CORE_Matrix.h:313
CORE_Matrix< tFlag > CORE_FlagMatrix
Definition: CORE_Matrix.h:309
CORE_Matrix< int > CORE_IntMatrix
Definition: CORE_Matrix.h:306
void initValues(const T &v)
init the value to v
Definition: CORE_Matrix.h:181
const T & getValue(const int &i, const int &j) const
get value
Definition: CORE_Matrix.h:278
void setVector(const int &i, boost::shared_ptr< CORE_Vector< T > > v)
set value
Definition: CORE_Matrix.h:157
#define ASSERT_IN(a)
Definition: types.h:82
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106