aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-10-11 16:24:22 +0000
committerastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-10-11 16:24:22 +0000
commit896a67e280d41df613092279f76913f8372faba1 (patch)
treeef5c2a83f1291d47dd56ee9969d244ceb1b7fc4c /core
parent3fcb4f104a8b81937f93ef4b298dd51e3c1eec94 (diff)
downloadopt-utilities-896a67e280d41df613092279f76913f8372faba1.tar.bz2
git-svn-id: file:///home/svn/opt_utilities@79 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'core')
-rw-r--r--core/fitter.hpp9
-rw-r--r--core/optimizer.hpp25
2 files changed, 33 insertions, 1 deletions
diff --git a/core/fitter.hpp b/core/fitter.hpp
index e07469e..2a81d70 100644
--- a/core/fitter.hpp
+++ b/core/fitter.hpp
@@ -1628,10 +1628,17 @@ namespace opt_utilities
return p_model->get_all_params();
}
+ /**
+ stop the fitting
+ */
+ void stop()
+ {
+ optengine.stop();
+ }
+
};
-
/**
\brief virtual class representing a statistic
\tparam Ty the type of the model return type
diff --git a/core/optimizer.hpp b/core/optimizer.hpp
index 6380d66..bb26bfb 100644
--- a/core/optimizer.hpp
+++ b/core/optimizer.hpp
@@ -198,6 +198,13 @@ namespace opt_utilities
{
return typeid(*this).name();
}
+
+ /**
+ interrupting the optimization
+ */
+ virtual void do_stop()
+ {
+ }
public:
/**
Interface function for seting optimizer
@@ -300,6 +307,13 @@ namespace opt_utilities
return do_clone();
}
+ /**
+ stop the optimization
+ */
+ void stop()
+ {
+ do_stop();
+ }
/**
destroy the cloned object.
@@ -621,6 +635,17 @@ namespace opt_utilities
}
return p_opt_method->optimize();
}
+
+ /**
+ stop the optimize
+ */
+ void stop()
+ {
+ if(p_opt_method)
+ {
+ p_opt_method->stop();
+ }
+ }
/**
\return the pointer to the inner object function