42 #ifndef INCLUDE_OKVIS_CERES_CERESITERATIONCALLBACK_HPP
43 #define INCLUDE_OKVIS_CERES_CERESITERATIONCALLBACK_HPP
45 #include <ceres/iteration_callback.h>
78 const ::ceres::IterationSummary& summary) {
81 && summary.cumulative_time_in_seconds
82 + summary.iteration_time_in_seconds >
timeLimit_) {
83 return ::ceres::SOLVER_TERMINATE_SUCCESSFULLY;
85 return ::ceres::SOLVER_CONTINUE;
::ceres::CallbackReturnType operator()(const ::ceres::IterationSummary &summary)
This method is called after every iteration in ceres.
Definition: CeresIterationCallback.hpp:77
CeresIterationCallback(double timeLimit, int iterationMinimum)
The constructor.
Definition: CeresIterationCallback.hpp:66
int iterationMinimum_
The set maximum no. iterations.
Definition: CeresIterationCallback.hpp:110
The CeresIterationCallback class tries to enforce a time limit on the optimization. It does not guarantee to stay within the time budget as it assumes the next iteration takes as long as the previous iteration.
Definition: CeresIterationCallback.hpp:57
~CeresIterationCallback()
Trivial Destructor.
Definition: CeresIterationCallback.hpp:72
double timeLimit_
The set time limit.
Definition: CeresIterationCallback.hpp:109
void setMinimumIterations(int iterationMinimum)
setMinimumIterations changes the minimum iterations the optimization goes through disregarding the ti...
Definition: CeresIterationCallback.hpp:104
void setTimeLimit(double timeLimit)
setTimeLimit changes time limit of optimization. If you want to disable the time limit, either set it to a large value, delete the callback in the ceres options or set the minimum iterations to the maximum iteration.
Definition: CeresIterationCallback.hpp:95