monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
Namespaces | Macros | Functions
monolish_common.hpp File Reference
#include "monolish_dense.hpp"
#include "monolish_logger.hpp"
#include "monolish_matrix.hpp"
#include "monolish_vector.hpp"
#include "monolish_view1D.hpp"
#include <initializer_list>

Go to the source code of this file.

Namespaces

 monolish
 
 monolish::util
 monolish utilities
 

Macros

#define MONOLISH_SOLVER_BREAKDOWN   -3
 
#define MONOLISH_SOLVER_MAXITER   -2
 
#define MONOLISH_SOLVER_NOT_IMPL   -10
 
#define MONOLISH_SOLVER_RESIDUAL_NAN   -4
 
#define MONOLISH_SOLVER_SIZE_ERROR   -1
 
#define MONOLISH_SOLVER_SUCCESS   0
 

Functions

template<typename T >
matrix::COO< T > monolish::util::band_matrix (const int M, const int N, const int W, const T diag_val, const T val)
 create band matrix More...
 
bool monolish::util::build_with_avx ()
 get build option (true: with avx, false: without avx) More...
 
bool monolish::util::build_with_avx2 ()
 get build option (true: with avx2, false: without avx2) More...
 
bool monolish::util::build_with_avx512 ()
 get build option (true: with avx512, false: without avx512) More...
 
bool monolish::util::build_with_cblas ()
 get build option (true: with cblas, false: without cblas (=with intel mkl)) More...
 
bool monolish::util::build_with_gpu ()
 get build option (true: enable gpu, false: disable gpu) More...
 
bool monolish::util::build_with_lapack ()
 get build option (true: with lapack, false: without lapack (=with intel mkl)) More...
 
bool monolish::util::build_with_mkl ()
 get build option (true: with intel mkl, false: without intel mkl) More...
 
template<typename T >
auto monolish::util::device_free (T &x)
 free data of GPU More...
 
template<typename T , typename... Types>
auto monolish::util::device_free (T &x, Types &... args)
 free datas of GPU More...
 
template<typename T >
matrix::COO< T > monolish::util::eye (const int M)
 create band matrix More...
 
template<typename T >
matrix::COO< T > monolish::util::frank_matrix (const int &M)
 create Frank matrix More...
 
template<typename T >
monolish::util::frank_matrix_eigenvalue (const int &M, const int &N)
 Nth eigenvalue from the bottom of MxM Frank matrix. More...
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const vector< double > &x, const vector< double > &y)
 get nrm |b-Ax|_2 More...
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const vector< double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const vector< double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< matrix::Dense< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< vector< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< vector< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::CRS< double > &A, const view1D< vector< double >, double > &x, const view1D< vector< double >, double > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const vector< float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const vector< float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const vector< float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< matrix::Dense< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< vector< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< vector< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::CRS< float > &A, const view1D< vector< float >, float > &x, const view1D< vector< float >, float > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const vector< double > &x, const vector< double > &y)
 get nrm |b-Ax|_2 More...
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const vector< double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const vector< double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< matrix::Dense< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< vector< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< vector< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::Dense< double > &A, const view1D< vector< double >, double > &x, const view1D< vector< double >, double > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const vector< float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const vector< float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const vector< float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< matrix::Dense< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< vector< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< vector< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::Dense< float > &A, const view1D< vector< float >, float > &x, const view1D< vector< float >, float > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const vector< double > &x, const vector< double > &y)
 get nrm |b-Ax|_2 More...
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const vector< double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const vector< double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< matrix::Dense< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< matrix::Dense< double >, double > &x, const view1D< vector< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< vector< double >, double > &x, const vector< double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< vector< double >, double > &x, const view1D< matrix::Dense< double >, double > &y)
 
double monolish::util::get_residual_l2 (const matrix::LinearOperator< double > &A, const view1D< vector< double >, double > &x, const view1D< vector< double >, double > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const vector< float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const vector< float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const vector< float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< matrix::Dense< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< matrix::Dense< float >, float > &x, const view1D< vector< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< vector< float >, float > &x, const vector< float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< vector< float >, float > &x, const view1D< matrix::Dense< float >, float > &y)
 
float monolish::util::get_residual_l2 (const matrix::LinearOperator< float > &A, const view1D< vector< float >, float > &x, const view1D< vector< float >, float > &y)
 
template<typename T , typename U >
bool monolish::util::is_same_device_mem_stat (const T &arg1, const U &arg2)
 compare same device memory status More...
 
template<typename T , typename U , typename... types>
bool monolish::util::is_same_device_mem_stat (const T &arg1, const U &arg2, const types &... args)
 compare same device memory status More...
 
template<typename T >
bool monolish::util::is_same_size (const matrix::COO< T > &A, const matrix::COO< T > &B)
 compare row and col size More...
 
template<typename T >
bool monolish::util::is_same_size (const matrix::CRS< T > &A, const matrix::CRS< T > &B)
 compare row and col size More...
 
template<typename T >
bool monolish::util::is_same_size (const matrix::Dense< T > &A, const matrix::Dense< T > &B)
 compare row and col size More...
 
template<typename T >
bool monolish::util::is_same_size (const matrix::LinearOperator< T > &A, const matrix::LinearOperator< T > &B)
 compare row and col size More...
 
template<typename T , typename U , typename... types>
bool monolish::util::is_same_size (const T &arg1, const U &arg2, const types &... args)
 compare matrix size More...
 
template<typename T , typename U >
bool monolish::util::is_same_size (const T &x, const U &y)
 compare size of vector or 1Dview (same as is_same_structure()) More...
 
template<typename T >
bool monolish::util::is_same_structure (const matrix::COO< T > &A, const matrix::COO< T > &B)
 compare structure using col_index and row_index, M, and N More...
 
template<typename T >
bool monolish::util::is_same_structure (const matrix::CRS< T > &A, const matrix::CRS< T > &B)
 compare structure using structure_hash, M, and N More...
 
template<typename T >
bool monolish::util::is_same_structure (const matrix::Dense< T > &A, const matrix::Dense< T > &B)
 compare structure using M and N (same as is_same_size()) More...
 
template<typename T >
bool monolish::util::is_same_structure (const matrix::LinearOperator< T > &A, const matrix::LinearOperator< T > &B)
 compare structure using M and N (same as is_same_size()) More...
 
template<typename T , typename... types>
bool monolish::util::is_same_structure (const T &A, const T &B, const types &... args)
 compare matrix structure More...
 
template<typename T , typename U >
bool monolish::util::is_same_structure (const T A, const U B)
 compare matrix structure More...
 
template<typename T >
bool monolish::util::is_same_structure (const vector< T > &x, const vector< T > &y)
 compare structure of vector (same as is_same_size()) More...
 
template<typename T >
matrix::COO< T > monolish::util::laplacian_matrix_1D (const int &M)
 create 1D Laplacian matrix More...
 
template<typename T >
monolish::util::laplacian_matrix_1D_eigenvalue (const int &M, int N)
 Nth smallest eigenvalue of 1D Laplacian matrix. More...
 
template<typename T >
matrix::COO< T > monolish::util::random_structure_matrix (const int M, const int N, const int nnzrow, const T val)
 create random structure matrix (column number is decided by random) More...
 
template<typename T >
void monolish::util::random_vector (vector< T > &vec, const T min, const T max)
 create random vector More...
 
template<typename T >
auto monolish::util::recv (T &x)
 recv. and free data from GPU More...
 
template<typename T , typename... Types>
auto monolish::util::recv (T &x, Types &... args)
 recv. and free datas to GPU More...
 
template<typename T >
auto monolish::util::send (T &x)
 send data to GPU More...
 
template<typename T , typename... Types>
auto monolish::util::send (T &x, Types &... args)
 send datas to GPU More...
 
void monolish::util::set_log_filename (const std::string filename)
 Specifying the log finename. More...
 
void monolish::util::set_log_level (const size_t Level)
 Logger utils ///////////////////////////////. More...
 
bool monolish::util::solver_check (const int err)
 check error More...
 
template<typename T >
matrix::COO< T > monolish::util::toeplitz_plus_hankel_matrix (const int &M, T a0, T a1, T a2)
 create Toeplitz-plus-Hankel matrix More...
 
template<typename T >
monolish::util::toeplitz_plus_hankel_matrix_eigenvalue (const int &M, int N, T a0, T a1, T a2, T b0, T b1, T b2)
 Nth smallest eigenvalue of GEVP Ax=lBx of Toeplitz-plus-Hankel matrixes A, B. More...
 
template<typename T >
matrix::COO< T > monolish::util::tridiagonal_toeplitz_matrix (const int &M, T a, T b)
 create tridiagonal Toeplitz matrix More...
 
template<typename T >
monolish::util::tridiagonal_toeplitz_matrix_eigenvalue (const int &M, int N, T a, T b)
 Nth smallest eigenvalue of MxM tridiagonal Toeplitz matrix. More...
 

Macro Definition Documentation

◆ MONOLISH_SOLVER_BREAKDOWN

#define MONOLISH_SOLVER_BREAKDOWN   -3

Definition at line 13 of file monolish_common.hpp.

◆ MONOLISH_SOLVER_MAXITER

#define MONOLISH_SOLVER_MAXITER   -2

Definition at line 12 of file monolish_common.hpp.

◆ MONOLISH_SOLVER_NOT_IMPL

#define MONOLISH_SOLVER_NOT_IMPL   -10

Definition at line 15 of file monolish_common.hpp.

◆ MONOLISH_SOLVER_RESIDUAL_NAN

#define MONOLISH_SOLVER_RESIDUAL_NAN   -4

Definition at line 14 of file monolish_common.hpp.

◆ MONOLISH_SOLVER_SIZE_ERROR

#define MONOLISH_SOLVER_SIZE_ERROR   -1

Definition at line 11 of file monolish_common.hpp.

◆ MONOLISH_SOLVER_SUCCESS

#define MONOLISH_SOLVER_SUCCESS   0

Definition at line 10 of file monolish_common.hpp.