cuLite v0.3.1
A lite CUDA C++ Interface
Loading...
Searching...
No Matches
culite::dns::CxMatrix< T_Scalar > Class Template Reference

The device dense complex matrix class. More...

Inheritance diagram for culite::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

XxMatrix< T_RScalar > real () const
 Extract the real part.
XxMatrix< T_RScalar > imag () const
 Extract the imaginary part.

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.
void operator= (T_Scalar val)
 Fill operator.
alias::VirtualScal_dns< T_Scalar > operator- () const
 Unary negation operator.
int_t ld () const
 Get the leading dimension.
void clear ()
 Clear the device matrix.
void fill (T_Scalar val)
 Fill all elements with a value.
XxMatrix< T_Scalar > copy () const
 Create a deep copy of the device matrix.
XxMatrix< T_Scalar > rcopy ()
 Create a reference copy (shallow copy) of the device matrix.
Guard< XxMatrix< T_Scalar > > rcopy () const
 Create a guarded reference copy (shallow copy) of the device matrix.
XxMatrix< T_Scalar > move ()
 Move the device matrix's resources.
std::string info (const std::string &header="") const
 Get information about the device matrix.
void iscale (T_Scalar val)
 Scale the device matrix in-place.
alias::VirtualTrans_dns< T_Scalar > transpose () const
 Transpose the device matrix.
alias::VirtualTrans_dns< T_Scalar > ctranspose () const
 Conjugate transpose the device matrix.
alias::VirtualConj_dns< T_Scalar > conjugate () const
 Compute the complex conjugate.
void iconjugate ()
 Conjugate the device 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 > block (int_t ibgn, int_t jbgn, int_t ni, int_t nj) const
 Extract a block as a new device 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 device 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 device 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.
void copyToHost (::cla3p::dns::XxMatrix< T_Cla3pScalar > &dest) const
 Copies the device matrix to a host matrix.
void copyFromHost (const ::cla3p::dns::XxMatrix< T_Cla3pScalar > &src)
 Copies a host matrix to the device 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 device memory.

Detailed Description

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

The device dense complex matrix class.

Represents a complex-valued dense matrix stored on the GPU device 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>
culite::dns::CxMatrix< T_Scalar >::CxMatrix ( )

Default constructor.

Creates an empty device complex matrix with no allocated device memory.

◆ CxMatrix() [2/5]

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

Dimension constructor.

Creates a device complex matrix of the specified dimensions and allocates device 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>
culite::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 device complex matrix using existing device memory.

Parameters
[in]nrThe number of rows.
[in]ncThe number of columns.
[in]valsPointer to existing device 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>
culite::dns::CxMatrix< T_Scalar >::CxMatrix ( const CxMatrix< T_Scalar > & other)
default

Copy constructor.

Creates a new device complex matrix by copying another device complex matrix.

Parameters
[in]otherThe device complex matrix to copy.

◆ CxMatrix() [5/5]

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

Move constructor.

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

Parameters
[in]otherThe device complex matrix to move from.

◆ ~CxMatrix()

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

Destructor.

Destroys the device complex matrix and releases allocated device memory.

Member Function Documentation

◆ operator=() [1/3]

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

Copy assignment operator.

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

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

◆ operator=() [2/3]

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

Move assignment operator.

Moves resources from another device complex matrix to this device complex matrix.

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

◆ operator=() [3/3]

template<typename T_Scalar>
void culite::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()

template<typename T_Scalar>
XxMatrix< T_RScalar > culite::dns::CxMatrix< T_Scalar >::real ( ) const

Extract the real part.

Creates a new device matrix containing the real parts of all complex elements.

Returns
A device matrix containing the real components.

◆ imag()

template<typename T_Scalar>
XxMatrix< T_RScalar > culite::dns::CxMatrix< T_Scalar >::imag ( ) const

Extract the imaginary part.

Creates a new device matrix containing the imaginary parts of all complex elements.

Returns
A device matrix containing the imaginary components.