monolish
MONOlithic LInear 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 (Dense< Float > &dense)
 
void convert_to_Dense (Dense< Float > &dense) const
 
void device_free () const
 free data on GPU More...
 
void diag (vector< Float > &vec) const
 get diag. vector More...
 
void diag (view1D< matrix::Dense< Float >, Float > &vec) const
 
void diag (view1D< vector< Float >, Float > &vec) const
 
size_t get_col () const
 get # of col More...
 
bool get_device_mem_stat () const
 true: sended, false: not send More...
 
std::function< matrix::Dense< Float >const matrix::Dense< Float > &)> get_matmul_dense () const
 get multiplication function of matrix and matrix dense More...
 
bool get_matmul_dense_init_flag () const
 get flag that shows matmul_dense is defined or not 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< matrix::Dense< Float >const matrix::Dense< Float > &)> get_rmatmul_dense () const
 get multiplication function of (Hermitian) transposed matrix and matrix dense; More...
 
bool get_rmatmul_dense_init_flag () const
 get flag that shows rmatmul_dense 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< Dense< Float >(const Dense< Float > &)> &MATMUL)
 declare LinearOperator More...
 
 LinearOperator (const size_t M, const size_t N, const std::function< Dense< Float >(const Dense< Float > &)> &MATMUL, const std::function< Dense< Float >(const Dense< Float > &)> &RMATMUL)
 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)
 
 LinearOperator (Dense< Float > &dense)
 
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_matmul_dense (const std::function< matrix::Dense< Float >(const matrix::Dense< Float > &)> &MATMUL)
 set multiplication function of matrix and matrix dense More...
 
void set_matvec (const std::function< vector< Float >(const vector< Float > &)> &MATVEC)
 set multiplication function of matrix and vector More...
 
void set_rmatmul_dense (const std::function< matrix::Dense< Float >(const matrix::Dense< Float > &)> &RMATMUL)
 set multiplication function of (Hermitian) transposed matrix and matrix dense 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< Dense< Float >const Dense< Float > &)> matmul_dense = nullptr
 pseudo multiplication function of matrix and dense matrix More...
 
std::function< vector< Float >const vector< Float > &)> matvec = nullptr
 pseudo multiplication function of matrix and vector More...
 
std::function< Dense< Float >const Dense< Float > &)> rmatmul_dense = nullptr
 pseudo multiplication function of (Hermitian) transposed matrix and dense matrix More...
 
std::function< vector< Float >const vector< Float > &)> rmatvec = nullptr
 pseudo multiplication function of (Hermitian) transposed matrix and vector 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/10]

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

Definition at line 70 of file monolish_linearoperator.hpp.

◆ LinearOperator() [2/10]

template<typename Float >
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

◆ LinearOperator() [3/10]

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/10]

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/10]

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

declare LinearOperator

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

◆ LinearOperator() [6/10]

template<typename Float >
monolish::matrix::LinearOperator< Float >::LinearOperator ( const size_t  M,
const size_t  N,
const std::function< Dense< Float >(const Dense< Float > &)> &  MATMUL,
const std::function< Dense< Float >(const Dense< Float > &)> &  RMATMUL 
)

declare LinearOperator

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

◆ LinearOperator() [7/10]

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 162 of file monolish_linearoperator.hpp.

Here is the call graph for this function:

◆ LinearOperator() [8/10]

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

Definition at line 166 of file monolish_linearoperator.hpp.

Here is the call graph for this function:

◆ LinearOperator() [9/10]

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

Definition at line 170 of file monolish_linearoperator.hpp.

Here is the call graph for this function:

◆ LinearOperator() [10/10]

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 400 of file monolish_linearoperator.hpp.

Member Function Documentation

◆ convert() [1/3]

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/3]

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

◆ convert() [3/3]

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

◆ convert_to_Dense()

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

◆ 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 381 of file monolish_linearoperator.hpp.

◆ diag() [1/3]

template<typename Float >
void monolish::matrix::LinearOperator< Float >::diag ( vector< Float > &  vec) const

get diag. vector

Parameters
vecdiag. vector

◆ diag() [2/3]

template<typename Float >
void monolish::matrix::LinearOperator< Float >::diag ( view1D< matrix::Dense< Float >, Float > &  vec) const

◆ diag() [3/3]

template<typename Float >
void monolish::matrix::LinearOperator< Float >::diag ( view1D< vector< Float >, Float > &  vec) const

◆ 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 200 of file monolish_linearoperator.hpp.

◆ 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 387 of file monolish_linearoperator.hpp.

◆ get_matmul_dense()

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

get multiplication function of matrix and matrix dense

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

Definition at line 236 of file monolish_linearoperator.hpp.

◆ get_matmul_dense_init_flag()

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

get flag that shows matmul_dense is defined or not

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

Definition at line 283 of file monolish_linearoperator.hpp.

◆ 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 210 of file monolish_linearoperator.hpp.

◆ 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 261 of file monolish_linearoperator.hpp.

◆ get_rmatmul_dense()

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

get multiplication function of (Hermitian) transposed matrix and matrix dense;

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

Definition at line 250 of file monolish_linearoperator.hpp.

◆ get_rmatmul_dense_init_flag()

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

get flag that shows rmatmul_dense is defined or not

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

Definition at line 294 of file monolish_linearoperator.hpp.

◆ 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 223 of file monolish_linearoperator.hpp.

◆ 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 272 of file monolish_linearoperator.hpp.

◆ 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 191 of file monolish_linearoperator.hpp.

◆ 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 373 of file monolish_linearoperator.hpp.

◆ operator=()

template<typename Float >
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

◆ 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 365 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 357 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 389 of file monolish_linearoperator.hpp.

◆ set_matmul_dense()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::set_matmul_dense ( const std::function< matrix::Dense< Float >(const matrix::Dense< Float > &)> &  MATMUL)

set multiplication function of matrix and matrix dense

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

◆ set_matvec()

template<typename Float >
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

◆ set_rmatmul_dense()

template<typename Float >
void monolish::matrix::LinearOperator< Float >::set_rmatmul_dense ( const std::function< matrix::Dense< Float >(const matrix::Dense< Float > &)> &  RMATMUL)

set multiplication function of (Hermitian) transposed matrix and matrix dense

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

◆ set_rmatvec()

template<typename Float >
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

◆ 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 349 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 45 of file monolish_linearoperator.hpp.

◆ matmul_dense

template<typename Float >
std::function<Dense<Float>const Dense<Float> &)> monolish::matrix::LinearOperator< Float >::matmul_dense = nullptr
private

pseudo multiplication function of matrix and dense matrix

Definition at line 61 of file monolish_linearoperator.hpp.

◆ matvec

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

pseudo multiplication function of matrix and vector

Definition at line 50 of file monolish_linearoperator.hpp.

◆ rmatmul_dense

template<typename Float >
std::function<Dense<Float>const Dense<Float> &)> monolish::matrix::LinearOperator< Float >::rmatmul_dense = nullptr
private

pseudo multiplication function of (Hermitian) transposed matrix and dense matrix

Definition at line 67 of file monolish_linearoperator.hpp.

◆ rmatvec

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

pseudo multiplication function of (Hermitian) transposed matrix and vector

Definition at line 56 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: