imate
C++/CUDA Reference
cLinearOperator< DataType > Class Template Referenceabstract

Base class for linear operators. This class serves as interface for all derived classes. More...

#include <c_linear_operator.h>

Inheritance diagram for cLinearOperator< DataType >:

Public Member Functions

 cLinearOperator ()
 Default constructor. More...
 
 cLinearOperator (const LongIndexType num_rows_, const LongIndexType num_columns_)
 Constructor with setting num_rows and num_columns. More...
 
virtual ~cLinearOperator ()
 
LongIndexType get_num_rows () const
 
LongIndexType get_num_columns () const
 
void set_parameters (DataType *parameters_)
 Sets the scalar parameter this->parameters. Parameter is initialized to NULL. However, before calling dot or transpose_dot functions, the parameters must be set. More...
 
IndexType get_num_parameters () const
 
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. More...
 
virtual DataType get_eigenvalue (const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const =0
 
virtual void dot (const DataType *vector, DataType *product)=0
 
virtual void transpose_dot (const DataType *vector, DataType *product)=0
 

Protected Attributes

const LongIndexType num_rows
 
const LongIndexType num_columns
 
FlagType eigenvalue_relation_known
 
DataType * parameters
 
IndexType num_parameters
 

Detailed Description

template<typename DataType>
class cLinearOperator< DataType >

Base class for linear operators. This class serves as interface for all derived classes.

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
cMatrix, cAffineMatrixFunction, cuLinearOperator

Definition at line 40 of file c_linear_operator.h.

Constructor & Destructor Documentation

◆ cLinearOperator() [1/2]

template<typename DataType >
cLinearOperator< DataType >::cLinearOperator

Default constructor.

Definition at line 28 of file c_linear_operator.cpp.

28  :
29  num_rows(0),
30  num_columns(0),
32  parameters(NULL),
34 {
35 }
DataType * parameters
const LongIndexType num_rows
IndexType num_parameters
FlagType eigenvalue_relation_known
const LongIndexType num_columns

◆ cLinearOperator() [2/2]

template<typename DataType >
cLinearOperator< DataType >::cLinearOperator ( 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.

Definition at line 50 of file c_linear_operator.cpp.

52  :
53 
54  // Initializer list
55  num_rows(num_rows_),
56  num_columns(num_columns_),
58  parameters(NULL),
60 {
61 }

◆ ~cLinearOperator()

template<typename DataType >
cLinearOperator< DataType >::~cLinearOperator
virtual

Definition at line 69 of file c_linear_operator.cpp.

70 {
71 }

Member Function Documentation

◆ dot()

◆ get_eigenvalue()

template<typename DataType >
virtual DataType cLinearOperator< DataType >::get_eigenvalue ( const DataType *  known_parameters,
const DataType  known_eigenvalue,
const DataType *  inquiry_parameters 
) const
pure virtual

◆ get_num_columns()

template<typename DataType >
LongIndexType cLinearOperator< DataType >::get_num_columns

Definition at line 90 of file c_linear_operator.cpp.

91 {
92  return this->num_columns;
93 }

◆ get_num_parameters()

template<typename DataType >
IndexType cLinearOperator< DataType >::get_num_parameters

Definition at line 119 of file c_linear_operator.cpp.

120 {
121  return this->num_parameters;
122 }

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()

template<typename DataType >
LongIndexType cLinearOperator< DataType >::get_num_rows

◆ is_eigenvalue_relation_known()

template<typename DataType >
FlagType cLinearOperator< DataType >::is_eigenvalue_relation_known

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 136 of file c_linear_operator.cpp.

137 {
138  return this->eigenvalue_relation_known;
139 }

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

Here is the caller graph for this function:

◆ set_parameters()

template<typename DataType >
void cLinearOperator< DataType >::set_parameters ( DataType *  parameters_)

Sets the scalar parameter this->parameters. Parameter is initialized to NULL. However, before calling dot or transpose_dot functions, the parameters must be set.

Parameters
[in]parameters_A pointer to the scalar or array of parameters.

Definition at line 108 of file c_linear_operator.cpp.

109 {
110  this->parameters = parameters_;
111 }

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

Here is the caller graph for this function:

◆ transpose_dot()

Member Data Documentation

◆ eigenvalue_relation_known

◆ num_columns

template<typename DataType >
const LongIndexType cLinearOperator< DataType >::num_columns
protected

Definition at line 76 of file c_linear_operator.h.

◆ num_parameters

template<typename DataType >
IndexType cLinearOperator< DataType >::num_parameters
protected

◆ num_rows

template<typename DataType >
const LongIndexType cLinearOperator< DataType >::num_rows
protected

Definition at line 75 of file c_linear_operator.h.

◆ parameters

template<typename DataType >
DataType* cLinearOperator< DataType >::parameters
protected

Definition at line 78 of file c_linear_operator.h.


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