Free Electron
Public Types | Public Member Functions | Private Attributes | List of all members
fe::ext::ConjugateGradient2< MATRIX, VECTOR > Class Template Reference

solve Ax=b for x More...

#include <ConjugateGradient2.h>

Public Types

enum  Preconditioning {
  e_none,
  e_diagonal_A
}
 Choice to alter matrix during solve. More...
 

Public Member Functions

void solve (VECTOR &x, const MATRIX &A, const VECTOR &b)
 
void setThreshold (F64 threshold)
 
void setPreconditioning (Preconditioning preconditioning)
 

Private Attributes

VECTOR r
 
VECTOR r_1
 
VECTOR r_2
 
VECTOR p
 
VECTOR p_1
 
VECTOR temp
 
VECTOR Ap
 
VECTOR y
 
VECTOR m_AT_b
 
VECTOR m_preconditionedVector
 
MATRIX m_tempMatrix
 
MATRIX m_AT
 
MATRIX m_AT_A
 
MATRIX m_preconditionedMatrix
 
F64 m_threshold
 
Preconditioning m_preconditioning
 

Detailed Description

template<typename MATRIX, typename VECTOR>
class fe::ext::ConjugateGradient2< MATRIX, VECTOR >

solve Ax=b for x

Uses Conjugate-Gradient. The matrix must be positive-definite and symmetric.

The arguments are templated, so any argument types should work, given that they have the appropriate methods and operators.

TODO try seeding with previous x instead of clearing to zero.

Member Enumeration Documentation

◆ Preconditioning

template<typename MATRIX , typename VECTOR >
enum fe::ext::ConjugateGradient2::Preconditioning

Choice to alter matrix during solve.


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