29 #ifndef SCIMATH_SQUAREMATRIX_H
30 #define SCIMATH_SQUAREMATRIX_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicSL/Complex.h>
34 #include <casacore/casa/Arrays/Matrix.h>
35 #include <casacore/casa/iosfwd.h>
148 const T*
pa=&a[0][0];
150 for (
Int i=0; i<n*n; i++) *pa_p++=*
pa++;
158 for (
Int i=0; i<n; i++)
a_p[i][i]=vec[i];
320 #ifndef CASACORE_NO_AUTO_TEMPLATES
321 #include <casacore/scimath/Mathematics/SquareMatrix.tcc>
friend SquareMatrix< Complex, 4 > & directProduct(SquareMatrix< Complex, 4 > &result, const SquareMatrix< Complex, 2 > &left, const SquareMatrix< Complex, 2 > &right)
Global friend function to calculate direct product.
SquareMatrix< T, n > & conj()
For a SquareMatrix<Complex,n>: set the argument result to the real part of the matrix (and return res...
SquareMatrix(const Vector< T > &vec)
Construct from Vector, creates a diagonal matrix.
T operator()(Int i, Int j) const
Indexing, only const indexing is allowed.
SquareMatrix< T, n > & conj(SquareMatrix< T, n > &result)
Conjugate the matrix, return it in result (and by ref)
SquareMatrix< T, n > & operator*=(Float f)
Scalar multiplication.
SquareMatrix< T, n > & operator=(const Vector< T > &v)
Assign a Vector, creates a diagonal matrix.
SquareMatrix< T, n > & adjoint()
Tranpose and conjugate the matrix in place(!).
SquareMatrix< T, n > & operator=(const Matrix< T > &m)
Assign a Matrix, creates a general matrix.
T & operator()(Int i, Int j)
Non const indexing, throws exception if you try to change an element which would require a type chang...
SquareMatrix< T, n > & operator+=(const SquareMatrix< T, n > &other)
Add two SquareMatrices, element by element.
Matrix< T > & matrix(Matrix< T > &result) const
Assign 'this' to the Matrix result, also return result by reference.
friend RigidVector< Complex, 4 > operator*(const SquareMatrix< Complex, 4 > &m, const RigidVector< Float, 4 > &v)
friend class SquareMatrix<T,n*n>;// Sun native does not accept this friend class SquareMatrix<Complex...
SquareMatrix< T, n > & inverse(SquareMatrix< T, n > &result) const
Compute the inverse of the matrix and return it in result (also returns result by reference).
SquareMatrix(const T vec[n])
Construct from c-style vector, creates a diagonal matrix.
~SquareMatrix()
Destructor.
SquareMatrix< T, n > inverse() const
Return the inverse of the matrix by value.
SquareMatrix< T, n > & operator=(const T a[n][n])
Assign a c-style matrix, creates a general matrix.
SquareMatrix(const SquareMatrix< T, n > &m)
Copy construct a SquareMatrix, a true copy is made.
SquareMatrix< T, n > & adjoint(SquareMatrix< T, n > &result)
Tranpose and conjugate the matrix, return it in result (and by ref)
SquareMatrix(const T a[n][n])
Construct from c-style matrix (by copying elements).
Matrix< T > matrix() const
Convert the SquareMatrix to a Matrix.
SquareMatrix< T, n > & operator=(const T vec[n])
Assign a c-style vector, creates a diagonal matrix.
SquareMatrix(const Matrix< T > &mat)
Construct from Matrix.
SquareMatrix(const T &scalar)
Construct from scalar, creates a scalar-identity matrix.
SquareMatrix()
Default constructor - creates a unity matrix at present, this may not be what we want (non-intuitive?...
SquareMatrix< T, n > & operator=(const SquareMatrix< T, n > &m)
Assignment, uses copy semantics.
SquareMatrix(int itype)
Create a matrix of a given type, no initialization.
SquareMatrix< T, n > & operator*=(const SquareMatrix< T, n > &other)
Matrix product of 'this' SquareMatrix with other, i.e., A*=B; is equivalent with A=A*B where '*' is m...
SquareMatrix< T, n > & operator=(T val)
Assign a scalar, creates a scalar-identity matrix.
this file contains all the compiler specific defines
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
ostream & operator<<(ostream &os, const SquareMatrix< Complex, 2 > &m)
Write SquareMatrix to output, uses Matrix to do the work.
ostream & operator<<(ostream &os, const SquareMatrix< Complex, 4 > &m)
SquareMatrix< Complex, 4 > conj(const SquareMatrix< Complex, 4 > &m)
Return conjugate of SquareMatrix.
ostream & operator<<(ostream &os, const SquareMatrix< Float, 4 > &m)
SquareMatrix< Complex, 2 > adjoint(const SquareMatrix< Complex, 2 > &m)
Return adjoint of SquareMatrix.
SquareMatrix< Complex, 2 > conj(const SquareMatrix< Complex, 2 > &m)
Return conjugate of SquareMatrix.
ostream & operator<<(ostream &os, const SquareMatrix< Float, 2 > &m)
SquareMatrix< Complex, 4 > adjoint(const SquareMatrix< Complex, 4 > &m)
Return adjoint of SquareMatrix.
SquareMatrix< Complex, 4 > directProduct(const SquareMatrix< Complex, 2 > &left, const SquareMatrix< Complex, 2 > &right)
Calculate direct product of two SquareMatrices.