3 #ifndef CONICBUNDLE_CBSOLVER_HXX 4 #define CONICBUNDLE_CBSOLVER_HXX 223 ConstantPenaltyFunction=1,
224 AdaptivePenaltyFunction=2
297 Minorant(
double offset,
const DVector& subg,
PrimalData* primal=0,
bool offset_at_origin=
false);
317 Minorant(
double offset,
const DVector& subg_val,
const IVector& subg_ind,
PrimalData* primal=0,
bool offset_at_origin=
false);
354 Minorant(
bool offset_at_origin=
true,
357 const double* coeffs=0,
358 const int* indices=0,
370 virtual double offset()
const;
372 virtual int add_offset(
double value);
375 virtual bool& offset_gives_value_at_origin();
377 virtual bool offset_gives_value_at_origin()
const;
380 virtual double coeff(
int i);
383 virtual int add_coeff(
int i,
double value);
386 virtual int add_coeffs(
int n_elements,
const double* values,
double factor=1.,
int start_pos=0);
389 virtual int add_coeffs(
int n_elements,
const double* values,
const int* indices,
double factor=1.);
392 virtual int sparsify(
double tol=CB_minorant_zero_tolerance,
double sparsity_ratio=CB_minorant_sparsity_ratio);
395 virtual int nonzeros();
403 virtual int get_coeffs(
int& n_elements,
const double*& coeffs,
const int*& indices)
const;
418 virtual double* get_dense_coeff_store(
int n_elements);
421 virtual int reassign_coeffs(
int n_elements,
const int* map_to_old_coeffs);
433 virtual Minorant* clone_minorant(
double factor=1.,
bool with_primal=
true)
const;
436 virtual int aggregate(
const Minorant& minorant,
double factor=1.);
439 virtual int number_aggregated()
const;
442 virtual int scale_minorant(
double scale_val);
445 virtual double norm_squared()
const;
451 mutable MinorantData*
data;
517 virtual int extend(
Minorant& minorant,
int n_coords,
const int* indices)=0;
551 virtual int get_old_vardim()
const =0;
553 virtual int get_new_vardim()
const =0;
555 virtual int get_appended_vardim()
const =0;
557 virtual const int* get_map_to_old_variables()
const =0;
586 virtual int add_append_variables(
int append_dim)=0;
589 virtual int add_reassign_variables(
int new_dim,
const int* map_to_old_indices)=0;
592 virtual bool no_modification()
const=0;
595 virtual int set_append_to_old(
bool ) =0;
598 virtual bool append_to_old()
const=0;
649 DVector::operator=(*pd);
651 for(
unsigned int i=0;i<size();i++){
662 if (size()!=pd->size())
return 1;
663 for(
unsigned int i=0;i<size();i++){
664 (*this)[i]+=(*pd)[i]*factor;
673 for(
unsigned int i=0;i<size();i++){
674 (*this)[i]*=myfactor;
815 const double* current_point,
817 double& objective_value,
818 std::vector<Minorant*>& minorants,
867 const double* new_center,
868 const double* old_center,
869 bool& discard_objective_in_center,
871 bool& discard_aggregates,
910 {
return max_model_size; }
913 {
return max_bundle_size; }
916 {
return update_rule; }
920 { max_model_size=mms;
return 0; }
923 { max_bundle_size=mbs;
return 0; }
926 { update_rule=ur;
return 0; }
935 max_model_size=modelsize;
936 max_bundle_size=bundlesize;
937 update_rule=updaterule;
979 CBSolver(std::ostream* out=0,
int print_level=0);
1031 int init_problem(
int dim,
1032 const DVector* lbounds=0,
1033 const DVector* ubounds=0);
1063 int set_lower_bound(
int i,
double lb);
1076 int set_upper_bound(
int i,
double ub);
1116 int append_variables(
int n_append,
1117 const DVector* lbounds=0,
1118 const DVector* ubounds=0);
1151 int delete_variables(
const IVector& delete_indices,IVector& map_to_old);
1180 int reassign_variables(
const IVector& assign_new_from_old);
1243 solve(
int maxsteps=0,
bool stop_at_descent_steps=
false);
1290 print_termination_code(std::ostream& out);
1332 ( DVector& subgradient )
1344 get_candidate_value()
1359 ( DVector& candidate )
1384 (
const double term_relprec );
1395 set_new_center_point
1396 (
const DVector& center_point );
1415 get_approximate_slacks
1434 get_approximate_primal
1465 get_candidate_primal
1538 set_bundle_parameters
1557 get_bundle_parameters
1577 int reinit_function_model
1600 int call_primal_extender
1608 get_last_weight()
const;
1632 (
const double weight );
1650 (
const double min_weight );
1667 (
const double max_weight );
1709 set_active_bounds_fixing
1710 (
bool allow_fixing );
1744 set_inner_update_limit
1760 int get_n_functions();
1771 int get_fixed_active_bounds(IVector& fixed_active_bounds)
const;
1838 (std::ostream* out=0,
int print_level=1);
Base class for informing oracles (or the solver) about dynamic changes in the number and sorting of t...
Definition: CBSolver.hxx:544
virtual int get_max_model_size() const
returns the value of the variable
Definition: CBSolver.hxx:909
oracle interface (abstract class). For each of your functions, provide a derived class.
Definition: CBSolver.hxx:715
virtual int set_max_model_size(int mms)
sets the value of the variable
Definition: CBSolver.hxx:919
virtual int set_max_bundle_size(int mbs)
sets the value of the variable
Definition: CBSolver.hxx:922
BundleParameters(int modelsize=-1, int bundlesize=-1, int updaterule=-1)
often works well for fast initial progress: small model of size 2 and some history in bundle size for...
Definition: CBSolver.hxx:933
Bundle method solver.
Definition: CBSolver.hxx:969
PrimalDVector & operator=(const DVector &pd)
assignment of a DVector
Definition: CBSolver.hxx:639
The Full Conic Bundle method solver invoked by ConicBundle::MatrixCBSolver(), it uses a separate cutt...
Definition: MatrixCBSolver.hxx:540
Minorant(const Minorant &)
forbidden, blocked deliberately
Definition: CBSolver.hxx:453
PrimalDVector(int n, double d)
construct a primal double vector with n elements initialized to d
Definition: CBSolver.hxx:633
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
std::vector< double > DVector
A dense vector of double, arguments and subgradients are specified like this.
Definition: CBSolver.hxx:121
If in Lagrangean relaxation primal solutions are in the form of a ConicBundle::DVector, then an approximate primal solution can be generated by supplying primal information of this form for each epsilon subgradient within ConicBundle::FunctionOracle::evaluate().
Definition: CBSolver.hxx:624
std::vector< int > IVector
A dense vector of int, index vectors for deleting/reorganizing variables are specified like this...
Definition: CBSolver.hxx:126
this is used to describe affine minorants of convex functions that will be used for generating cuttin...
Definition: CBSolver.hxx:274
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
MinorantData * data
implementation details are hidden on purpose
Definition: CBSolver.hxx:449
const double CB_minorant_zero_tolerance
serves as the default tolerance for considering minorant entries as zero
int assign_primal_data(const PrimalData &it, double factor=1.)
copy its information to *this
Definition: CBSolver.hxx:645
BundleParameters(const BundleParameters &bp)
often works well: small model of size 2 and some history in bundle size for use in scaling ...
Definition: CBSolver.hxx:929
virtual int init(const BundleParameters &bp)
initialize to given values
Definition: CBSolver.hxx:900
Serves for specifying parameters regarding the construction of cutting models.
Definition: CBSolver.hxx:891
virtual BundleParameters * clone_BundleParameters() const
return a new clone object of this on the heap (caller needs to delete the result) ...
Definition: CBSolver.hxx:944
virtual PrimalData * clone_primal_data() const =0
Returns a newly generated identical Object.
PrimalData * clone_primal_data() const
produces a new PrimalDVector that is a copy of itself
Definition: CBSolver.hxx:642
int update_rule
in case several update rules are available
Definition: CBSolver.hxx:896
const double CB_minus_infinity
serves as the value "plus infinity", i.e., all bounds >= this value are set to this value and are reg...
int max_bundle_size
suggested maximum number of latest minorants stored for use in a model, for constructing variable met...
Definition: CBSolver.hxx:895
int aggregate_primal_data(const PrimalData &it, double factor=1.)
if it is a PrimalDVector of the same dimension, add factor*it to *this
Definition: CBSolver.hxx:658
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
PrimalDVector(const PrimalDVector &pd)
copy constructor
Definition: CBSolver.hxx:635
const double CB_plus_infinity
serves as the value "minus infinity", i.e., all bounds <= this value are set to this value and are re...
virtual int set_update_rule(int ur)
sets the value of the variable
Definition: CBSolver.hxx:925
virtual int scale_primal_data(double myfactor)
multiply/scale *this with a nonnegative myfactor
Definition: CBSolver.hxx:670
const double CB_minorant_sparsity_ratio
serves as the default ratio of nonzeros to dimension for using a sparse representatio of a minorant ...
virtual int scale_primal_data(double myfactor)=0
multiply/scale *this with a nonnegative myfactor
basic function object (abstract class). It serves for using the same interface on distinct oracle typ...
Definition: CBSolver.hxx:236
int max_model_size
maximum number of minorants to be selected for the cutting model (numbers<=1 for no limit...
Definition: CBSolver.hxx:894
In Lagrangean relaxation an approximate primal solution can be generated by supplying primal informat...
Definition: CBSolver.hxx:151
virtual int get_update_rule() const
returns the value of the variable
Definition: CBSolver.hxx:915
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
virtual bool check_correctness() const
switch on/off some correctness checks on the oracle
Definition: CBSolver.hxx:880
PrimalDVector(int n)
construct a primal double vector with n elements
Definition: CBSolver.hxx:631
PrimalDVector(const DVector &pd)
conversion from a DVector
Definition: CBSolver.hxx:637
virtual int aggregate_primal_data(const PrimalData &it, double factor=1.)=0
add factor*it to this (types will need to be compatible to this)
MatrixCBSolver * solver
pointer to internal solver
Definition: CBSolver.hxx:972
virtual int get_max_bundle_size() const
returns the value of the variable
Definition: CBSolver.hxx:912