Public Member Functions
fmatvec::SquareMatrix< AT > Class Template Reference

This is a matrix class of general quadratic matrices. More...

#include <square_matrix.h>

Inheritance diagram for fmatvec::SquareMatrix< AT >:
fmatvec::Matrix< General, AT >

List of all members.

Public Member Functions

 SquareMatrix ()
 Standard constructor.
 SquareMatrix (int m)
 Regular Constructor.
 SquareMatrix (int m, int n)
 Regular Constructor.
 SquareMatrix (int m, AT *ele)
 Regular Constructor.
 SquareMatrix (int m, Initialization ini, const AT &a=0)
 Regular Constructor.
 SquareMatrix (int m, int n, Initialization ini, const AT &a=0)
 Regular Constructor.
SquareMatrix< AT > & resize (int n)
 Matrix resizing.
SquareMatrix< AT > & resize (int n, Initialization ini, const AT &a=0)
 Matrix resizing.
 SquareMatrix (const SquareMatrix< AT > &A)
 Copy Constructor.
 SquareMatrix (const Matrix< General, AT > &A)
 Copy Constructor.
SquareMatrix< AT > & operator= (const SquareMatrix< AT > &A)
 Assignment operator.
SquareMatrix< AT > & operator<< (const SquareMatrix< AT > &A)
 Copy operator.
template<class T >
SquareMatrix< AT > & operator<< (const Matrix< T, AT > &A)
 Copy operator.
SquareMatrix< AT > & operator>> (const SquareMatrix< AT > &A)
 Reference operator.
int size () const
 Size.
SquareMatrix< AT > copy () const
 Matrix duplicating.
 operator std::vector< std::vector< AT > > ()
 Cast to std::vector<std::vector<AT> >.
SquareMatrix< AT > T ()
const SquareMatrix< AT > T () const
- Public Member Functions inherited from fmatvec::Matrix< General, AT >
 Matrix ()
 Standard constructor.
 Matrix (int m_, int n_)
 Regular Constructor.
 Matrix (int m_, int n_, Initialization ini, const AT &a=0)
 Regular Constructor.
 Matrix (const Matrix< General, AT > &A)
 Copy Constructor.
 Matrix (int m_, int n_, AT *ele_)
 Regular Constructor.
 Matrix (const char *str)
 String Constructor.
 ~Matrix ()
 Destructor.
Matrix< General, AT > & resize (int m_, int n_)
 Matrix resizing.
Matrix< General, AT > & resize (int m_, int n_, Initialization ini, const AT &a=0)
 Matrix resizing.
Matrix< General, AT > & operator= (const Matrix< General, AT > &A)
 Assignment operator.
Matrix< General, AT > & operator>> (const Matrix< General, AT > &A)
 Reference operator.
AT & operator() (int i, int j)
 Element operator.
const AT & operator() (int i, int j) const
 Element operator.
AT * operator() ()
 Pointer operator.
const AT * operator() () const
 Pointer operator.
int rows () const
 Number of rows.
int cols () const
 Number of columns.
int ldim () const
 Leading dimension.
bool transposed () const
 Transposed status.
const CBLAS_TRANSPOSE blasTrans () const
 Transposed status.
const CBLAS_ORDER blasOrder () const
 Storage convention.
Matrix< General, AT > operator() (int i1, int j1, int i2, int j2)
 Submatrix operator.
const Matrix< General, AT > operator() (int i1, int j1, int i2, int j2) const
 Submatrix operator.
Matrix< General, AT > operator() (const Index &I, const Index &J)
 Submatrix operator.
const Matrix< General, AT > operator() (const Index &I, const Index &J) const
 Submatrix operator.
SquareMatrix< AT > operator() (const Index &I)
 Submatrix operator.
const SquareMatrix< AT > operator() (const Index &I) const
 Submatrix operator.
Vector< AT > col (int i)
 Column operator.
const Vector< AT > col (int i) const
 Column operator.
RowVector< AT > row (int i)
 Row operator.
const RowVector< AT > row (int i) const
 Row operator.
Matrix< General, AT > & resize ()
 Matrix unsizing.
Matrix< General, AT > & init (const AT &a)
 Initialization.
 Matrix (std::vector< std::vector< AT > > m)
 std::vector<std::vector<AT> > Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT> > object. An assert checks for constant length of each row.
template<class Type >
Matrix< General, AT > & operator<< (const Matrix< Type, AT > &A)

Detailed Description

template<class AT>
class fmatvec::SquareMatrix< AT >

This is a matrix class of general quadratic matrices.

Template class SquareMatrix with shape type General and atomic type AT. The storage form is dense. The template parameter AT defines the atomic type of the vector. Valid types are int, float, double, complex<float> and complex<double>


Constructor & Destructor Documentation

template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( )
inline

Standard constructor.

Constructs a squarematrix with no size.

template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( int  m)
inline

Regular Constructor.

Constructs a matrix of size m x m.

Parameters:
mThe number of rows and columns.
Remarks:
The matrix will be initialised to zero by default. This default behavior can be changed by defining FMATVEC_NO_INITIALIZATION.
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( int  m,
int  n 
)
inline

Regular Constructor.

Constructs a matrix of size m x n, where m must be equal to n.

Parameters:
mThe number of rows and columns.
nThe number of rows and columns.
Remarks:
The matrix will be initialised to zero by default. This default behavior can be changed by defining FMATVEC_NO_INITIALIZATION.
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( int  m,
AT *  ele 
)
inline

Regular Constructor.

Constructs a matrix of size m x m with the pyhsical memory given by ele_;

Parameters:
mThe number of rows and columns.
eleThe physical memory the matrix will point to.
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( int  m,
Initialization  ini,
const AT &  a = 0 
)
inline

Regular Constructor.

Constructs a matrix of size m x m. The matrix will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the matrix will not be initialized.

Parameters:
mThe number of rows and columns.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the matrix will be initialized with (default 0)
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( int  m,
int  n,
Initialization  ini,
const AT &  a = 0 
)
inline

Regular Constructor.

Constructs a matrix of size m x n, where m must be equal to n. The matrix will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the matrix will not be initialized.

Parameters:
mThe number of rows and columns.
nThe number of rows and columns.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the matrix will be initialized with (default 0)
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( const SquareMatrix< AT > &  A)
inline

Copy Constructor.

Constructs a reference to the matrix A.

Attention:
The physical memory of the matrix A will not be copied, only referenced.
Parameters:
AThe matrix that will be referenced.
template<class AT>
fmatvec::SquareMatrix< AT >::SquareMatrix ( const Matrix< General, AT > &  A)
inlineexplicit

Member Function Documentation

template<class AT >
SquareMatrix< AT > fmatvec::SquareMatrix< AT >::copy ( ) const

Matrix duplicating.

The calling matrix returns a deep copy of itself.

Returns:
The duplicate.

Reimplemented from fmatvec::Matrix< General, AT >.

template<class AT >
fmatvec::SquareMatrix< AT >::operator std::vector< std::vector< AT > > ( )

Cast to std::vector<std::vector<AT> >.

Returns:
The std::vector<std::vector<AT> > representation of the matrix

Reimplemented from fmatvec::Matrix< General, AT >.

template<class AT>
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::operator<< ( const SquareMatrix< AT > &  A)
inline

Copy operator.

Copies the matrix given by A.

Parameters:
AThe matrix to be copied.
Returns:
A reference to the calling matrix.

Referenced by fmatvec::SquareMatrix< AT >::operator<<(), and fmatvec::SquareMatrix< AT >::operator=().

template<class AT>
template<class T >
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::operator<< ( const Matrix< T, AT > &  A)
inline

Copy operator.

Copies the matrix given by A.

Parameters:
AThe matrix to be copied.
Returns:
A reference to the calling matrix.

Reimplemented from fmatvec::Matrix< General, AT >.

References fmatvec::SquareMatrix< AT >::operator<<().

template<class AT>
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::operator= ( const SquareMatrix< AT > &  A)
inline

Assignment operator.

Copies the matrix given by A by calling operator<<().

Parameters:
AThe matrix to be assigned.
Returns:
A reference to the calling matrix.
Remarks:
To call operator>>() by default, define FMATVEC_NO_DEEP_ASSIGNMENT
See also:
operator<<(), operator>>()

References fmatvec::SquareMatrix< AT >::operator<<(), and fmatvec::SquareMatrix< AT >::operator>>().

template<class AT>
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::operator>> ( const SquareMatrix< AT > &  A)
inline

Reference operator.

References the matrix given by A.

Parameters:
AThe matrix to be referenced.
Returns:
A reference to the calling matrix.

Referenced by fmatvec::SquareMatrix< AT >::operator=().

template<class AT>
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::resize ( int  n)
inline

Matrix resizing.

Resizes the matrix to size n x n.

Parameters:
nThe number of rows and columns.
Returns:
A reference to the calling matrix.
Remarks:
The matrix will be initialised to zero by default. To change this behavior, define FMATVEC_NO_INITIALIZATION.

References fmatvec::Matrix< General, AT >::resize().

template<class AT>
SquareMatrix<AT>& fmatvec::SquareMatrix< AT >::resize ( int  n,
Initialization  ini,
const AT &  a = 0 
)
inline

Matrix resizing.

Resizes the matrix to size n x n. The matrix will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the matrix will not be initialized.

Parameters:
nThe number of rows and columns.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the matrix will be initialized with (default 0)
Returns:
A reference to the calling matrix.

References fmatvec::Matrix< General, AT >::resize().

template<class AT>
int fmatvec::SquareMatrix< AT >::size ( ) const
inline

Size.

Returns:
The number of rows and columns of the matrix.

Referenced by fmatvec::countElements(), and fmatvec::operator-().


The documentation for this class was generated from the following file: