#include <opt.h>
Inheritance diagram for DualSolver:
Public Member Functions | |
DualSolver (DualFunc &f, vector< double > lower_bound_, Param ¶m_, Pointer< ostream > out_solver_p_=out_out_p, Pointer< ostream > out_solver_log_p_=out_log_p) | |
Constructor for a function and lower bounds. | |
virtual | ~DualSolver () |
double | rel_improvement1 () |
double | rel_improvement2 () |
double | rel_improvement_max () |
int | serious_steps () |
Public Attributes | |
double | last_rel_improvement |
Last relative improvement, if conv_rate_cntrl is enabled. | |
double | threshold |
Threshold for the dual value. | |
dvector | lower_bound |
Lower bounds of the dual points. | |
Pointer< vector< double > > | dual_vals |
To log the values of the dual function. | |
Pointer< vector< dvector > > | dual_points |
To log the points of the dual problem. | |
Pointer< vector< vector< dvector > > > | orig_points |
To log the points of the original problem. | |
int | log_frequency |
The log frequency. | |
bool | store_primals |
Should we add the primal points to the sample set. | |
Protected Member Functions | |
void | do_log () |
Logs the present points. | |
int | check (double val) |
Checks the actual iteration. | |
Protected Attributes | |
Param & | param |
Parameters. | |
DualFunc & | obj |
Dual function. | |
Private Attributes | |
bool | threshold_cntrl |
Is the threshold control enabled ? | |
bool | conv_rate_cntrl |
Is the convergence rate control enabled ? | |
double | stopping_rho |
If conv_rate_cntrl is set and improvement in last minor_iter iterations is less than stopping_rho * rel_imp1, check() breakes the solving process. | |
int | minor_iter |
The number of minor iterations for the convergence rate control. | |
double | last_major_val |
The value in the last major iteration. | |
double | last_val |
The value in the last iteration. | |
double | first_major_val |
The value in the first iteration. | |
double | max_rel_improvement |
First relative improvement. | |
int | improve_iter |
Counter for the number of iterations with improvements (serious steps). |
Definition at line 148 of file opt.h.
DualSolver::DualSolver | ( | DualFunc & | f, | |
vector< double > | lower_bound_, | |||
Param & | param_, | |||
Pointer< ostream > | out_solver_p_ = out_out_p , |
|||
Pointer< ostream > | out_solver_log_p_ = out_log_p | |||
) | [inline] |
Constructor for a function and lower bounds.
Sets threshold to INFINITY.
f | The function to maximize. | |
lower_bound_ | The lower bounds of the dual points. | |
threshold_ | Threshold. | |
out_solver_p_ | A Pointer to an ostream to print solver-relevant information to. | |
out_solver_log_p_ | A Pointer to an ostream to print solver-relevant logging-information to. |
Definition at line 247 of file opt.h.
References conv_rate_cntrl, Solver::dim(), Param::get_d(), Param::get_i(), lower_bound, minor_iter, param, Param::read(), stopping_rho, and threshold_cntrl.
void DualSolver::do_log | ( | ) | [protected] |
Logs the present points.
If it's time for a log entry, the dual_value, dual_point and the points from the original problem are stored.
int DualSolver::check | ( | double | val | ) | [protected] |
double DualSolver::rel_improvement1 | ( | ) | [inline] |
double DualSolver::rel_improvement2 | ( | ) | [inline] |
double DualSolver::rel_improvement_max | ( | ) | [inline] |
int DualSolver::serious_steps | ( | ) | [inline] |
bool DualSolver::threshold_cntrl [private] |
Is the threshold control enabled ?
Definition at line 152 of file opt.h.
Referenced by DualSolver().
bool DualSolver::conv_rate_cntrl [private] |
Is the convergence rate control enabled ?
Definition at line 156 of file opt.h.
Referenced by DualSolver().
double DualSolver::stopping_rho [private] |
If conv_rate_cntrl is set and improvement in last minor_iter iterations is less than stopping_rho * rel_imp1, check() breakes the solving process.
Definition at line 159 of file opt.h.
Referenced by DualSolver().
int DualSolver::minor_iter [private] |
The number of minor iterations for the convergence rate control.
Definition at line 162 of file opt.h.
Referenced by DualSolver().
double DualSolver::last_major_val [private] |
The value in the last major iteration.
Definition at line 165 of file opt.h.
Referenced by rel_improvement1().
double DualSolver::last_val [private] |
double DualSolver::first_major_val [private] |
The value in the first iteration.
Definition at line 171 of file opt.h.
Referenced by rel_improvement1().
double DualSolver::max_rel_improvement [private] |
First relative improvement.
Definition at line 174 of file opt.h.
Referenced by rel_improvement_max().
int DualSolver::improve_iter [private] |
Counter for the number of iterations with improvements (serious steps).
Definition at line 177 of file opt.h.
Referenced by serious_steps().
Param& DualSolver::param [protected] |
Parameters.
Definition at line 182 of file opt.h.
Referenced by DualSolver(), and SubGradOpt::SubGradOpt().
DualFunc& DualSolver::obj [protected] |
Last relative improvement, if conv_rate_cntrl is enabled.
Definition at line 210 of file opt.h.
Referenced by rel_improvement2().
double DualSolver::threshold |
Pointer<vector<double> > DualSolver::dual_vals |
Pointer<vector<dvector> > DualSolver::dual_points |
Pointer<vector<vector<dvector> > > DualSolver::orig_points |