monolish  0.17.3-dev.16
MONOlithic LInear equation Solvers for Highly-parallel architecture
Functions
Generate test data

Generate test data. More...

Functions

template<typename T >
matrix::COO< T > monolish::util::asym_band_matrix (const int M, const int N, const int W, const T diag_val, const T Uval, const T Lval)
 create asymmetric band matrix More...
 
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...
 
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...
 
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::laplacian_matrix_2D_5p (const int M, const int N)
 create two dimensional Laplacian matrix using the five point central difference scheme 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 >
tensor::tensor_COO< T > monolish::util::random_structure_tensor (const size_t K, const size_t M, const size_t N, const size_t L, const size_t nnzrow, const T val)
 create random structure tensor (index is decided by random) More...
 
template<typename T >
tensor::tensor_COO< T > monolish::util::random_structure_tensor (const size_t M, const size_t N, const size_t L, const size_t nnzrow, const T val)
 create random structure tensor (index is decided by random) More...
 
template<typename T >
tensor::tensor_COO< T > monolish::util::random_structure_tensor (const size_t M, const size_t N, const size_t nnzrow, const T val)
 create random structure tensor (index 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 >
void monolish::util::random_vector (vector< T > &vec, const T min, const T max, const std::uint32_t seed)
 create random vector with random seed 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...
 

Detailed Description

Generate test data.

Function Documentation

◆ asym_band_matrix()

template<typename T >
matrix::COO<T> monolish::util::asym_band_matrix ( const int  M,
const int  N,
const int  W,
const T  diag_val,
const T  Uval,
const T  Lval 
)

create asymmetric band matrix

Parameters
M# of Row
N# of col.
Whalf-bandwidth (bandwidth is 2*W+1)
diag_valvalue of diagonal elements
Uvalvalue of upper non-diagonal elements
Lvalvalue of lower non-diagonal elements
Note
  • # of computation: M*W
  • Multi-threading: false
  • GPU acceleration: false

◆ band_matrix()

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

Parameters
M# of Row
N# of col.
Whalf-bandwidth (bandwidth is 2*W+1)
diag_valvalue of diagonal elements
valvalue of non-diagonal elements
Note
  • # of computation: M*W
  • Multi-threading: false
  • GPU acceleration: false

◆ eye()

template<typename T >
matrix::COO<T> monolish::util::eye ( const int  M)

create band matrix

Parameters
M# of Row and col.
Note
  • # of computation: M
  • Multi-threading: false
  • GPU acceleration: false

◆ frank_matrix()

template<typename T >
matrix::COO<T> monolish::util::frank_matrix ( const int &  M)

create Frank matrix

Parameters
M# of row and col
Note
  • # of computation: M^2
  • Multi-threading: false
  • GPU acceleration: false

◆ frank_matrix_eigenvalue()

template<typename T >
T monolish::util::frank_matrix_eigenvalue ( const int &  M,
const int &  N 
)

Nth eigenvalue from the bottom of MxM Frank matrix.

Parameters
Mdimension of Frank matrix
N#-th eigenvalue from the bottom
Note
  • # of computation: O(1)
  • Multi-threading: false
  • GPU acceleration: false

◆ laplacian_matrix_1D()

template<typename T >
matrix::COO<T> monolish::util::laplacian_matrix_1D ( const int &  M)

create 1D Laplacian matrix

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

◆ laplacian_matrix_1D_eigenvalue()

template<typename T >
T monolish::util::laplacian_matrix_1D_eigenvalue ( const int &  M,
int  N 
)

Nth smallest eigenvalue of 1D Laplacian matrix.

Parameters
Mdimension of tridiagonal Toeplitz matrix
N#-th eigenvalue from the bottom
Note
  • # of computation: O(1)
  • Multi-threading: false
  • GPU acceleration: false

◆ laplacian_matrix_2D_5p()

template<typename T >
matrix::COO<T> monolish::util::laplacian_matrix_2D_5p ( const int  M,
const int  N 
)

create two dimensional Laplacian matrix using the five point central difference scheme

Parameters
M# of grid point
N# of grid point
Note
  • # of computation: N*M
  • Multi-threading: false
  • GPU acceleration: false

◆ random_structure_matrix()

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)

Parameters
M# of Row
N# of col.
nnzrownon-zero elements per row
valvalue of elements
Note
  • # of computation: M*nnzrow
  • Multi-threading: false
  • GPU acceleration: false

◆ random_structure_tensor() [1/3]

template<typename T >
tensor::tensor_COO<T> monolish::util::random_structure_tensor ( const size_t  K,
const size_t  M,
const size_t  N,
const size_t  L,
const size_t  nnzrow,
const T  val 
)

create random structure tensor (index is decided by random)

Parameters
M# of shape 1
N# of shape 2
L# of shape 3
nnzrownon-zero elements per row
valvalue of elements
Note
  • # of computation: M*N*nnzrow
  • Multi-threading: false
  • GPU acceleration: false

◆ random_structure_tensor() [2/3]

template<typename T >
tensor::tensor_COO<T> monolish::util::random_structure_tensor ( const size_t  M,
const size_t  N,
const size_t  L,
const size_t  nnzrow,
const T  val 
)

create random structure tensor (index is decided by random)

Parameters
M# of shape 1
N# of shape 2
L# of shape 3
nnzrownon-zero elements per row
valvalue of elements
Note
  • # of computation: M*N*nnzrow
  • Multi-threading: false
  • GPU acceleration: false

◆ random_structure_tensor() [3/3]

template<typename T >
tensor::tensor_COO<T> monolish::util::random_structure_tensor ( const size_t  M,
const size_t  N,
const size_t  nnzrow,
const T  val 
)

create random structure tensor (index is decided by random)

Parameters
M# of shape 1
N# of shape 2
nnzrownon-zero elements per row
valvalue of elements
Note
  • # of computation: M*N*nnzrow
  • Multi-threading: false
  • GPU acceleration: false

◆ random_vector() [1/2]

template<typename T >
void monolish::util::random_vector ( vector< T > &  vec,
const T  min,
const T  max 
)

create random vector

Parameters
vecallocated vector
minmin. of random
maxmin. of random
Note
the ramdom number generator is random generator is mt19937
  • # of computation: N
  • Multi-threading: true
  • GPU acceleration: false

◆ random_vector() [2/2]

template<typename T >
void monolish::util::random_vector ( vector< T > &  vec,
const T  min,
const T  max,
const std::uint32_t  seed 
)

create random vector with random seed

Parameters
vecallocated vector
minmin. of random
maxmin. of random
seedrandom seed
Note
the ramdom number generator is random generator is mt19937
  • # of computation: N
  • Multi-threading: false
  • GPU acceleration: false

◆ toeplitz_plus_hankel_matrix()

template<typename T >
matrix::COO<T> monolish::util::toeplitz_plus_hankel_matrix ( const int &  M,
a0,
a1,
a2 
)

create Toeplitz-plus-Hankel matrix

Parameters
M# of row and col
a0value of diagonal elements
a1value of next-to-diagonal elements
a2value of second-next-to-diagonal elements
Note
  • taken from arxiv:2007.08130
  • (0, 0) and (M-1, M-1) elements are modified to a0-a2
  • both A and B of the GEVP have same structure
  • Multi-threading: false
  • GPU acceleration: false

◆ toeplitz_plus_hankel_matrix_eigenvalue()

template<typename T >
T monolish::util::toeplitz_plus_hankel_matrix_eigenvalue ( const int &  M,
int  N,
a0,
a1,
a2,
b0,
b1,
b2 
)

Nth smallest eigenvalue of GEVP Ax=lBx of Toeplitz-plus-Hankel matrixes A, B.

Parameters
Mdimension of Toeplitz-plus-Hankel marices
N#-th eigenvalue from the bottom
a0,a1,a2value of Toeplitz-plus-Hankel matrix A
b0,b1,b2value of TOeplitz-plus-Hankel matrix B
Note
  • # of computation: O(1)
  • Multi-threading: false
  • GPU acceleration: false

◆ tridiagonal_toeplitz_matrix()

template<typename T >
matrix::COO<T> monolish::util::tridiagonal_toeplitz_matrix ( const int &  M,
a,
b 
)

create tridiagonal Toeplitz matrix

Parameters
M# of row and col
avalue of diagonal elements
bvalue of next-to-diagonal elements
Note
  • # of computation: M
  • Multi-threading: false
  • GPU acceleration: false

◆ tridiagonal_toeplitz_matrix_eigenvalue()

template<typename T >
T monolish::util::tridiagonal_toeplitz_matrix_eigenvalue ( const int &  M,
int  N,
a,
b 
)

Nth smallest eigenvalue of MxM tridiagonal Toeplitz matrix.

Parameters
Mdimension of tridiagonal Toeplitz matrix
N#-th eigenvalue from the bottom
avalue of diagonal elements
bvalue of next-to-diagonal elements
Note
  • # of computation: O(1)
  • Multi-threading: false
  • GPU acceleration: false