Marine systems simulation
|
#include <ConjugateGradient.h>
Classes | |
class | VectorTask |
Public Member Functions | |
ConjugateGradientSolver (LinearOperator *A) | |
void | SetThreadPool (CoreBoundThreadPool *ThreadPool) |
void | solve (const Vector &B, Vector &X, double &tolerance, int &iterations) |
void | ParallellizeVectorOperations (bool b) |
Protected Attributes | |
LinearOperator * | m_A |
Vector | m_residual |
Vector | m_p |
Vector | m_z |
Vector | m_tmp |
CoreBoundThreadPool * | m_ThreadPool |
bool | m_parallelize_vector_operations |
std::vector< VectorTask > | m_vector_task |
Solves for the linear equation A*X=B, for a given tolerance. Main purpose is to keep working memory persistent to minimize allocation overhead, and manage parallellism of vector operations
Interface for an general linear (matrix) operation. Important functions are to apply the linear operator to a vector, and to compute an approximation of the operator inverse.
void CoRiBoDynamics::ConjugateGradientSolver::solve | ( | const Vector & | B, |
Vector & | X, | ||
double & | tolerance, | ||
int & | iterations | ||
) |
Solves for the linear equation A*X=B, for a given 'tolerance'. Uses the given X as starting iteration value; 'iterations' specifies max iteration number, and will be set to actual iteration count