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);
153 using Array<T>::resize;
192 #if defined(AIPS_ARRAY_INDEX_CHECK)
201 #if defined(AIPS_ARRAY_INDEX_CHECK)
336 #ifndef CASACORE_NO_AUTO_TEMPLATES
337 #include <casacore/casa/Arrays/Matrix.tcc>
338 #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.
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)
std::vector< double > Vector
Vector< T > column(size_t j)
Returns a reference to the j'th column.
size_t nrow() const
The number of rows in the Matrix, i.e.
const IPosition & shape() const
The length of each axis of the Matrix.
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.
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.
void validateIndex(const IPosition &) const
T & operator()(size_t i1, size_t i2)
virtual void resize()
Make this array a different shape.
void shape(Int &s1, Int &s2) const
define a (start,length,increment) along an axis
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.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
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.
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.
Array< T > operator()(const IPosition &blc, const IPosition &trc)
size_t ncolumn() const
The number of columns in the Matrix, i.e.
const T & operator()(const IPosition &i) const
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.
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.
void resize(size_t nx, size_t ny, Bool copyValues=False)
const Array< T > operator()(const Slicer &slicer) const
COPY is used when an internal copy of the storage is to be made.
StorageInitPolicy
A global enum used by some Array constructors.
Matrix()
A Matrix of length zero in each dimension; zero origin.
const T & operator()(size_t i1, size_t i2) const
T & operator()(const IPosition &i)
Single-pixel addressing.
virtual void postTakeStorage()
size_t xinc_p
Cached constants to improve indexing.
virtual Bool ok() const
Checks that the Matrix is consistent (invariants check out).
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.