SMG2S
Sparse Matrix Generator with Given Spectrum
initMat< S > Struct Template Reference

A struct which stores the information for the initial input matrix of SMG2S. More...

#include <initMat.hpp>

Public Member Functions

 initMat ()
 A constructor of struct `initMat`. More...
 
 initMat (S diagl, S diagu)
 A constructor of struct `initMat`. More...
 
 initMat (S diagl, S diagu, double Sparsity)
 A constructor of struct `initMat`. More...
 
 initMat (S diagl, S diagu, double Scale, double Sparsity)
 A constructor of struct `initMat`. More...
 
void show ()
 A member function of struct `initMat` to display all its variables. More...
 

Public Attributes

diag_l
 
diag_u
 
double scale
 
double sparsity
 

Detailed Description

template<typename S>
struct initMat< S >

A struct which stores the information for the initial input matrix of SMG2S.

This struct defines a initial input matrix by the offset of lower diagonal `diag_l` and upper diagonal `diag_u`. The entries between diagonal `diag_l` and `diag_u` of lower-triangular part of initial matrix are set randomly with (0, 1). These entries can be modified by `scale`. The `sparsity` determines the possibility of the entries of initial matrix to be `0`.

Template Parameters
Stype of integer to describes the dimension of matrices to be generated.

Constructor & Destructor Documentation

◆ initMat() [1/4]

template<typename S >
initMat< S >::initMat ( )
inline

A constructor of struct `initMat`.

This is a constructor of struct `initMat`, in which the variables are set with default values: `diag_l=-3`, `diag_u=-2`, `scale=1.0` and `sparsity=0.9`.

◆ initMat() [2/4]

template<typename S >
initMat< S >::initMat ( diagl,
diagu 
)
inline

A constructor of struct `initMat`.

This is a constructor of struct `initMat` with default values `scale=1.0` and `sparsity=0.9`.

Parameters
[in]diaglOffset of lower diagonal
[in]diaguOffset of upper diagonal

◆ initMat() [3/4]

template<typename S >
initMat< S >::initMat ( diagl,
diagu,
double  Sparsity 
)
inline

A constructor of struct `initMat`.

This is a constructor of struct `initMat` with default value `scale=1.0`.

Parameters
[in]diaglOffset of lower diagonal
[in]diaguOffset of upper diagonal
[in]SparsityPossibility of the entries of initial matrix to be `0`

◆ initMat() [4/4]

template<typename S >
initMat< S >::initMat ( diagl,
diagu,
double  Scale,
double  Sparsity 
)
inline

A constructor of struct `initMat`.

This is a constructor of struct `initMat` without any default values.

Parameters
[in]diaglOffset of lower diagonal
[in]diaguOffset of upper diagonal
[in]ScaleNumber can be multiplied on the randomly generated entries of initial matrix
[in]SparsityPossibility of the entries of initial matrix to be `0`

Member Function Documentation

◆ show()

template<typename S >
void initMat< S >::show ( )
inline

A member function of struct `initMat` to display all its variables.

This is a member function of struct `initMat` to display all its variables.

Member Data Documentation

◆ diag_l

template<typename S >
S initMat< S >::diag_l

Offset of lower diagonal

◆ diag_u

template<typename S >
S initMat< S >::diag_u

Offset of upper diagonal

◆ scale

template<typename S >
double initMat< S >::scale

Number can be multiplied on the randomly generated entries of initial matrix

◆ sparsity

template<typename S >
double initMat< S >::sparsity

Possibility of the entries of initial matrix to be `0`


The documentation for this struct was generated from the following file: