From 0823824b5fa1504b6b2c48328aa8fc8468017cba Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 13 Aug 2012 16:00:06 -0400 Subject: another fix --- training/lbfgs_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'training') diff --git a/training/lbfgs_test.cc b/training/lbfgs_test.cc index c94682e9..9678e788 100644 --- a/training/lbfgs_test.cc +++ b/training/lbfgs_test.cc @@ -1,6 +1,7 @@ #include #include #include +#include #include "lbfgs.h" #include "sparse_vector.h" #include "fdict.h" @@ -95,8 +96,9 @@ void TestSparseVector() { cout << data << endl; SparseVector v; double obj; - assert(B64::Decode(&obj, &v, &data[0], data.size())); + bool decode_b64 = B64::Decode(&obj, &v, &data[0], data.size()); cerr << obj << "\t" << v << endl; + assert(decode_b64); assert(obj == iobj); assert(g.size() == v.size()); } @@ -104,7 +106,7 @@ void TestSparseVector() { int main() { double o1 = TestOptimizer(); double o2 = TestPersistentOptimizer(); - if (o1 != o2) { + if (fabs(o1 - o2) > 1e-5) { cerr << "OPTIMIZERS PERFORMED DIFFERENTLY!\n" << o1 << " vs. " << o2 << endl; return 1; } -- cgit v1.2.3