ALP User Documentation  0.8.preview
Algebraic Programming User Documentation
Namespaces | Functions
conjugate_gradient.hpp File Reference

Implements the CG algorithm. More...

Go to the source code of this file.

Namespaces

 grb
 The ALP/GraphBLAS namespace.
 
 grb::algorithms
 The namespace for ALP/GraphBLAS algorithms.
 

Functions

template<Descriptor descr = descriptors::no_operation, typename IOType , typename ResidualType , typename NonzeroType , typename InputType , class Ring = Semiring< grb::operators::add< IOType >, grb::operators::mul< IOType >, grb::identities::zero, grb::identities::one >, class Minus = operators::subtract< IOType >, class Divide = operators::divide< IOType >, typename RSI , typename NZI , Backend backend>
grb::RC conjugate_gradient (grb::Vector< IOType, backend > &x, const grb::Matrix< NonzeroType, backend, RSI, RSI, NZI > &A, const grb::Vector< InputType, backend > &b, const size_t max_iterations, ResidualType tol, size_t &iterations, ResidualType &residual, grb::Vector< IOType, backend > &r, grb::Vector< IOType, backend > &u, grb::Vector< IOType, backend > &temp, const Ring &ring=Ring(), const Minus &minus=Minus(), const Divide &divide=Divide())
 Solves a linear system \( b = Ax \) with \( x \) unknown by the Conjugate Gradients (CG) method on general fields. More...
 
template<Descriptor descr = descriptors::no_operation, bool preconditioned = true, typename IOType , typename ResidualType , typename NonzeroType , typename InputType , class Ring = Semiring< grb::operators::add< IOType >, grb::operators::mul< IOType >, grb::identities::zero, grb::identities::one >, class Minus = operators::subtract< IOType >, class Divide = operators::divide< IOType >, typename RSI , typename NZI , Backend backend>
grb::RC preconditioned_conjugate_gradient (grb::Vector< IOType, backend > &x, const grb::Matrix< NonzeroType, backend, RSI, RSI, NZI > &A, const grb::Vector< InputType, backend > &b, const std::function< grb::RC(grb::Vector< IOType, backend > &, const grb::Vector< IOType, backend > &) > &Minv, const size_t max_iterations, ResidualType tol, size_t &iterations, ResidualType &residual, grb::Vector< IOType, backend > &r, grb::Vector< IOType, backend > &u, grb::Vector< IOType, backend > &temp, grb::Vector< IOType, backend > &temp_precond, const Ring &ring=Ring(), const Minus &minus=Minus(), const Divide &divide=Divide())
 Solves a preconditioned linear system \( b = M^{-1}Ax \) with \( x \) unknown by the Conjugate Gradients (CG) method on general fields. More...
 

Detailed Description

Implements the CG algorithm.

Author
Aristeidis Mastoras