From 4220c7f94c20698098f71dfd073b9c3e47f2bb25 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Fri, 4 Oct 2019 17:53:30 -0700 Subject: [PATCH] tune CG tolerance --- src/BulletSoftBody/btConjugateGradient.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;