diff --git a/src/BulletSoftBody/btConjugateGradient.h b/src/BulletSoftBody/btConjugateGradient.h index a73199f90..c1e41a0fd 100644 --- a/src/BulletSoftBody/btConjugateGradient.h +++ b/src/BulletSoftBody/btConjugateGradient.h @@ -32,7 +32,7 @@ public: btConjugateGradient(const int max_it_in) : max_iterations(max_it_in) { - tolerance = 1024 * std::numeric_limits::epsilon(); + tolerance = 1e-5; } virtual ~btConjugateGradient(){} @@ -52,7 +52,7 @@ public: A.project(z); btScalar r_dot_z = dot(z,r); btScalar local_tolerance = tolerance; - if (std::sqrt(r_dot_z) <= local_tolerance) { + if (r_dot_z <= local_tolerance) { if (verbose) { std::cout << "Iteration = 0" << std::endl; @@ -86,7 +86,7 @@ public: A.precondition(r, z); r_dot_z = r_dot_z_new; r_dot_z_new = dot(r,z); - if (std::sqrt(r_dot_z_new) < local_tolerance) { + if (r_dot_z_new < local_tolerance) { if (verbose) { std::cout << "ConjugateGradient iterations " << k << std::endl;