imate
C++/CUDA Reference
Loading...
Searching...
No Matches
cLinearOperatorBase Class Referenceabstract

Base class for cLinearOperator and cuLinearOperator . This class is not templated so that both cpp and cu classed can be derived from it without conflict of data types. More...

#include <c_linear_operator_base.h>

Inheritance diagram for cLinearOperatorBase:

Public Member Functions

 cLinearOperatorBase ()
 Default constructor.
 
 cLinearOperatorBase (const LongIndexType num_rows_, const LongIndexType num_columns_)
 Constructor with setting num_rows and num_columns.
 
virtual ~cLinearOperatorBase ()
 Destructor.
 
LongIndexType get_num_rows () const
 Returns the number of rows of the matrix.
 
LongIndexType get_num_columns () const
 Returns the number of columns of the matrix.
 
IndexType get_num_parameters () const
 Returns the number of parameters of the linear operator.
 
FlagType is_eigenvalue_relation_known () const
 Returns a flag that determines whether a relation between the parameters of the operator and its eigenvalue(s) is known.
 
virtual void set_symmetry (FlagType symmetric)=0
 

Protected Attributes

const LongIndexType num_rows
 
const LongIndexType num_columns
 
FlagType eigenvalue_relation_known
 
IndexType num_parameters
 

Detailed Description

Base class for cLinearOperator and cuLinearOperator . This class is not templated so that both cpp and cu classed can be derived from it without conflict of data types.

The prefix c in this class's name (and its derivatves), stands for the cpp code, intrast to the cu prefix, which stands for the cuda code. Most derived classes have a cuda counterpart.

See also
cLinearOperator, cuLinearOperator

Definition at line 39 of file c_linear_operator_base.h.

Constructor & Destructor Documentation

◆ cLinearOperatorBase() [1/2]

cLinearOperatorBase::cLinearOperatorBase ( )

Default constructor.

Definition at line 27 of file c_linear_operator_base.cpp.

27 :
28 num_rows(0),
29 num_columns(0),
32{
33}
const LongIndexType num_rows
const LongIndexType num_columns

◆ cLinearOperatorBase() [2/2]

cLinearOperatorBase::cLinearOperatorBase ( const LongIndexType  num_rows_,
const LongIndexType  num_columns_ 
)

Constructor with setting num_rows and num_columns.

Note
For the classed that are virtually derived (virtual inheritance) from this class, this constructor will never be called. Rather, the default constructor is called by the most derived class. Thus, set the member data directly instead of below.
Parameters
[in]num_rows_Number of rows of A
[in]num_columns_Number of columns of A

Definition at line 53 of file c_linear_operator_base.cpp.

55 :
56
57 // Initializer list
58 num_rows(num_rows_),
59 num_columns(num_columns_),
62{
63}

◆ ~cLinearOperatorBase()

cLinearOperatorBase::~cLinearOperatorBase ( )
virtual

Destructor.

Definition at line 73 of file c_linear_operator_base.cpp.

74{
75}

Member Function Documentation

◆ get_num_columns()

LongIndexType cLinearOperatorBase::get_num_columns ( ) const

Returns the number of columns of the matrix.

Returns
Number of matrix columns

Definition at line 100 of file c_linear_operator_base.cpp.

101{
102 return this->num_columns;
103}

References num_columns.

◆ get_num_parameters()

IndexType cLinearOperatorBase::get_num_parameters ( ) const

Returns the number of parameters of the linear operator.

For the subclass cMatrix, this value is zero. For the subclass cAffineMatrixFunction, this value is a non-zero integer.

Returns
Number of nonzero elements

Definition at line 117 of file c_linear_operator_base.cpp.

118{
119 return this->num_parameters;
120}

References num_parameters.

Referenced by cTraceEstimator< DataType >::_c_stochastic_lanczos_quadrature(), and cuTraceEstimator< DataType >::_cu_stochastic_lanczos_quadrature().

Here is the caller graph for this function:

◆ get_num_rows()

LongIndexType cLinearOperatorBase::get_num_rows ( ) const

Returns the number of rows of the matrix.

Returns
Number of matrix rows

Definition at line 86 of file c_linear_operator_base.cpp.

87{
88 return this->num_rows;
89}

References num_rows.

Referenced by cTraceEstimator< DataType >::_c_stochastic_lanczos_quadrature(), cuTraceEstimator< DataType >::_cu_stochastic_lanczos_quadrature(), cTraceEstimator< DataType >::c_trace_estimator(), and cuTraceEstimator< DataType >::cu_trace_estimator().

Here is the caller graph for this function:

◆ is_eigenvalue_relation_known()

FlagType cLinearOperatorBase::is_eigenvalue_relation_known ( ) const

Returns a flag that determines whether a relation between the parameters of the operator and its eigenvalue(s) is known.

Returns
If the relation between parameters and eigenvalue of the operator is known, returns 1, otherwise returns 0.

Definition at line 133 of file c_linear_operator_base.cpp.

134{
135 return this->eigenvalue_relation_known;
136}

References eigenvalue_relation_known.

Referenced by cTraceEstimator< DataType >::_c_stochastic_lanczos_quadrature(), and cuTraceEstimator< DataType >::_cu_stochastic_lanczos_quadrature().

Here is the caller graph for this function:

◆ set_symmetry()

Member Data Documentation

◆ eigenvalue_relation_known

◆ num_columns

const LongIndexType cLinearOperatorBase::num_columns
protected

Definition at line 63 of file c_linear_operator_base.h.

Referenced by get_num_columns().

◆ num_parameters

◆ num_rows

const LongIndexType cLinearOperatorBase::num_rows
protected

Definition at line 62 of file c_linear_operator_base.h.

Referenced by get_num_rows().


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