summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cab.ark.cs.cmu.edu>2012-08-13 16:00:06 -0400
committerChris Dyer <cdyer@cab.ark.cs.cmu.edu>2012-08-13 16:00:06 -0400
commit0823824b5fa1504b6b2c48328aa8fc8468017cba (patch)
treecc60728387543f79b32720d4eef1cbf9f73b02ad
parentb7ba2cea89e832a8133de0d495896a251087a36d (diff)
another fix
-rw-r--r--training/lbfgs_test.cc6
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;
}