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);
125 Matrix(
const Array<T> &other);
144 virtual void assign (
const Array<T>& other);
148 virtual void reference(
const Array<T> &other);
192 #if defined(AIPS_ARRAY_INDEX_CHECK) 201 #if defined(AIPS_ARRAY_INDEX_CHECK) 338 #ifndef CASACORE_NO_AUTO_TEMPLATES 339 #include <casacore/casa/Arrays/Matrix.tcc> 340 #endif //# CASACORE_NO_AUTO_TEMPLATES virtual void reference(const Array< T > &other)
Make this matrix a reference to other.
Bool contiguous_p
Are the data contiguous?
A Vector of integers, for indexing into Array<T> objects.
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)
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Vector< T > column(size_t j)
Returns a reference to the j'th column.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
virtual ~Matrix()
Define a destructor, otherwise the (SUN) compiler makes a static one.
StorageInitPolicy
A global enum used by some Array constructors.
A 2-D Specialization of the Array class.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
Vector< T > row(size_t i)
Returns a reference to the i'th row.
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 2) to this matrix.
A global enum used by some Array/Block constructors.
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array...
Class for masking an Array for operations on that Array.
virtual void resize()
Make this array a different shape.
const Array< T > operator()(const Slicer &slicer) const
T & operator()(size_t i1, size_t i2)
virtual void resize()
Make this array a different shape.
define a (start,length,increment) along an axis
size_t ncolumn() const
The number of columns in the Matrix, i.e.
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
Array< T > & operator=(const T &val)
Copy val into every element of this Matrix; i.e.
friend class Matrix< T >
Needed to be a friend for Matrix<T>::reference()
T & operator()(const IPosition &)
Access a single element of the array.
size_t nrow() const
The number of rows in the Matrix, i.e.
const T & operator()(const IPosition &i) const
virtual void preTakeStorage(const IPosition &shape)
pre/post processing hook of takeStorage() for subclasses.
bool Bool
Define the standard types used by Casacore.
Matrix< T > & operator=(const Matrix< T > &other)
Copy the values from other to this Matrix.
virtual Bool ok() const
Checks that the Matrix is consistent (invariants check out).
Array< T > operator()(const IPosition &blc, const IPosition &trc)
Vector< T > diagonal(Int64 n=0)
Returns a diagonal from the Matrix.
T * begin_p
This pointer is adjusted to point to the first element of the array.
template <class T, class U> class vector;
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
Specify which elements to extract from an n-dimensional array.
const T & operator()(size_t i1, size_t i2) const
COPY is used when an internal copy of the storage is to be made.
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Remove the degenerate axes from other and store result in this matrix.
static Matrix< T > identity(size_t n)
Create an identity matrix of side length n.
void makeIndexingConstants()
Helper fn to calculate the indexing constants.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
void resize(size_t nx, size_t ny, Bool copyValues=False)
Matrix()
A Matrix of length zero in each dimension; zero origin.
void validateIndex(const IPosition &) const
void shape(Int &s1, Int &s2) const
this file contains all the compiler specific defines
T & operator()(const IPosition &i)
Single-pixel addressing.
virtual void postTakeStorage()
size_t xinc_p
Cached constants to improve indexing.