BiCGSTAB_solver Class Reference

#include <BiCGSTAB_solver.h>

Public Member Functions

 BiCGSTAB_solver ()
 
 ~BiCGSTAB_solver ()
 
int init (int N, scalar tol, int max_num_iterations)
 
int solve (SparseMatrixUnknownPattern *A, scalar *x, scalar *b)
 
int solve (SparseMatrixUnknownPattern *A, scalar *x, scalar *b, int num_iterations)
 

Private Member Functions

void get_residual_vector (scalar *r, scalar *b, SparseMatrixUnknownPattern *A, scalar *x, int N)
 
void copy_vector (scalar *a, scalar *b, int N)
 
scalar dot (scalar *a, scalar *b, int N)
 
void apply_diagonal_matrix (scalar *y, scalar *M, scalar *x, int N)
 
void zero (scalar *x, int N)
 
void scalar_vector_add (scalar *x, scalar *y, scalar c, scalar *z, int N)
 
void complicated_machine (scalar *w, scalar *x, scalar a, scalar *y, scalar b, scalar *z, int N)
 

Private Attributes

int N
 The number of unknowns. More...
 
scalar tol
 The convergence tolerance threshold. More...
 
int max_num_iterations
 Maximum number of iterations before giving up. More...
 
scalarinv_M
 The inverse of the preconditioner matrix. More...
 
scalarr
 The residual vectors. More...
 
scalarr_hat
 
scalarp
 Other necessary vectors. More...
 
scalarp_hat
 
scalarq
 
scalars
 
scalars_hat
 
scalart
 

Constructor & Destructor Documentation

◆ BiCGSTAB_solver()

BiCGSTAB_solver::BiCGSTAB_solver ( )

◆ ~BiCGSTAB_solver()

BiCGSTAB_solver::~BiCGSTAB_solver ( )

Member Function Documentation

◆ apply_diagonal_matrix()

void BiCGSTAB_solver::apply_diagonal_matrix ( scalar y,
scalar M,
scalar x,
int  N 
)
private

Calculates y = Mx for diagonal matrix and vectors of dimension N

Referenced by solve().

◆ complicated_machine()

void BiCGSTAB_solver::complicated_machine ( scalar w,
scalar x,
scalar  a,
scalar y,
scalar  b,
scalar z,
int  N 
)
private

Carries out the operation w = x + a * (y + b * z)

Referenced by solve().

◆ copy_vector()

void BiCGSTAB_solver::copy_vector ( scalar a,
scalar b,
int  N 
)
private

Copies the contents of vector b into vector a (a <- b)

Referenced by solve().

◆ dot()

scalar BiCGSTAB_solver::dot ( scalar a,
scalar b,
int  N 
)
private

Returns the dot product of vectors a and b, of length N

Referenced by solve().

◆ get_residual_vector()

void BiCGSTAB_solver::get_residual_vector ( scalar r,
scalar b,
SparseMatrixUnknownPattern A,
scalar x,
int  N 
)
private

Calculates the residual vector, r, for the matrix equation Ax = b. Specifically, r = b - Ax.

Referenced by solve().

◆ init()

int BiCGSTAB_solver::init ( int  N,
scalar  tol,
int  max_num_iterations 
)

Referenced by World::init().

◆ scalar_vector_add()

void BiCGSTAB_solver::scalar_vector_add ( scalar x,
scalar y,
scalar  c,
scalar z,
int  N 
)
private

Carries out the operation x = y + c*z, where c is a scalar, and x, y and z are vectors of length N.

Referenced by solve().

◆ solve() [1/2]

int BiCGSTAB_solver::solve ( SparseMatrixUnknownPattern A,
scalar x,
scalar b 
)

Referenced by World::do_es().

◆ solve() [2/2]

int BiCGSTAB_solver::solve ( SparseMatrixUnknownPattern A,
scalar x,
scalar b,
int  num_iterations 
)

◆ zero()

void BiCGSTAB_solver::zero ( scalar x,
int  N 
)
private

Sets the given vector (length N) to zero

Referenced by init(), and solve().

Field Documentation

◆ inv_M

scalar* BiCGSTAB_solver::inv_M
private

The inverse of the preconditioner matrix.

Referenced by BiCGSTAB_solver(), init(), solve(), and ~BiCGSTAB_solver().

◆ max_num_iterations

int BiCGSTAB_solver::max_num_iterations
private

Maximum number of iterations before giving up.

Referenced by BiCGSTAB_solver(), init(), solve(), and ~BiCGSTAB_solver().

◆ N

◆ p

scalar* BiCGSTAB_solver::p
private

Other necessary vectors.

Referenced by BiCGSTAB_solver(), init(), solve(), and ~BiCGSTAB_solver().

◆ p_hat

scalar * BiCGSTAB_solver::p_hat
private

◆ q

scalar * BiCGSTAB_solver::q
private

◆ r

scalar* BiCGSTAB_solver::r
private

The residual vectors.

Referenced by BiCGSTAB_solver(), init(), solve(), and ~BiCGSTAB_solver().

◆ r_hat

scalar * BiCGSTAB_solver::r_hat
private

◆ s

scalar * BiCGSTAB_solver::s
private

◆ s_hat

scalar * BiCGSTAB_solver::s_hat
private

◆ t

scalar * BiCGSTAB_solver::t
private

◆ tol

scalar BiCGSTAB_solver::tol
private

The convergence tolerance threshold.

Referenced by BiCGSTAB_solver(), init(), solve(), and ~BiCGSTAB_solver().


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