aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/makefile2
-rw-r--r--test/test_optimizer.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/test/makefile b/test/makefile
index a801d7b..e850e82 100644
--- a/test/makefile
+++ b/test/makefile
@@ -3,7 +3,7 @@ targets=test_optimizer
all:$(targets)
test_optimizer:test_optimizer.cpp
- $(CXX) $< -o $@ -I .. -O3
+ $(CXX) $< -o $@ -I .. -O3 -g
clean:
diff --git a/test/test_optimizer.cpp b/test/test_optimizer.cpp
index b6d70a7..8d0b405 100644
--- a/test/test_optimizer.cpp
+++ b/test/test_optimizer.cpp
@@ -1,3 +1,5 @@
+#define private public
+#include <cassert>
#include <core/optimizer.hpp>
#include <methods/powell/powell_method.hpp>
//#include <methods/gsl_simplex/gsl_simplex.hpp>
@@ -120,8 +122,10 @@ void test_opt(const func_obj<double,vector<double> >& fo,
{
const int problem_size=5;
optimizer<double,vector<double> > opt;
- opt.set_opt_method(optm);
+
opt.set_func_obj(fo);
+ opt.set_opt_method(optm);
+
vector<double> p(problem_size);
for(int i=0;i<p.size();++i)
{