CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
cla3p::dns::CxMatrix< T_Scalar > Class Template Reference

The dense complex matrix class. More...

Inheritance diagram for cla3p::dns::CxMatrix< T_Scalar >:

Constructors

 CxMatrix ()
 Default constructor.
 CxMatrix (int_t nr, int_t nc, const Property &pr=Property::General())
 Dimension constructor.
 CxMatrix (int_t nr, int_t nc, T_Scalar *vals, int_t ldv, bool bind, const Property &pr=Property::General())
 Auxiliary constructor.
 CxMatrix (const CxMatrix< T_Scalar > &other)=default
 Copy constructor.
 CxMatrix (CxMatrix< T_Scalar > &&other)=default
 Move constructor.
 ~CxMatrix ()
 Destructor.

Operators

CxMatrix< T_Scalar > & operator= (const CxMatrix< T_Scalar > &other)=default
 Copy assignment operator.
CxMatrix< T_Scalar > & operator= (CxMatrix< T_Scalar > &&other)=default
 Move assignment operator.
void operator= (T_Scalar val)
 Fill operator.

Public Member Functions

alias::VirtualStrided_dns< T_RScalar > real ()
 Accesses the real part of the complex matrix.
alias::VirtualStrided_dns< T_RScalar > imag ()
 Accesses the imaginary part of the complex matrix.
alias::GuardedStrided_dns< T_RScalar > real () const
 Accesses the real part of the complex matrix (const).
alias::GuardedStrided_dns< T_RScalar > imag () const
 Accesses the imaginary part of the complex matrix (const).

Additional Inherited Members

 XxMatrix ()
 Default constructor.
 XxMatrix (int_t nr, int_t nc, const Property &pr=Property::General())
 Dimension constructor.
 XxMatrix (int_t nr, int_t nc, T_Scalar *vals, int_t ldv, bool bind, const Property &pr=Property::General())
 Auxiliary constructor.
 XxMatrix (const XxMatrix< T_Scalar > &other)
 Copy constructor.
 XxMatrix (XxMatrix< T_Scalar > &&other)
 Move constructor.
 ~XxMatrix ()
 Destructor.
XxMatrix< T_Scalar > & operator= (const XxMatrix< T_Scalar > &other)
 Copy assignment operator.
XxMatrix< T_Scalar > & operator= (XxMatrix< T_Scalar > &&other)
 Move assignment operator.
T_Scalar & operator() (int_t i, int_t j)
 Element access operator.
const T_Scalar & operator() (int_t i, int_t j) const
 Element access operator.
alias::VirtualScal_dns< T_Scalar > operator- () const
 Unary negation operator.
void operator= (T_Scalar val)
 Fill operator.
int_t ld () const
 Get the leading dimension.
void clear ()
 Clear the matrix.
void fill (T_Scalar val)
 Fill all elements with a value.
XxMatrix< T_Scalar > copy () const
 Create a deep copy of the matrix.
XxMatrix< T_Scalar > rcopy ()
 Create a reference copy (shallow copy) of the matrix.
Guard< XxMatrix< T_Scalar > > rcopy () const
 Create a guarded reference copy (shallow copy) of the matrix.
XxMatrix< T_Scalar > move ()
 Move the matrix's resources.
alias::VirtualStrided_vec< T_Scalar > diag ()
 Access the diagonal of the matrix.
alias::GuardedStrided_vec< T_Scalar > diag () const
 Access the diagonal of the matrix (const).
std::string info (const std::string &header="") const
 Get information about the matrix.
void print (std::streamsize prec=0) const
 Print the matrix to standard output.
void toStream (std::ostream &os, std::streamsize prec=0) const
 Output the matrix to a stream.
void iscale (T_Scalar val)
 Scale the matrix in-place.
alias::VirtualTrans_dns< T_Scalar > transpose () const
 Transpose the matrix.
alias::VirtualTrans_dns< T_Scalar > ctranspose () const
 Conjugate transpose the matrix.
alias::VirtualConj_dns< T_Scalar > conjugate () const
 Compute the complex conjugate.
void iconjugate ()
 Conjugate the matrix in-place.
T_RScalar normOne () const
 Compute the 1-norm.
T_RScalar normInf () const
 Compute the infinity norm.
T_RScalar normMax () const
 Compute the maximum norm.
T_RScalar normFro () const
 Compute the Frobenius norm.
XxMatrix< T_Scalar > general () const
 Convert to general matrix.
void igeneral ()
 Convert to general matrix in-place.
XxMatrix< T_Scalar > permuteLeftRight (const prm::PxMatrix< int_t > &P, const prm::PxMatrix< int_t > &Q) const
 Permute rows and columns.
void permuteLeftRight (const prm::PxMatrix< int_t > &P, const prm::PxMatrix< int_t > &Q, XxMatrix< T_Scalar > &dest) const
 Permute rows and columns into a destination.
XxMatrix< T_Scalar > permuteLeft (const prm::PxMatrix< int_t > &P) const
 Permute rows.
void permuteLeft (const prm::PxMatrix< int_t > &P, XxMatrix< T_Scalar > &dest) const
 Permute rows into a destination.
XxMatrix< T_Scalar > permuteRight (const prm::PxMatrix< int_t > &Q) const
 Permute columns.
void permuteRight (const prm::PxMatrix< int_t > &Q, XxMatrix< T_Scalar > &dest) const
 Permute columns into a destination.
XxMatrix< T_Scalar > permuteMirror (const prm::PxMatrix< int_t > &P) const
 Permute rows and columns symmetrically.
void permuteMirror (const prm::PxMatrix< int_t > &P, XxMatrix< T_Scalar > &dest) const
 Permute rows and columns symmetrically into a destination.
XxMatrix< T_Scalar > block (int_t ibgn, int_t jbgn, int_t ni, int_t nj) const
 Extract a block as a new matrix.
XxMatrix< T_Scalar > rblock (int_t ibgn, int_t jbgn, int_t ni, int_t nj)
 Extract a reference block.
Guard< XxMatrix< T_Scalar > > rblock (int_t ibgn, int_t jbgn, int_t ni, int_t nj) const
 Extract a guarded reference block.
void setBlock (int_t ibgn, int_t jbgn, const XxMatrix< T_Scalar > &src)
 Set a block of elements.
XxVector< T_Scalar > column (int_t j) const
 Extract a column as a new vector.
XxVector< T_Scalar > rcolumn (int_t j)
 Extract a column as a reference.
Guard< XxVector< T_Scalar > > rcolumn (int_t j) const
 Extract a column as a guarded reference.
XxMatrix< T_Scalar > row (int_t i) const
 Extract a row as a new matrix.
XxMatrix< T_Scalar > rrow (int_t i)
 Extract a row as a reference.
Guard< XxMatrix< T_Scalar > > rrow (int_t i) const
 Extract a row as a guarded reference.
VirtualRowvec< T_Scalar > rrowvec (int_t i) const
 Extract a row as a virtual row vector.
Public Member Functions inherited from cla3p::MatrixMeta< int_t >
const Propertyprop () const
 Matrix property accessor.
Public Member Functions inherited from cla3p::Meta2D< int_t >
virtual int_t nrows () const
 Number of rows.
virtual int_t ncols () const
 Number of columns.
bool empty () const
 Tests whether the object has zero dimensions.
 operator bool () const
 Boolean conversion operator.
Public Member Functions inherited from cla3p::dns::XxContainerBase< T_Scalar >
T_Scalar * values ()
 Access the data buffer.
const T_Scalar * values () const
 Access the data buffer.
Public Member Functions inherited from cla3p::Ownership
 Ownership ()
 Default constructor.
 Ownership (bool owner)
 Ownership constructor.
 ~Ownership ()
 Destructor.
bool owner () const
 Tests memory ownership.
void unbind ()
 Relinquishes memory ownership.
static XxMatrix< T_Scalar > random (int_t nr, int_t nc, const Property &pr=Property::General(), T_RScalar lo=T_RScalar(0), T_RScalar hi=T_RScalar(1))
 Create a random matrix.
static Guard< XxMatrix< T_Scalar > > view (int_t nr, int_t nc, const T_Scalar *vals, int_t ldv, const Property &pr=Property::General())
 Create a view of existing memory.

Detailed Description

template<typename T_Scalar>
class cla3p::dns::CxMatrix< T_Scalar >

The dense complex matrix class.

Represents a dense complex-valued matrix stored in column-major format.

Template Parameters
T_ScalarThe complex scalar type (e.g., std::complex<float>, std::complex<double>).

Constructor & Destructor Documentation

◆ CxMatrix() [1/5]

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::CxMatrix ( )

Default constructor.

Creates an empty complex matrix with no allocated memory.

◆ CxMatrix() [2/5]

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::CxMatrix ( int_t nr,
int_t nc,
const Property & pr = Property::General() )
explicit

Dimension constructor.

Creates a complex matrix of the specified dimensions and allocates memory.

Parameters
[in]nrThe number of rows.
[in]ncThe number of columns.
[in]prThe matrix property (default: General).

◆ CxMatrix() [3/5]

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::CxMatrix ( int_t nr,
int_t nc,
T_Scalar * vals,
int_t ldv,
bool bind,
const Property & pr = Property::General() )
explicit

Auxiliary constructor.

Creates a complex matrix using existing memory.

Parameters
[in]nrThe number of rows.
[in]ncThe number of columns.
[in]valsPointer to existing memory.
[in]ldvThe leading dimension.
[in]bindIf true, the matrix takes ownership of the memory.
[in]prThe matrix property (default: General).

◆ CxMatrix() [4/5]

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::CxMatrix ( const CxMatrix< T_Scalar > & other)
default

Copy constructor.

Creates a new complex matrix by copying another complex matrix.

Parameters
[in]otherThe complex matrix to copy.

◆ CxMatrix() [5/5]

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::CxMatrix ( CxMatrix< T_Scalar > && other)
default

Move constructor.

Creates a new complex matrix by moving resources from another complex matrix.

Parameters
[in]otherThe complex matrix to move from.

◆ ~CxMatrix()

template<typename T_Scalar>
cla3p::dns::CxMatrix< T_Scalar >::~CxMatrix ( )

Destructor.

Destroys the complex matrix and releases allocated memory.

Member Function Documentation

◆ operator=() [1/3]

template<typename T_Scalar>
CxMatrix< T_Scalar > & cla3p::dns::CxMatrix< T_Scalar >::operator= ( const CxMatrix< T_Scalar > & other)
default

Copy assignment operator.

Copies the contents of another complex matrix to this complex matrix.

Parameters
[in]otherThe complex matrix to copy.
Returns
Reference to this complex matrix.

◆ operator=() [2/3]

template<typename T_Scalar>
CxMatrix< T_Scalar > & cla3p::dns::CxMatrix< T_Scalar >::operator= ( CxMatrix< T_Scalar > && other)
default

Move assignment operator.

Moves resources from another complex matrix to this complex matrix.

Parameters
[in]otherThe complex matrix to move from.
Returns
Reference to this complex matrix.

◆ operator=() [3/3]

template<typename T_Scalar>
void cla3p::dns::CxMatrix< T_Scalar >::operator= ( T_Scalar val)

Fill operator.

Fills all elements with the specified complex value.

Parameters
[in]valThe complex scalar value to fill with.

◆ real() [1/2]

template<typename T_Scalar>
alias::VirtualStrided_dns< T_RScalar > cla3p::dns::CxMatrix< T_Scalar >::real ( )

Accesses the real part of the complex matrix.

Returns a strided view of the real components that can be used for both reading and writing.

Returns
A virtual strided view of the real part.

◆ imag() [1/2]

template<typename T_Scalar>
alias::VirtualStrided_dns< T_RScalar > cla3p::dns::CxMatrix< T_Scalar >::imag ( )

Accesses the imaginary part of the complex matrix.

Returns a strided view of the imaginary components that can be used for both reading and writing.

Returns
A virtual strided view of the imaginary part.

◆ real() [2/2]

template<typename T_Scalar>
alias::GuardedStrided_dns< T_RScalar > cla3p::dns::CxMatrix< T_Scalar >::real ( ) const

Accesses the real part of the complex matrix (const).

Returns a read-only strided view of the real components.

Returns
A guarded strided view of the real part.

◆ imag() [2/2]

template<typename T_Scalar>
alias::GuardedStrided_dns< T_RScalar > cla3p::dns::CxMatrix< T_Scalar >::imag ( ) const

Accesses the imaginary part of the complex matrix (const).

Returns a read-only strided view of the imaginary components.

Returns
A guarded strided view of the imaginary part.