Go to the documentation of this file.
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/Array.h>
39 template<
class T>
class Vector;
94 template<
class T>
class Matrix :
public Array<T>
101 Matrix(
size_t l1,
size_t l2);
104 Matrix(
size_t l1,
size_t l2, ArrayInitPolicy initPolicy);
108 Matrix(
size_t l1,
size_t l2,
const T &initialValue);
111 Matrix(
const IPosition &len);
114 Matrix(
const IPosition &len, ArrayInitPolicy initPolicy);
118 Matrix(
const IPosition &len,
const T &initialValue);
121 Matrix(
const Matrix<T> &other);
125 Matrix(
const Array<T> &other);
140 static Matrix<T>
identity (
size_t n);
144 virtual void assign (
const Array<T>& other);
148 virtual void reference(
const Array<T> &other);
192 #if defined(AIPS_ARRAY_INDEX_CHECK)
193 this->validateIndex(i1, i2);
195 return this->contiguous_p ? this->begin_p[i1 + i2*
yinc_p] :
201 #if defined(AIPS_ARRAY_INDEX_CHECK)
202 this->validateIndex(i1, i2);
204 return this->contiguous_p ? this->begin_p[i1 + i2*
yinc_p] :
296 {
return this->length_p; }
298 { s1 = this->length_p(0); s2=this->length_p(1); }
302 {
return this->length_p(0); }
306 {
return this->length_p(1); }
336 #ifndef CASACORE_NO_AUTO_TEMPLATES
337 #include <casacore/casa/Arrays/Matrix.tcc>
338 #endif //# CASACORE_NO_AUTO_TEMPLATES
Array< T > & operator=(const T &val)
Copy val into every element of this Matrix; i.e.
Specify which elements to extract from an n-dimensional array.
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
A 2-D Specialization of the Array class.
A Vector of integers, for indexing into Array<T> objects.
size_t xinc_p
Cached constants to improve indexing.
Array< T > operator()(const IPosition &blc, const IPosition &trc)
Vector< T > diagonal(Int64 n=0)
Returns a diagonal from the Matrix.
virtual void reference(const Array< T > &other)
Make this matrix a reference to other.
T & operator()(const IPosition &i)
Single-pixel addressing.
StorageInitPolicy
A global enum used by some Array constructors.
T & operator()(size_t i1, size_t i2)
virtual void resize()
Make this array a different shape.
Vector< T > column(size_t j)
Returns a reference to the j'th column.
void resize(size_t nx, size_t ny, Bool copyValues=False)
static Matrix< T > identity(size_t n)
Create an identity matrix of side length n.
A global enum used by some Array/Block constructors.
void shape(Int &s1, Int &s2) const
virtual void preTakeStorage(const IPosition &shape)
virtual void postTakeStorage()
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 2) to this matrix.
T & operator()(const IPosition &)
Access a single element of the array.
Vector< T > row(size_t i)
Returns a reference to the i'th row.
@ COPY
COPY is used when an internal copy of the storage is to be made.
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
define a (start,length,increment) along an axis
this file contains all the compiler specific defines
virtual ~Matrix()
Define a destructor, otherwise the (SUN) compiler makes a static one.
const Array< T > operator()(const Slicer &slicer) const
Matrix()
A Matrix of length zero in each dimension; zero origin.
Class for masking an Array for operations on that Array.
size_t nrow() const
The number of rows in the Matrix, i.e.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
const T & operator()(const IPosition &i) const
virtual Bool ok() const
Checks that the Matrix is consistent (invariants check out).
template <class T, class U> class vector;
Matrix< T > & operator=(const Matrix< T > &other)
Copy the values from other to this Matrix.
bool Bool
Define the standard types used by Casacore.
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
const T & operator()(size_t i1, size_t i2) const
const IPosition & shape() const
The length of each axis of the Matrix.
A 1-D Specialization of the Array class.
Array< T > operator()(const Slicer &slicer)
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Remove the degenerate axes from other and store result in this matrix.
void makeIndexingConstants()
Helper fn to calculate the indexing constants.
size_t ncolumn() const
The number of columns in the Matrix, i.e.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const