diff options
author | Chris Dyer <cdyer@cab.ark.cs.cmu.edu> | 2012-08-13 16:00:06 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cab.ark.cs.cmu.edu> | 2012-08-13 16:00:06 -0400 |
commit | 2d921d0cb937c3a2fa1bf8f4aa37be762227be63 (patch) | |
tree | 5bccf6469fe2128f1344ca3bc704331dbd9843b5 /training/lbfgs_test.cc | |
parent | 7b6125586338547dceaa1e9fd3a91db17a5cb78e (diff) |
another fix
Diffstat (limited to 'training/lbfgs_test.cc')
-rw-r--r-- | training/lbfgs_test.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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 <cassert> #include <iostream> #include <sstream> +#include <cmath> #include "lbfgs.h" #include "sparse_vector.h" #include "fdict.h" @@ -95,8 +96,9 @@ void TestSparseVector() { cout << data << endl; SparseVector<double> 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; } |