CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
cla3p::Property Class Reference

The property class. More...

Public Member Functions

 Property ()
 Default constructor.
 Property (prop_t ptype, uplo_t ftype)
 Constructs a property with specified type and fill pattern.
 ~Property ()
 Destructor.
 Property (const Property &other)
 Copy constructor.
Propertyoperator= (const Property &other)
 Copy assignment operator.
bool operator== (const Property &other) const
 Equality comparison operator.
bool operator!= (const Property &other) const
 Inequality comparison operator.
void clear ()
 Resets the property to its default state.
prop_t type () const
 Retrieves the property type.
uplo_t uplo () const
 Retrieves the matrix fill pattern.
char cuplo () const
 Retrieves the matrix fill pattern as a character.
void switchUplo ()
 Toggles the matrix fill pattern.
std::string name () const
 Retrieves the property name.
bool isValid () const
 Validates the property type.
bool isSquare () const
 Determines if the property requires a square matrix.
bool isGeneral () const
 Determines if the property type is general.
bool isSymmetric () const
 Determines if the property type is symmetric.
bool isHermitian () const
 Determines if the property type is Hermitian.
bool isTriangular () const
 Determines if the property type is triangular or trapezoidal.
bool isSkew () const
 Determines if the property type is skew-symmetric.
bool isFull () const
 Determines if the entire matrix is utilized.
bool isUpper () const
 Determines if the upper triangular portion is utilized.
bool isLower () const
 Determines if the lower triangular portion is utilized.
Property transpose () const
 Computes the transposed property.

Static Public Member Functions

static Property General ()
 Factory method for general property.
static Property SymmetricUpper ()
 Factory method for upper-triangular symmetric property.
static Property SymmetricLower ()
 Factory method for lower-triangular symmetric property.
static Property HermitianUpper ()
 Factory method for upper-triangular Hermitian property.
static Property HermitianLower ()
 Factory method for lower-triangular Hermitian property.
static Property TriangularUpper ()
 Factory method for upper-triangular property.
static Property TriangularLower ()
 Factory method for lower-triangular property.
static Property SkewUpper ()
 Factory method for upper-triangular skew-symmetric property.
static Property SkewLower ()
 Factory method for lower-triangular skew-symmetric property.

Detailed Description

The property class.

Used to define matrix properties.
Constructing a matrix with property can accelerate certain operations, but at the same time imposes equivalent constraints on others.

#include <iostream>
#include <cla3p/types.hpp>
int main()
{
/*
* Instantiate various properties
*/
cla3p::Property prGe = cla3p::Property::General(); // the default property
cla3p::Property prSy = cla3p::Property::SymmetricLower(); // symmetric lower property
std::cout << "Property G: " << prGe << std::endl;
std::cout << "Property S: " << prSy << std::endl;
std::cout << "Property H: " << prHe << std::endl;
/*
* Instantiate an invalid property
*/
try {
} catch(...) {
std::cout << "Exception thrown for invalid property" << std::endl;
}
return 0;
}
The property class.
Definition property.hpp:42
static Property General()
Factory method for general property.
static Property SymmetricLower()
Factory method for lower-triangular symmetric property.
@ Upper
Definition enums.hpp:56
@ General
Definition enums.hpp:39
@ Hermitian
Definition enums.hpp:41
Examples
ex00_property_create.cpp, ex02c_dense_matrix_create_with_property.cpp, ex02d_dense_matrix_create_from_aux_data.cpp, ex02e_dense_matrix_create_random.cpp, ex05b_solving_linear_systems_ldlt.cpp, ex05c_solving_linear_systems_auto.cpp, ex06c_sparse_matrix_create_with_property.cpp, and ex06d_sparse_matrix_create_from_aux_data.cpp.

Constructor & Destructor Documentation

◆ Property() [1/3]

cla3p::Property::Property ( )

Default constructor.

Constructs an empty property with default values.

◆ Property() [2/3]

cla3p::Property::Property ( prop_t ptype,
uplo_t ftype )
explicit

Constructs a property with specified type and fill pattern.

Constructs a property object with the specified property type and upper/lower fill type.

Parameters
[in]ptypeThe property type (general, symmetric, hermitian, triangular, or skew).
[in]ftypeThe matrix fill pattern (upper, lower, or full).

◆ ~Property()

cla3p::Property::~Property ( )

Destructor.

Destroys the property object.

◆ Property() [3/3]

cla3p::Property::Property ( const Property & other)

Copy constructor.

Creates a new property object by copying another property object.

Parameters
[in]otherThe property object to copy.

Member Function Documentation

◆ operator=()

Property & cla3p::Property::operator= ( const Property & other)

Copy assignment operator.

Copies the contents of another property object to this property object.

Parameters
[in]otherThe property object to copy.
Returns
Reference to this property object.

◆ operator==()

bool cla3p::Property::operator== ( const Property & other) const

Equality comparison operator.

Compares two property objects for equality.

Parameters
[in]otherThe property object to compare against.
Returns
true if both properties have identical type and fill pattern, false otherwise.

◆ operator!=()

bool cla3p::Property::operator!= ( const Property & other) const

Inequality comparison operator.

Compares two property objects for inequality.

Parameters
[in]otherThe property object to compare against.
Returns
true if properties differ in type or fill pattern, false otherwise.

◆ clear()

void cla3p::Property::clear ( )

Resets the property to its default state.

Clears all property settings and returns the object to its initial default configuration.

◆ type()

prop_t cla3p::Property::type ( ) const

Retrieves the property type.

Returns
The property type enumeration value.

◆ uplo()

uplo_t cla3p::Property::uplo ( ) const

Retrieves the matrix fill pattern.

Returns
The upper/lower fill type enumeration value.

◆ cuplo()

char cla3p::Property::cuplo ( ) const

Retrieves the matrix fill pattern as a character.

Returns
The upper/lower fill type represented as a single character.

◆ switchUplo()

void cla3p::Property::switchUplo ( )

Toggles the matrix fill pattern.

Switches between upper and lower fill patterns (upper becomes lower and vice versa). The full fill pattern remains unchanged.

◆ name()

std::string cla3p::Property::name ( ) const

Retrieves the property name.

Returns
A string representation of the property type.

◆ isValid()

bool cla3p::Property::isValid ( ) const

Validates the property type.

Returns
true if the property has a valid type, false otherwise.

◆ isSquare()

bool cla3p::Property::isSquare ( ) const

Determines if the property requires a square matrix.

Returns
true if the property necessitates a square matrix structure, false otherwise.

◆ isGeneral()

bool cla3p::Property::isGeneral ( ) const

Determines if the property type is general.

Returns
true if the property represents a general matrix, false otherwise.

◆ isSymmetric()

bool cla3p::Property::isSymmetric ( ) const

Determines if the property type is symmetric.

Returns
true if the property represents a symmetric matrix, false otherwise.

◆ isHermitian()

bool cla3p::Property::isHermitian ( ) const

Determines if the property type is Hermitian.

Returns
true if the property represents a Hermitian matrix, false otherwise.

◆ isTriangular()

bool cla3p::Property::isTriangular ( ) const

Determines if the property type is triangular or trapezoidal.

Returns
true if the property represents a triangular or trapezoidal matrix, false otherwise.

◆ isSkew()

bool cla3p::Property::isSkew ( ) const

Determines if the property type is skew-symmetric.

Returns
true if the property represents a skew-symmetric matrix, false otherwise.

◆ isFull()

bool cla3p::Property::isFull ( ) const

Determines if the entire matrix is utilized.

Returns
true if both upper and lower matrix parts are used, false otherwise.

◆ isUpper()

bool cla3p::Property::isUpper ( ) const

Determines if the upper triangular portion is utilized.

Returns
true if the upper part of the matrix is used, false otherwise.

◆ isLower()

bool cla3p::Property::isLower ( ) const

Determines if the lower triangular portion is utilized.

Returns
true if the lower part of the matrix is used, false otherwise.

◆ transpose()

Property cla3p::Property::transpose ( ) const

Computes the transposed property.

Determines the property of the transposed (or conjugate-transposed) matrix.
This operation is applicable to general and triangular matrix types.

Returns
The property corresponding to the transposed matrix.

◆ General()

Property cla3p::Property::General ( )
static

Factory method for general property.

Creates a property object representing a general matrix with no special structure.

Returns
A Property object configured for general matrices.
Examples
ex00_property_create.cpp, ex02c_dense_matrix_create_with_property.cpp, and ex06c_sparse_matrix_create_with_property.cpp.

◆ SymmetricUpper()

Property cla3p::Property::SymmetricUpper ( )
static

Factory method for upper-triangular symmetric property.

Creates a property object representing a symmetric matrix where the upper triangular part is stored and utilized.

Returns
A Property object configured for symmetric matrices with upper storage.
Examples
ex07b_solving_sparse_linear_systems_llt.cpp, ex07c_solving_sparse_linear_systems_ldlt.cpp, and ex07e_solving_sparse_linear_systems_auto.cpp.

◆ SymmetricLower()

Property cla3p::Property::SymmetricLower ( )
static

Factory method for lower-triangular symmetric property.

Creates a property object representing a symmetric matrix where the lower triangular part is stored and utilized.

Returns
A Property object configured for symmetric matrices with lower storage.
Examples
ex00_property_create.cpp, ex02c_dense_matrix_create_with_property.cpp, ex02d_dense_matrix_create_from_aux_data.cpp, ex02e_dense_matrix_create_random.cpp, ex03g_permutation_matrix_permute_matrix_symmetric.cpp, ex05b_solving_linear_systems_ldlt.cpp, ex05c_solving_linear_systems_auto.cpp, ex06c_sparse_matrix_create_with_property.cpp, ex06d_sparse_matrix_create_from_aux_data.cpp, and ex10b_syev_decomposition.cpp.

◆ HermitianUpper()

Property cla3p::Property::HermitianUpper ( )
static

Factory method for upper-triangular Hermitian property.

Creates a property object representing a Hermitian matrix where the upper triangular part is stored and utilized.

Returns
A Property object configured for Hermitian matrices with upper storage.
Examples
ex02c_dense_matrix_create_with_property.cpp, and ex06c_sparse_matrix_create_with_property.cpp.

◆ HermitianLower()

Property cla3p::Property::HermitianLower ( )
static

Factory method for lower-triangular Hermitian property.

Creates a property object representing a Hermitian matrix where the lower triangular part is stored and utilized.

Returns
A Property object configured for Hermitian matrices with lower storage.

◆ TriangularUpper()

Property cla3p::Property::TriangularUpper ( )
static

Factory method for upper-triangular property.

Creates a property object representing an upper triangular or trapezoidal matrix.

Returns
A Property object configured for upper triangular matrices.

◆ TriangularLower()

Property cla3p::Property::TriangularLower ( )
static

Factory method for lower-triangular property.

Creates a property object representing a lower triangular or trapezoidal matrix.

Returns
A Property object configured for lower triangular matrices.

◆ SkewUpper()

Property cla3p::Property::SkewUpper ( )
static

Factory method for upper-triangular skew-symmetric property.

Creates a property object representing a skew-symmetric matrix where the upper triangular part is stored and utilized.

Returns
A Property object configured for skew-symmetric matrices with upper storage.

◆ SkewLower()

Property cla3p::Property::SkewLower ( )
static

Factory method for lower-triangular skew-symmetric property.

Creates a property object representing a skew-symmetric matrix where the lower triangular part is stored and utilized.

Returns
A Property object configured for skew-symmetric matrices with lower storage.