diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-11-05 15:29:46 +0100 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-11-05 15:29:46 +0100 |
commit | 6f29f345dc06c1a1033475eac1d1340781d1d603 (patch) | |
tree | 6fa4cdd7aefd7d54c9585c2c6274db61bb8b159a /training/lbfgs_test.cc | |
parent | b510da2e562c695c90d565eb295c749569c59be8 (diff) | |
parent | c615c37501fa8576584a510a9d2bfe2fdd5bace7 (diff) |
merge upstream/master
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; } |