16#ifndef BT_CONJUGATE_GRADIENT_H
17#define BT_CONJUGATE_GRADIENT_H
19template <
class MatrixX>
58 std::cout <<
"Iteration = 0" << std::endl;
59 std::cout <<
"Two norm of the residual = " <<
r_dot_z << std::endl;
73 std::cout <<
"Encountered negative direction in CG!" << std::endl;
94 std::cout <<
"ConjugateGradient iterations " <<
k <<
" residual = " <<
r_dot_z_new << std::endl;
const T & btMax(const T &a, const T &b)
const T & btMin(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
btConjugateGradient(const int max_it_in)
virtual ~btConjugateGradient()
int solve(MatrixX &A, TVStack &x, const TVStack &b, bool verbose=false)
btAlignedObjectArray< btVector3 > TVStack
void reinitialize(const TVStack &b)
btKrylovSolver< MatrixX > Base
virtual btScalar dot(const TVStack &a, const TVStack &b)
virtual TVStack sub(const TVStack &a, const TVStack &b)
virtual void multAndAddTo(btScalar s, const TVStack &a, TVStack &result)
virtual TVStack multAndAdd(btScalar s, const TVStack &a, const TVStack &b)