CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
cla3p::lra::XxMatrix< T_Matrix > Class Template Reference

The dense real matrix class. More...

Inheritance diagram for cla3p::lra::XxMatrix< T_Matrix >:

Constructors

 XxMatrix ()
 Default constructor.
 XxMatrix (int_t nr, int_t nc, int_t k)
 Dimension constructor.
 XxMatrix (const XxMatrix< T_Matrix > &other)
 Copy constructor.
 XxMatrix (XxMatrix< T_Matrix > &&other)
 Move constructor.
 ~XxMatrix ()
 Destructor.

Operators

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

Arguments

int_t nrows () const override
 The matrix rows.
int_t ncols () const override
 The matrix columns.
int_t nrank () const
 The matrix rank.
const T_Matrix & A () const
 The left matrix of the low-rank product.
T_Matrix & A ()
 The left matrix of the low-rank product.
const T_Matrix & B () const
 The right matrix of the low-rank product.
T_Matrix & B ()
 The right matrix of the low-rank product.

Public Member Functions

void clear ()
 Clear the low-rank matrix.
void fill (T_Scalar val)
 Fill all elements with a value.
void iscale (T_Scalar val)
 Scale the low-rank matrix in-place.
std::string info (const std::string &header="") const
 Get information about the low-rank matrix.

Additional Inherited Members

Public Member Functions inherited from cla3p::Meta2D< int_t >
bool empty () const
 Tests whether the object has zero dimensions.
 operator bool () const
 Boolean conversion operator.

Detailed Description

template<typename T_Matrix>
class cla3p::lra::XxMatrix< T_Matrix >

The dense real matrix class.

Represents a low-rank approximation matrix in factored form \( A \cdot B^* \).

Template Parameters
T_MatrixThe underlying matrix type (e.g., dns::XxMatrix<T_Scalar>).
Examples
ex09a_lowrank_matrix_create.cpp.

Constructor & Destructor Documentation

◆ XxMatrix() [1/4]

template<typename T_Matrix>
cla3p::lra::XxMatrix< T_Matrix >::XxMatrix ( )

Default constructor.

Creates an empty low-rank matrix with no allocated memory.

◆ XxMatrix() [2/4]

template<typename T_Matrix>
cla3p::lra::XxMatrix< T_Matrix >::XxMatrix ( int_t nr,
int_t nc,
int_t k )
explicit

Dimension constructor.

Constructs a (nr x nc) low-rank matrix with rank k and uninitialized values.

Parameters
[in]nrThe number of matrix rows.
[in]ncThe number of matrix columns.
[in]kThe low matrix rank.

◆ XxMatrix() [3/4]

template<typename T_Matrix>
cla3p::lra::XxMatrix< T_Matrix >::XxMatrix ( const XxMatrix< T_Matrix > & other)

Copy constructor.

Creates a new low-rank matrix by copying another low-rank matrix.

Parameters
[in]otherThe low-rank matrix to copy.

◆ XxMatrix() [4/4]

template<typename T_Matrix>
cla3p::lra::XxMatrix< T_Matrix >::XxMatrix ( XxMatrix< T_Matrix > && other)

Move constructor.

Creates a new low-rank matrix by moving resources from another low-rank matrix.

Parameters
[in]otherThe low-rank matrix to move from.

◆ ~XxMatrix()

template<typename T_Matrix>
cla3p::lra::XxMatrix< T_Matrix >::~XxMatrix ( )

Destructor.

Destroys the low-rank matrix and releases allocated memory.

Member Function Documentation

◆ operator=() [1/3]

template<typename T_Matrix>
XxMatrix< T_Matrix > & cla3p::lra::XxMatrix< T_Matrix >::operator= ( const XxMatrix< T_Matrix > & other)

Copy assignment operator.

Copies the contents of another low-rank matrix to this low-rank matrix.

Parameters
[in]otherThe low-rank matrix to copy.
Returns
Reference to this low-rank matrix.

◆ operator=() [2/3]

template<typename T_Matrix>
XxMatrix< T_Matrix > & cla3p::lra::XxMatrix< T_Matrix >::operator= ( XxMatrix< T_Matrix > && other)

Move assignment operator.

Moves resources from another low-rank matrix to this low-rank matrix.

Parameters
[in]otherThe low-rank matrix to move from.
Returns
Reference to this low-rank matrix.

◆ operator=() [3/3]

template<typename T_Matrix>
void cla3p::lra::XxMatrix< T_Matrix >::operator= ( T_Scalar val)

Fill operator.

Fills all elements in both matrices A and B with the specified value.

Parameters
[in]valThe scalar value to fill with.

◆ nrows()

template<typename T_Matrix>
int_t cla3p::lra::XxMatrix< T_Matrix >::nrows ( ) const
overridevirtual

The matrix rows.

Returns the number of rows in the low-rank matrix.

Returns
The number of rows in (*this) i.e. number of rows in (*this).A().

Reimplemented from cla3p::Meta2D< int_t >.

◆ ncols()

template<typename T_Matrix>
int_t cla3p::lra::XxMatrix< T_Matrix >::ncols ( ) const
overridevirtual

The matrix columns.

Returns the number of columns in the low-rank matrix.

Returns
The number of columns in (*this) i.e. number of rows in (*this).B().

Reimplemented from cla3p::Meta2D< int_t >.

◆ nrank()

template<typename T_Matrix>
int_t cla3p::lra::XxMatrix< T_Matrix >::nrank ( ) const

The matrix rank.

Returns the rank of the low-rank approximation.

Returns
The matrix rank i.e. number of columns in (*this).A() and (*this).B().

◆ A() [1/2]

template<typename T_Matrix>
const T_Matrix & cla3p::lra::XxMatrix< T_Matrix >::A ( ) const

The left matrix of the low-rank product.

Returns a reference to the matrix A of the product \( A \cdot B^* \) that is the low-rank approximation.

Returns
Reference to the left matrix.

◆ A() [2/2]

template<typename T_Matrix>
T_Matrix & cla3p::lra::XxMatrix< T_Matrix >::A ( )

The left matrix of the low-rank product.

Returns a reference to the matrix A of the product \( A \cdot B^* \) that is the low-rank approximation.

Returns
Reference to the left matrix.

◆ B() [1/2]

template<typename T_Matrix>
const T_Matrix & cla3p::lra::XxMatrix< T_Matrix >::B ( ) const

The right matrix of the low-rank product.

Returns a reference to the matrix B of the product \( A \cdot B^* \) that is the low-rank approximation.

Returns
Reference to the right matrix.

◆ B() [2/2]

template<typename T_Matrix>
T_Matrix & cla3p::lra::XxMatrix< T_Matrix >::B ( )

The right matrix of the low-rank product.

Returns a reference to the matrix B of the product \( A \cdot B^* \) that is the low-rank approximation.

Returns
Reference to the right matrix.

◆ clear()

template<typename T_Matrix>
void cla3p::lra::XxMatrix< T_Matrix >::clear ( )

Clear the low-rank matrix.

Releases all memory and resets the matrix to an empty state.

◆ fill()

template<typename T_Matrix>
void cla3p::lra::XxMatrix< T_Matrix >::fill ( T_Scalar val)

Fill all elements with a value.

Sets all elements in both matrices A and B to the specified scalar value.

Parameters
[in]valThe scalar value to fill with.

◆ iscale()

template<typename T_Matrix>
void cla3p::lra::XxMatrix< T_Matrix >::iscale ( T_Scalar val)

Scale the low-rank matrix in-place.

Multiplies all elements of matrix A by a scalar value.

Parameters
[in]valThe scalar value to multiply by.

◆ info()

template<typename T_Matrix>
std::string cla3p::lra::XxMatrix< T_Matrix >::info ( const std::string & header = "") const

Get information about the low-rank matrix.

Returns a string containing information about the matrix's dimensions and rank.

Parameters
[in]headerOptional header string to prepend to the information.
Returns
A string containing matrix information.
Examples
ex09a_lowrank_matrix_create.cpp.