monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
Public Member Functions | Private Attributes | List of all members
monolish::matrix::LinearOperator< Float > Class Template Reference

Linear Operator imitating Matrix. More...

#include <monolish_coo.hpp>

Collaboration diagram for monolish::matrix::LinearOperator< Float >:
Collaboration graph

Public Member Functions

void convert (COO< Float > &coo)
 Convert LinearOperator from COO. More...
 
void convert (CRS< Float > &crs)
 
void convert_to_Dense (Dense< Float > &dense) const
 
void device_free () const
 free data on GPU More...
 
size_t get_col () const
 get # of col More...
 
bool get_device_mem_stat () const
 true: sended, false: not send More...
 
std::function< vector< Float >const vector< Float > &)> get_matvec () const
 get multiplication function of matrix and vector More...
 
bool get_matvec_init_flag () const
 get flag that shows matvec is defined or not More...
 
std::function< vector< Float >const vector< Float > &)> get_rmatvec () const
 get multiplication function of (Hermitian) transposed matrix and vector C = A; More...
 
bool get_rmatvec_init_flag () const
 get flag that shows rmatvec is defined or not More...
 
size_t get_row () const
 get # of row More...
 
 LinearOperator ()
 
 LinearOperator (const LinearOperator< Float > &linearoperator)
 Create LinearOperator from LinearOperator. More...
 
 LinearOperator (const size_t M, const size_t N)
 declare LinearOperator More...
 
 LinearOperator (const size_t M, const size_t N, const std::function< vector< Float >(const vector< Float > &)> &MATVEC)
 declare LinearOperator More...
 
 LinearOperator (const size_t M, const size_t N, const std::function< vector< Float >(const vector< Float > &)> &MATVEC, const std::function< vector< Float >(const vector< Float > &)> &RMATVEC)
 declare LinearOperator More...
 
 LinearOperator (COO< Float > &coo)
 Create LinearOperator from COO. More...
 
 LinearOperator (CRS< Float > &crs)
 
void nonfree_recv () const
 recv. data to GPU (w/o free) More...
 
void operator= (const LinearOperator< Float > &mat)
 operator copy More...
 
void recv () const
 recv. data to GPU, and free data on GPU More...
 
void send () const
 send data to GPU More...
 
void set_device_mem_stat (bool status)
 
void set_matvec (const std::function< vector< Float >(const vector< Float > &)> &MATVEC)
 set multiplication function of matrix and vector More...
 
void set_rmatvec (const std::function< vector< Float >(const vector< Float > &)> &RMATVEC)
 set multiplication function of (Hermitian) transposed matrix and vector More...
 
std::string type () const
 get format name "LinearOperator" More...
 
 ~LinearOperator ()
 destructor of LinearOperator, free GPU memory More...
 

Private Attributes

size_t colN
 # of col More...
 
bool gpu_status = false
 true: sended, false: not send More...
 
std::function< vector< Float >const vector< Float > &)> matvec
 pseudo multiplication function of matrix and vector More...
 
bool matvec_init_flag
 flag that shows matvec is defined or not More...
 
std::function< vector< Float >const vector< Float > &)> rmatvec
 pseudo multiplication function of (Hermitian) transposed matrix and vector More...
 
bool rmatvec_init_flag
 flag that shows rmatvec is defined or not More...
 
size_t rowN
 # of row More...
 

Detailed Description

template<typename Float>
class monolish::matrix::LinearOperator< Float >

Linear Operator imitating Matrix.

Note
  • Multi-threading: depends on matvec/rmatvec functions
  • GPU acceleration: depends on matvec/rmatvec functions

Definition at line 30 of file monolish_coo.hpp.

Constructor & Destructor Documentation

◆ LinearOperator() [1/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( )
inline

Definition at line 69 of file monolish_linearoperator.hpp.

◆ LinearOperator() [2/7]

template<typename T >
template monolish::matrix::LinearOperator< Float >::LinearOperator ( const size_t  M,
const size_t  N 
)

declare LinearOperator

Parameters
M# of row
N# of col
Note
  • # of computation: 4
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 17 of file linearoperator_constructor.cpp.

Here is the call graph for this function:

◆ LinearOperator() [3/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( const size_t  M,
const size_t  N,
const std::function< vector< Float >(const vector< Float > &)> &  MATVEC 
)

declare LinearOperator

Parameters
M# of row
N# of col
MATVECmultiplication function of matrix and vector
Note
  • # of computation: 4 + 1 function
  • Multi-threading: false
  • GPU acceleration: false

◆ LinearOperator() [4/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( const size_t  M,
const size_t  N,
const std::function< vector< Float >(const vector< Float > &)> &  MATVEC,
const std::function< vector< Float >(const vector< Float > &)> &  RMATVEC 
)

declare LinearOperator

Parameters
M# of row
N# of col
MATVECmultiplication function of matrix and vector
RMATVECmultiplication function of (Hermitian) transposed matrix and vector
Note
  • # of computation: 4 + 2 functions
  • Multi-threading: false
  • GPU acceleration: false

◆ LinearOperator() [5/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( COO< Float > &  coo)
inline

Create LinearOperator from COO.

Parameters
cooSource COO format matrix
Returns
coo COO format matrix
Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 130 of file monolish_linearoperator.hpp.

Here is the call graph for this function:

◆ LinearOperator() [6/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( CRS< Float > &  crs)
inline

Definition at line 134 of file monolish_linearoperator.hpp.

Here is the call graph for this function:

◆ LinearOperator() [7/7]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( const LinearOperator< Float > &  linearoperator)

Create LinearOperator from LinearOperator.

Parameters
LinearOperatorformat LinearOperator
Note
  • # of computation: 4 + 2 functions
  • Multi-threading: false
  • GPU acceleration: false

◆ ~LinearOperator()

template<typename Float >
monolish::matrix::LinearOperator< Float >::~LinearOperator ( )
inline

destructor of LinearOperator, free GPU memory

Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 286 of file monolish_linearoperator.hpp.

Member Function Documentation

◆ convert() [1/2]

template<typename Float >
void monolish::matrix::LinearOperator< Float >::convert ( COO< Float > &  coo)

Convert LinearOperator from COO.

Parameters
cooCOO format matrix
Note
  • Multi-threading: false
  • GPU acceleration: false
Here is the caller graph for this function:

◆ convert() [2/2]

template<typename Float >
void monolish::matrix::LinearOperator< Float >::convert ( CRS< Float > &  crs)

◆ convert_to_Dense()

template<typename Float >
template void monolish::matrix::LinearOperator< Float >::convert_to_Dense ( Dense< Float > &  dense) const

Definition at line 69 of file convert_linearoperator.cpp.

Here is the call graph for this function:

◆ device_free()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::device_free ( ) const
inline

free data on GPU

Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 267 of file monolish_linearoperator.hpp.

◆ get_col()

template<typename Float >
size_t monolish::matrix::LinearOperator< Float >::get_col ( ) const
inline

get # of col

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 164 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_device_mem_stat()

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::get_device_mem_stat ( ) const
inline

true: sended, false: not send

Returns
gpu status

Definition at line 273 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_matvec()

template<typename Float >
std::function<vector<Float>const vector<Float> &)> monolish::matrix::LinearOperator< Float >::get_matvec ( ) const
inline

get multiplication function of matrix and vector

Note
  • # of computation: 1 function
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 173 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_matvec_init_flag()

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::get_matvec_init_flag ( ) const
inline

get flag that shows matvec is defined or not

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 196 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_rmatvec()

template<typename Float >
std::function<vector<Float>const vector<Float> &)> monolish::matrix::LinearOperator< Float >::get_rmatvec ( ) const
inline

get multiplication function of (Hermitian) transposed matrix and vector C = A;

Note
  • # of computation: 1 function
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 185 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_rmatvec_init_flag()

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::get_rmatvec_init_flag ( ) const
inline

get flag that shows rmatvec is defined or not

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 205 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ get_row()

template<typename Float >
size_t monolish::matrix::LinearOperator< Float >::get_row ( ) const
inline

get # of row

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 155 of file monolish_linearoperator.hpp.

Here is the caller graph for this function:

◆ nonfree_recv()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::nonfree_recv ( ) const
inline

recv. data to GPU (w/o free)

Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 259 of file monolish_linearoperator.hpp.

◆ operator=()

template<typename Float >
template void monolish::matrix::LinearOperator< Float >::operator= ( const LinearOperator< Float > &  mat)

operator copy

Returns
copied LinearOperator
Note
  • # of computation: 4 + 2 functions
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 9 of file copy_linearoperator.cpp.

Here is the call graph for this function:

◆ recv()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::recv ( ) const
inline

recv. data to GPU, and free data on GPU

Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 251 of file monolish_linearoperator.hpp.

◆ send()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::send ( ) const
inline

send data to GPU

Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 243 of file monolish_linearoperator.hpp.

◆ set_device_mem_stat()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::set_device_mem_stat ( bool  status)
inline

Definition at line 275 of file monolish_linearoperator.hpp.

◆ set_matvec()

template<typename Float >
template void monolish::matrix::LinearOperator< Float >::set_matvec ( const std::function< vector< Float >(const vector< Float > &)> &  MATVEC)

set multiplication function of matrix and vector

Note
  • # of computation: 1 + 1 function
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 102 of file linearoperator_constructor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_rmatvec()

template<typename Float >
template void monolish::matrix::LinearOperator< Float >::set_rmatvec ( const std::function< vector< Float >(const vector< Float > &)> &  RMATVEC)

set multiplication function of (Hermitian) transposed matrix and vector

Note
  • # of computation: 1 + 1 function
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 114 of file linearoperator_constructor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

template<typename Float >
std::string monolish::matrix::LinearOperator< Float >::type ( ) const
inline

get format name "LinearOperator"

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 235 of file monolish_linearoperator.hpp.

Member Data Documentation

◆ colN

template<typename Float >
size_t monolish::matrix::LinearOperator< Float >::colN
private

# of col

Definition at line 40 of file monolish_linearoperator.hpp.

◆ gpu_status

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::gpu_status = false
mutableprivate

true: sended, false: not send

Definition at line 55 of file monolish_linearoperator.hpp.

◆ matvec

template<typename Float >
std::function<vector<Float>const vector<Float> &)> monolish::matrix::LinearOperator< Float >::matvec
private

pseudo multiplication function of matrix and vector

Definition at line 60 of file monolish_linearoperator.hpp.

◆ matvec_init_flag

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::matvec_init_flag
private

flag that shows matvec is defined or not

Definition at line 45 of file monolish_linearoperator.hpp.

◆ rmatvec

template<typename Float >
std::function<vector<Float>const vector<Float> &)> monolish::matrix::LinearOperator< Float >::rmatvec
private

pseudo multiplication function of (Hermitian) transposed matrix and vector

Definition at line 66 of file monolish_linearoperator.hpp.

◆ rmatvec_init_flag

template<typename Float >
bool monolish::matrix::LinearOperator< Float >::rmatvec_init_flag
private

flag that shows rmatvec is defined or not

Definition at line 50 of file monolish_linearoperator.hpp.

◆ rowN

template<typename Float >
size_t monolish::matrix::LinearOperator< Float >::rowN
private

# of row

Definition at line 35 of file monolish_linearoperator.hpp.


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