ConicBundle::MatrixBSolver Class Reference
[Interface to ConicBundle for the Language C++ using Matrix Classes]

This is the common abstract Matrix Class interface to the two real solvers ConicBundle::MatrixFCBSolver and ConicBundle::MatrixNBSolver. More...

#include <MatBSolver.hxx>

Inheritance diagram for ConicBundle::MatrixBSolver:

ConicBundle::MatrixFCBSolver ConicBundle::MatrixNBSolver

List of all members.

Public Member Functions

Initialization
virtual void clear ()=0
 Clears all data structures and problem information but keeps ouptut settings and algorithmic parameter settings.
virtual void set_defaults ()=0
 Sets default values for algorithmic parameters that are not function specific (e.g., relative precision, weight and weight bounds for the augmentedproblem, etc.).
virtual int init_problem (int dim, const CH_Matrix_Classes::Matrix *lbounds=0, const CH_Matrix_Classes::Matrix *ubounds=0, const CH_Matrix_Classes::Matrix *costs=0)=0
 Initializes the problem by setting up the design space (the dimension and possible box constraints of the variables).
virtual int add_function (FunctionObject &function)=0
 Adds a function, typically derived from ConicBundle::FunctionOracle; all functions added must have the same argument dimension set in init_problem().
virtual int set_lower_bound (int i, double lb)=0
 Sets lower bound for variable i, use ConicBundle::CB_minus_infinity for unbounded from below.
virtual int set_upper_bound (int i, double ub)=0
 Sets upper bound for variable i, use ConicBundle::CB_plus_infinity for unbounded from below.
virtual int append_variables (int n_append, const CH_Matrix_Classes::Matrix *lbounds=0, const CH_Matrix_Classes::Matrix *ubounds=0, const CH_Matrix_Classes::Matrix *costs=0)=0
 Append new variables (always in last postions in this order).
virtual int delete_variables (const CH_Matrix_Classes::Indexmatrix &del_indices, CH_Matrix_Classes::Indexmatrix &map_to_old)=0
 Deletes variables corresponding to the specified indices.
virtual int reassign_variables (const CH_Matrix_Classes::Indexmatrix &assign_new_from_old)=0
 Reassigns variables to new index positions by mapping to position i the variable that previously had index assign_new_from_old[i].
Basic algorithmic routines and parameters
virtual int do_descent_step (int maxsteps=0)=0
 Does a descent step for the current center point.
virtual int termination_code () const =0
 Returns the termination code of the bundle algorithm for the latest descent step.
virtual std::ostream & print_termination_code (std::ostream &out)=0
 Outputs a text version of termination code, see termination_code().
virtual double get_objval () const =0
 Returns the objective value resulting from last descent step (initially undefined). If no problem modification routines were called since then, it is the objective value at the point returned by get_center().
virtual int get_center (CH_Matrix_Classes::Matrix &center) const =0
 Returns the next center point that was produced by the latest call to do_descent_step (in some problem modification routines the center point may be updated immediately, in others the center point will be corrected automatically directly before starting the next descent step and its values may be infeasible till then).
virtual double get_sgnorm () const =0
 Returns Euclidean norm of the latest aggregate subgradient.
virtual int get_subgradient (CH_Matrix_Classes::Matrix &subgradient) const =0
 Returns the latest aggregate subgradient.
virtual double get_cutval () const =0
 Returns the cutting model value resulting from last call to do_descent_step() (initially undefined).
virtual double get_candidate_value () const =0
 Returns the objective value computed in the last step of do_descent_step(), independent of whether this was a descent step or a null step (initially undefined).
virtual int get_candidate (CH_Matrix_Classes::Matrix &candidate) const =0
 Returns the last point, the "candidate", at which the function was evaluated in do_descent_step().
Advanced algorithmic routines and parameters
virtual int set_term_relprec (const double term_relprec)=0
 Sets the relative precision requirements for successful termination (default 1e-5).
virtual int set_new_center_point (const CH_Matrix_Classes::Matrix &center_point)=0
 Set the starting point/center that will be used in the next call to do_descent_step(). Each call to this routine causes an immediate evaluation of all oracles.
virtual int get_function_status (const FunctionObject &function) const =0
 Returns the return value of the latest evaluation call to this function.
virtual int get_approximate_slacks (CH_Matrix_Classes::Matrix &) const =0
 Returns the multipliers for the box constraints on the design variables; in Lagrangean relaxation they may be interpreted as primal slacks for inequality constraints.
virtual int get_approximate_primal (const FunctionObject &function, PrimalData &primal) const =0
 returns the current approximate primal solution corresponding to the aggregate subgradient of the specified function.
virtual int get_center_primal (const FunctionObject &function, PrimalData &primal) const =0
 Returns the primal solution corresponding to the best epsilon subgradient returned in the evaluation of the specified function at the current center point.
virtual int get_candidate_primal (const FunctionObject &function, PrimalData &primal) const =0
 Returns the primal solution returned by the last evaluation of the specified function in the point get_candidate().
virtual int set_max_bundlesize (const FunctionObject &function, int max_bundlesize)=0
 Sets the maximum number of subgradients used in forming the cutting model of the specified function.
virtual int set_max_new_subgradients (const FunctionObject &function, int max_new_subgradients)=0
 Sets the maximum number of new subgradients to be used in the next bundle update of the cutting modle for the specified .
virtual int set_bundle_parameters (const FunctionObject &function, const BundleParameters &params)=0
 Sets the maximum bundlesize and the maximum number of new subgradients added in a bundle update of the cutting model for the specified function. The meaning of this routine may differ from standard for predefined special functions with special bundle types.
virtual int get_bundle_parameters (const FunctionObject &function, BundleParameters &params) const =0
 Retrieves current bundle parameters (not the actual size in use!) as set for the cutting model of the specified function.
virtual int get_bundle_values (const FunctionObject &function, BundleParameters &params) const =0
 Returns the current bundle values: the current bundle_size and the number of subgradients added in the latest update of the cutting model of the specified function.
virtual int reinit_function_model (const FunctionObject &function)=0
 Clears cutting model, subgradients and stored function values for the specified function.
virtual int clear_aggregates (const FunctionObject &function)=0
 Clears the aggregate parts of the cutting model of this function.
virtual double get_last_weight () const =0
 Returns the current weight for the quadratic term in the augmented subproblem (may be interpreted as 1./step_size or 1./trustregion-radius).
virtual int set_next_weight (const double weight)=0
 Sets the weight (>0) to be used in the quadratic term of the next augmented subproblem (may be interpreted as 1./step_size or 1./trustregion-radius).
virtual int set_min_weight (const double min_weight)=0
 Sets a lower bound on the weight for the quadratic term of the augmented subproblem.
virtual int set_max_weight (const double max_weight)=0
 Sets an upper bound on the weight for the quadratic term of the augmented subproblem.
virtual int adjust_multiplier (void)=0
 Adjusts on all conic functions the penalty parameter for conic violations to twice the trace of the primal approximation.
virtual int set_scaling (bool do_scaling)=0
 Use a scaling heuristic or switch off scaling alltogether.
virtual int set_scaling (const CH_Matrix_Classes::Matrix &scale)=0
 user defined diagonal scaling, values greater than 1 allow more movement for this variable, values smaller than 1 allow less movement.
virtual void set_active_bounds_fixing (bool allow_fixing)=0
 If set to true (the default is false), some variables will be fixed automatically to the center value if their bounds are strongly active (i.e., the corresponding multipliers are big).
virtual void clear_fail_counts (void)=0
 clears all fail counts on numerical function oder model failures, may be useful if this caused premature termination.
virtual void set_eval_limit (CH_Matrix_Classes::Integer eval_limit)=0
 Sets an upper bound on the number of calls to the oracle (use negative numbers for no limit).
virtual void set_inner_update_limit (CH_Matrix_Classes::Integer update_limit)=0
 Set an upper bound on the number of inner updates for the cutting model with primal slacks within one null step (use negative numbers for no limit).
Look up basic paramaters (dimension, number of functions, ...)
virtual int get_dim () const =0
 Returns the current dimension of the design space/argument or -1 if no dimension is set.
virtual int get_n_functions () const =0
 Returns the current number of functions in the problem.
virtual int get_n_oracle_calls () const =0
 Returns the number of function evaluations.
virtual int get_n_descent_steps () const =0
 Returns the number of function descent setps.
virtual int get_n_inner_iterations () const =0
 Returns the number of inner iterations of the bundle method.
virtual int get_n_inner_updates () const =0
 Returns the number of inner multiplier updates for the box constraints.
virtual const
CH_Matrix_Classes::Matrix
get_lbounds () const =0
 Returns the vector of lower bounds.
virtual const
CH_Matrix_Classes::Matrix
get_ubounds () const =0
 Returns the vector of upper bounds.
virtual const
CH_Matrix_Classes::Indexmatrix
get_active_bounds_indicator () const =0
 Returns the indicator vector of variables temporarily fixed to the center value due to significantly positive multipliers for the box constraints.
Output
virtual void set_out (std::ostream *out=0, int print_level=1)=0
 Specifies the output level (out==NULL: no output at all, out!=NULL and level=0: errors and warnings, level>0 increasingly detailed information).
virtual std::ostream & print_line_summary (std::ostream &out) const =0
 print a one line summary of important evaluation data


Detailed Description

This is the common abstract Matrix Class interface to the two real solvers ConicBundle::MatrixFCBSolver and ConicBundle::MatrixNBSolver.


Member Function Documentation

virtual int ConicBundle::MatrixBSolver::init_problem ( int  dim,
const CH_Matrix_Classes::Matrix lbounds = 0,
const CH_Matrix_Classes::Matrix ubounds = 0,
const CH_Matrix_Classes::Matrix costs = 0 
) [pure virtual]

Initializes the problem by setting up the design space (the dimension and possible box constraints of the variables).

Clears all data structures and sets the dimension @ m for a new problem. for solving min_{y in R^m} f_0(y) + f_1(y) + ... Box constraints may be specified for y. (The functions f_i must be added by add_function()).

Lower and/or upper bounds must be speicified for all variables or for none of them. To specify no bounds at all, give Null pointers. Otherwise use ConicBundle::CB_minus_infinity for unbounded below and ConicBundle::CB_plus_infinity for unbounded above. For NULL pointers, unbounded will be used as default for all variables. Specifying bounds selectively is also possible by set_lower_bound() or set_upper_bound().

Parameters:
[in] dimm (int) the dimension of the argument/design space/the number of Lagrange multipliers
[in] lbounds (const Matrix*) If NULL, all variables are considered unbounded below, otherwise lowerb[i] gives the minimum feasible value for variable y[i], use ConicBundle::CB_minus_infinity for unbounded below.
[in] ubounds (const Matrix*) If NULL, all variables are considered unbounded above, otherwise upperb[i] gives the maximum feasible value for variable y[i], use ConicBundle::CB_plus_infinity for unbounded above.
[in] costs (const Matrix*) Use this in order to specify linear costs on the variables in addition to the functions (may be convenient in Lagrangean relaxation for the right hand side of coupling contsraints); NULL is equivalent to costs zero.
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::add_function ( FunctionObject function  )  [pure virtual]

Adds a function, typically derived from ConicBundle::FunctionOracle; all functions added must have the same argument dimension set in init_problem().

Besides the standard ConicBundle::MatrixFunctionOracle the interface only accepts a few other prespecified derivations of the class FunctionObject that come along with the CH_Matrix_Classes interface (e.g. for semidefinite and second order cones). Functions not derived from these will fail to be added and return a value !=0.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_lower_bound ( int  i,
double  lb 
) [pure virtual]

Sets lower bound for variable i, use ConicBundle::CB_minus_infinity for unbounded from below.

The algorithm may have to adapt the center point aftwards. In this case the old function values will be marked as outdated and will be recomputed at the next call to e.g. do_descent_step().

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_upper_bound ( int  i,
double  ub 
) [pure virtual]

Sets upper bound for variable i, use ConicBundle::CB_plus_infinity for unbounded from below.

The algorithm may have to adapt the center point aftwards. In this case the old function values will be marked as outdated and will be recomputed at the next call to e.g. do_descent_step().

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::append_variables ( int  n_append,
const CH_Matrix_Classes::Matrix lbounds = 0,
const CH_Matrix_Classes::Matrix ubounds = 0,
const CH_Matrix_Classes::Matrix costs = 0 
) [pure virtual]

Append new variables (always in last postions in this order).

If 0 is feasible for the new coordinates then this is selected as starting value for the new coordinates; otherwise, the number closest to zero is used. If all new coordinates can be set to zero then it is assumed that for an existing center point the function values need not be recomputed (this is e.g. the case in Lagrangean relaxation; if this is not correct call reinit_function_model() below). Otherwise the old function values will be marked as outdated and will be recomputed at the next call to e.g. do_descent_step().

Attention:
Be sure to update your objective functions so that they can handle the new variables before you call any further ConicBundle routines that require function evaluations. Also, these operations may lead to inavailability of certain other data such as subgradients and primal approximations.
Parameters:
[in] n_append (int) number of variables to append (always in last position in the same order)
[in] lbounds (const Matrix*) If NULL, all appended variables are considered unbounded below, otherwise lowerb[i] gives the minimum feasible value for variable y[i], use ConicBundle::CB_minus_infinity for unbounded below.
[in] ubounds (const Matrix*) If NULL, all appended variables are considered unbounded above, otherwise upperb[i] gives the maximum feasible value for variable y[i], use ConicBundle::CB_plus_infinity for unbounded above.
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::delete_variables ( const CH_Matrix_Classes::Indexmatrix del_indices,
CH_Matrix_Classes::Indexmatrix map_to_old 
) [pure virtual]

Deletes variables corresponding to the specified indices.

The indices of the remaining variables are reassigned so that they are consecutive again, the routine returns in map_to_old a vector giving for each new index of these remaining variables the old coordinate.

If all of the deleted variables are zero, function values are assumed to remain correct (if this is not so, call reinit_function_model() below) Otherwise the old function values will be marked as outdated and will be recomputed at the next call to e.g. do_descent_step().

Attention:
Be sure to update your objective functions so that they can handle the new variables before you call any further ConicBundle routines that require function evaluations. Also, these operations may lead to inavailability of certain other data such as subgradients and primal approximations.
Parameters:
[in] delete_indices (const Indexmatrix&) the entries delete_indices[i] specify the indices of the variables to be deleted
[out] map_to_old (Indexmatrix&) after the call, element map_to_old[i] gives the old index (before the call) of the variable that now has index position i.
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::reassign_variables ( const CH_Matrix_Classes::Indexmatrix assign_new_from_old  )  [pure virtual]

Reassigns variables to new index positions by mapping to position i the variable that previously had index assign_new_from_old[i].

Old variables, that are not mapped to any position will be deleted. It is allowed to generate several copies of old variables.

If all of the deleted variables as well as new multiple copies are zero, function values are assumed to remain correct (if this is not so, call reinit_function_model() below). Otherwise the old function values will be marked as outdated and will be recomputed at the next call to e.g. do_descent_step().

Attention:
Be sure to update your objective functions so that they can handle the new variables before you call any further ConicBundle routines that require function evaluations. Also, these operations may lead to inavailability of certain other data such as subgradients and primal approximations.
Parameters:
[in] assign_new_from_old (const IVector&) entry assign_new_from_old[i] specifies the old index of the variable, that has to be copied to index position i.
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::do_descent_step ( int  maxsteps = 0  )  [pure virtual]

Does a descent step for the current center point.

A descent step may consist of several function evaluations (null steps), that lead to no immediate progress but serve for building a cutting model of the objective function close to the current center point. A minimizer to the model is accepted as descent step if the function value at this point satisfies a sufficient decrease criterion in comparison to the decrease predicted by the model. Having found a descent step, the next center is automatically shifted to this successful candidate. Termination criteria may stop the process of seeking for a descent step, in which case the current center is kept and the routine termination_code() returns the termination code.

Restarting, after each descent step, the bundle method from scratch with the new center as starting point does not endanger convergence. Therefore, a descent step is the smallest unit, after which user interaction can take place safely and this is the default choice.

If you know what your are doing, you may also use the input parameter maxsteps to force the algorithm to return after at most maxsteps null steps. Calling do_descent_step again without any intermediate problem configurations will then simply continue the process where it stopped and convergence is save. During null steps one may not decrease the weight or delete nonzero variables of the center or the current candidate!

In a Lagrangean relaxation cutting plane approach one may want to separate and enlarge the dimension after a certain number of null steps. In this case the code will try to preserve the model, given appropriate subgradient extension routines have been provided. If the model cannot be extended, it has to be discarded (if subgradient extension is not successful this is done automatically), and the algorithm will be restarted from the current center point.

Parameters:
[in] maxsteps (int) if maxsteps>0 the code returns after at most so many null steps
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::termination_code (  )  const [pure virtual]

Returns the termination code of the bundle algorithm for the latest descent step.

For resetting all counters relevant for termination see clear_fail_counts() .

Returns:
  • 0 : Not terminated. (Continue with the next do_descent_step())
  • 1 : Relative precision criterion satisfied. (See set_term_relprec())
  • 2 : Timelimit exceeded. (Currently the C interface does not offer a timelimit.)
  • 4 : Maximum number of function reevaluations exceeded. (Indicates that there is a problem with one of the function oracles that seems to deliver no valid upper bounds on the true function value for descent steps)
  • 8 : Maximum number of quadratic subproblem failures exceeded. (Indicates that the numerical limits of the inner quadratic programming solver are reached, no further progress expected)
  • 16 : maximum number of model evaluation failures exceeded (Indicates that the numerical limits of the setup of the subproblem are reached, no further progress expected)
  • 32 : maximum number of failures to increase the augmented model value exceeded (Indicates that the numerical limits of the interplay between subproblem and quadratic programming solver are reached, no further progress expected)
    • 64 : maximum number of oracle calls (function evaluations) exceeded, see set_eval_limit()
    • 128 : maximum number of oracle failures exceeded. This refers to function evaluations that terminate with insufficient precision but still provide a new approximate subgradient. A failure typically indicates numerical difficulties with the precision requirements. (Currently the interface does not allow to manipulate the limit, it is set to 10)

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual std::ostream& ConicBundle::MatrixBSolver::print_termination_code ( std::ostream &  out  )  [pure virtual]

Outputs a text version of termination code, see termination_code().

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_center ( CH_Matrix_Classes::Matrix center  )  const [pure virtual]

Returns the next center point that was produced by the latest call to do_descent_step (in some problem modification routines the center point may be updated immediately, in others the center point will be corrected automatically directly before starting the next descent step and its values may be infeasible till then).

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_subgradient ( CH_Matrix_Classes::Matrix subgradient  )  const [pure virtual]

Returns the latest aggregate subgradient.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual double ConicBundle::MatrixBSolver::get_candidate_value (  )  const [pure virtual]

Returns the objective value computed in the last step of do_descent_step(), independent of whether this was a descent step or a null step (initially undefined).

If no problem modification routines were called since then, it is the objective value at the point returned by get_candidate(). If this last evaluation led to a descent step, then it is the same value as in get_objval().

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_candidate ( CH_Matrix_Classes::Matrix candidate  )  const [pure virtual]

Returns the last point, the "candidate", at which the function was evaluated in do_descent_step().

If this evaluation lead to a descent step, it is the same point as in get_center().

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_term_relprec ( const double  term_relprec  )  [pure virtual]

Sets the relative precision requirements for successful termination (default 1e-5).

Parameters:
[in] term_relprec (double) The algorithm stops with termination code 1, if predicted progress for the next step is less than term_relprec times absolute function value plus one.
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_new_center_point ( const CH_Matrix_Classes::Matrix center_point  )  [pure virtual]

Set the starting point/center that will be used in the next call to do_descent_step(). Each call to this routine causes an immediate evaluation of all oracles.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_approximate_slacks ( CH_Matrix_Classes::Matrix  )  const [pure virtual]

Returns the multipliers for the box constraints on the design variables; in Lagrangean relaxation they may be interpreted as primal slacks for inequality constraints.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_approximate_primal ( const FunctionObject function,
PrimalData primal 
) const [pure virtual]

returns the current approximate primal solution corresponding to the aggregate subgradient of the specified function.

PrimalData solutions must have been supplied in all previous calls to evaluate; In this case it returns the current approximate primal solution aggregated alongside with the aggregate subgradient. A primal solution may not be available after addition of constraints, if extension of the aggregate subgradient to the new coordinates failed.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_center_primal ( const FunctionObject function,
PrimalData primal 
) const [pure virtual]

Returns the primal solution corresponding to the best epsilon subgradient returned in the evaluation of the specified function at the current center point.

PrimalData solutions must have been supplied in all previous calls to evaluate; It may not be available or may correspond to an aggregate primal after addition or deletion of design variables/primal constraints.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_candidate_primal ( const FunctionObject function,
PrimalData primal 
) const [pure virtual]

Returns the primal solution returned by the last evaluation of the specified function in the point get_candidate().

It will only be available if also supplied by the function

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_max_bundlesize ( const FunctionObject function,
int  max_bundlesize 
) [pure virtual]

Sets the maximum number of subgradients used in forming the cutting model of the specified function.

Quite often a very small model, e.g., 2, yields very fast iterations and good progress in time (sometimes at the cost of more evaluations). By limited numerical experience, a significant reduction in the number of evaluations can only be expected if the bundle is large enough to wrap the function rather tightly. Quite frequently, unfortunately, this entails that solving the quadratic subproblems is more expensive than function evaluation.

The meaning of this routine may differ from standard for predefined special functions with special bundle types.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
[in] bundlesize (int) maximum number of subgradients to be used in forming the cutting model
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_max_new_subgradients ( const FunctionObject function,
int  max_new_subgradients 
) [pure virtual]

Sets the maximum number of new subgradients to be used in the next bundle update of the cutting modle for the specified .

The meaning of this routine may differ from standard for predefined special functions with special bundle types.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
[in] max_new_subgradients (int) maximum number of new epsilon subgradients to be used in bundle updates
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_bundle_parameters ( const FunctionObject function,
const BundleParameters params 
) [pure virtual]

Sets the maximum bundlesize and the maximum number of new subgradients added in a bundle update of the cutting model for the specified function. The meaning of this routine may differ from standard for predefined special functions with special bundle types.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
[in] params (const BundleParameters&) some update parameters for the cutting model, see e.g. ConicBundle::BundleParameters
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_bundle_parameters ( const FunctionObject function,
BundleParameters params 
) const [pure virtual]

Retrieves current bundle parameters (not the actual size in use!) as set for the cutting model of the specified function.

This may differ for predefined special functions with derived BundleParameter classes.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
[out] params (BundleParameters&)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::get_bundle_values ( const FunctionObject function,
BundleParameters params 
) const [pure virtual]

Returns the current bundle values: the current bundle_size and the number of subgradients added in the latest update of the cutting model of the specified function.

This may differ for predefined special functions with derived BundleParameter classes.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
[out] params (BundleParameters&)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::reinit_function_model ( const FunctionObject function  )  [pure virtual]

Clears cutting model, subgradients and stored function values for the specified function.

This has to be called whenever the specified function was modified so that the old subgradients and/or primal generators are no longer valid.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::clear_aggregates ( const FunctionObject function  )  [pure virtual]

Clears the aggregate parts of the cutting model of this function.

This has to be called whenever the specified function was modified so that the old aggregate subgradients and/or primal generators are no longer valid.

Parameters:
[in] function (const FunctionObject&) the function added in add_function()
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_next_weight ( const double  weight  )  [pure virtual]

Sets the weight (>0) to be used in the quadratic term of the next augmented subproblem (may be interpreted as 1./step_size or 1./trustregion-radius).

Independent of whether the weight violates current min- and max-bounds set in set_min_weight() and set_max_weight(), the next model will be computed for this value. Thereafter, however, it will be updated as usual; in particular, it may be truncated by min and max bounds immediately after the first subproblem.

In order to guarantee a constant weight (e.g. 1 is frequently a reasonable choice if the automatic default heuristic performs poorly), set the min and max bounds to the same value, too.

Parameters:
[in] weight (double)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_min_weight ( const double  min_weight  )  [pure virtual]

Sets a lower bound on the weight for the quadratic term of the augmented subproblem.

Nonpositive values indicate no bound. The new value shows its effect only at first dynamic change of the weight.

Parameters:
[in] min_weight (double)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_max_weight ( const double  max_weight  )  [pure virtual]

Sets an upper bound on the weight for the quadratic term of the augmented subproblem.

Nonpositive values indicate no bound. The new value shows its effect only at first dynamic change of the weight.

Parameters:
[in] max_weight (double)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::adjust_multiplier ( void   )  [pure virtual]

Adjusts on all conic functions the penalty parameter for conic violations to twice the trace of the primal approximation.

This routine is only needed for conic function objects such as the nonnegative cone, the second order cone and the semidefinite cone if no good upper bound on the trace of feasible points is known and has to be determined automatically.

If after some time, the trace values settle, the upper bounds on the trace may be way to high and can then be reset with this call.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_scaling ( bool  do_scaling  )  [pure virtual]

Use a scaling heuristic or switch off scaling alltogether.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual int ConicBundle::MatrixBSolver::set_scaling ( const CH_Matrix_Classes::Matrix scale  )  [pure virtual]

user defined diagonal scaling, values greater than 1 allow more movement for this variable, values smaller than 1 allow less movement.

It is the users responsibility to guarantee that the scaling vector fits in dimension to the runnig problem data, in particular if routines such as append_variables(), delete_variables(), and reassign_variables() are used.

Parameters:
[in] scale (const Matrix&)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual void ConicBundle::MatrixBSolver::set_active_bounds_fixing ( bool  allow_fixing  )  [pure virtual]

If set to true (the default is false), some variables will be fixed automatically to the center value if their bounds are strongly active (i.e., the corresponding multipliers are big).

The coordinates to be fixed are redetermined in each call following a descent step or a change of the function. An indicator vector of the variables fixed in the last call can be obtained via the routine get_active_bounds_indicator().

Setting this value to true might improve the performance of the algorithm in some instances but there is no convergence theory. It might be particularly helpful within Lagrangian relaxation if a primal cutting plane approach is used and non-tight inequalities should be eliminated quickly (fixing then indicates large primal slack values).

Parameters:
[in] allow_fixing (bool)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual void ConicBundle::MatrixBSolver::clear_fail_counts ( void   )  [pure virtual]

clears all fail counts on numerical function oder model failures, may be useful if this caused premature termination.

Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual void ConicBundle::MatrixBSolver::set_eval_limit ( CH_Matrix_Classes::Integer  eval_limit  )  [pure virtual]

Sets an upper bound on the number of calls to the oracle (use negative numbers for no limit).

If this number is reached, the algorithm will terminate independently of whether the last step was a descent or a null step. A negative number will be interepreted as no limit.

Parameters:
[in] eval_limit (Integer)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual void ConicBundle::MatrixBSolver::set_inner_update_limit ( CH_Matrix_Classes::Integer  update_limit  )  [pure virtual]

Set an upper bound on the number of inner updates for the cutting model with primal slacks within one null step (use negative numbers for no limit).

A negative number will be interepreted as no limit, i.e., the updates will be done till a certain precision of the cutting model is achieved.

Parameters:
[in] update_limit (Integer)
Returns:
  • 0 on success
  • != 0 otherwise

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual const CH_Matrix_Classes::Indexmatrix& ConicBundle::MatrixBSolver::get_active_bounds_indicator (  )  const [pure virtual]

Returns the indicator vector of variables temporarily fixed to the center value due to significantly positive multipliers for the box constraints.

Such a fixing indicates that the corresponding variables would like to stay at their bounds. If no variables were fixed, the dimension of the vector is zero.

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.

virtual void ConicBundle::MatrixBSolver::set_out ( std::ostream *  out = 0,
int  print_level = 1 
) [pure virtual]

Specifies the output level (out==NULL: no output at all, out!=NULL and level=0: errors and warnings, level>0 increasingly detailed information).

Parameters:
[in] out (ostream*) direct all output to (*out). If out==NULL, there will be no output at all.
[in] print_level (int)
Output levels for print_level:
  • 0 ... no output except for errors and warnings
  • 1 ... line summary after each descent step
  • >1 ... undocumented and increasingly detailed log information. These higher levels should only be used if requested for debugging purposes.

Example for level 1:

00:00:00.00 endit  1   1   1   563.    563.  39041.188  39043.162
00:00:00.00 endit  2   2   2   563.    559.  38488.165  38490.200
00:00:00.00 endit  3   3   3   56.3    555.  33014.533  33211.856
00:00:00.00 endit  4   4   4   5.63    517. -14306.459  2738.0343
00:00:00.00 endit  5   5   5   4.04    148. -2692.1131  2.2150883
00:00:00.00 endit  6   6   6   4.01    1.29  1.7908952  2.0000581
00:00:00.00 endit  7   7   7   3.95  0.0213  1.9999387  2.0000000
00:00:00.00 _endit  8   8   8   3.95 2.94e-05  2.0000000  2.0000000

Column 1      2     3   4   5    6       7       8          9
  • Column 1: computation time in hh:mm:ss.dd,
  • Column 2: "endit" is convenient for grep and stands for "end of iteration". Iterations with termination_code()!=0 are marked with "_endit".
  • Column 3: number of descent steps (= calls to do_descent_step())
  • Column 4: number of descent and null steps. Up to initialization calls and reevaluations, this is the number of evaluation calls to the function oracles from within the bundle method. In the example all calls led to descent steps.
  • Column 5: number of innermost iterations. It differs from column 5 only in the case of variables with bounds in which case it gives the number of updates of the multipliers for the bounds (or primal slacks in Lagrangean relaxation). Exceedingly high numbers in this column indicate that some variables are constantly at their bounds and it might be possible to improve convergence by deleting them (i.e. set them as constants to this bound and remove the variable).
  • Column 6: the weight of the quadratic term in the augmented problem.
  • Column 7: the norm of the aggregate subgradient. If it is small, say below 0.1, then mostly this is good indication that the objective value is close to optimal.
  • Column 8: the value of the cutting model in the last candidate point. It is always a lower bound on the true function value in this point
  • Column 9: the objective value in the latest point that led to a descent step, i.e., the point returend by get_center(). Whenever termination_code() returns 0 this is also the objective value of the latest evaluation call to the function oracles and the value in the center point of the next iteration.

Implemented in ConicBundle::MatrixFCBSolver, and ConicBundle::MatrixNBSolver.


The documentation for this class was generated from the following file:

Generated on Mon Nov 8 19:36:41 2010 for ConicBundle by  doxygen 1.5.6