ConicBundle
CFunction.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_CFUNCTION_HXX
4 #define CONICBUNDLE_CFUNCTION_HXX
5 
13 //------------------------------------------------------------
14 
15 #include "MatrixCBSolver.hxx"
16 #include "cb_cinterface.h"
17 
18 //------------------------------------------------------------
19 
20 
21 namespace ConicBundle {
25 
30  class CFunction: public CBout, public MatrixFunctionOracle
31  {
32  private:
33  void* function_key;
38 
39  public:
41  CFunction(void* fk,cb_functionp fp,cb_subgextp se=0,int prdim=0);
44 
48 
50  int evaluate(
51  const CH_Matrix_Classes::Matrix& current_point,
52  double relprec,
53  double& objective_value,
54  std::vector<Minorant*>& minorants,
56  );
57 
60  (
61  const OracleModification& oracle_modification ,
62  const CH_Matrix_Classes::Matrix* new_center ,
63  const CH_Matrix_Classes::Matrix* old_center ,
64  bool& discard_objective_in_center ,
65  bool& discard_model ,
66  bool& discard_aggregates ,
67  MinorantExtender*& minorant_extender
68  );
69 
70 
71  };
72 
74 
78 
84  {
85  private:
86  void* function_key;
88 
89  public:
91  CFunctionMinorantExtender(void* fk,cb_subgextp se):function_key(fk),subgext(se)
92  { assert(se); }
93 
96 
98  int extend(Minorant& minorant,int n_coords,const int* indices);
99  };
100 
102 
103 }
104 #endif
105 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
Base class for informing oracles (or the solver) about dynamic changes in the number and sorting of t...
Definition: CBSolver.hxx:544
cb_functionp oracle
c-function for evaluate
Definition: CFunction.hxx:34
void * function_key
identifier for c-code
Definition: CFunction.hxx:86
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
Oracle interface (abstract class). For each of your functions, provide an instance of a derived class...
Definition: MatrixCBSolver.hxx:404
CH_Matrix_Classes::Integer primaldim
length of primal vectors; uses PrimalMatrix
Definition: CFunction.hxx:36
int(* cb_functionp)(void *function_key, double *arg, double relprec, int max_subg, double *objective_value, int *n_subgrads, double *subg_values, double *subgradients, double *primal)
function oracle; describe your function as a function of this type to pass it to the solver ...
Definition: cb_cinterface.h:205
Header declaring Interface to ConicBundle for language C.
CFunction(void *fk, cb_functionp fp, cb_subgextp se=0, int prdim=0)
constructor
cb_subgextp subgext
c-function for subgradient extension
Definition: CFunction.hxx:35
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
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
~CFunction()
destructor
Definition: CFunction.hxx:43
cb_subgextp subgext
c-function for subgradient extension
Definition: CFunction.hxx:87
~CFunctionMinorantExtender()
destructor
Definition: CFunction.hxx:95
void set_max_new(CH_Matrix_Classes::Integer mn)
set the maximum number of new subgardients per evaluations
Definition: CFunction.hxx:46
Matrix class for real values of type Real
Definition: matrix.hxx:74
int evaluate(const CH_Matrix_Classes::Matrix &current_point, double relprec, double &objective_value, std::vector< Minorant *> &minorants, PrimalExtender *&)
see MatrixFunctionOracle::evaluate() for explanations
double max(double a, double b)
maximum value of two double variables
Definition: mymath.hxx:43
Header declaring the classes ConicBundle::MatrixCBSolver, ConicBundle::MatrixFunctionOracle, ConicBundle::PrimalMatrix, ConicBundle::MatrixMinorant, ConicBundle::ModifiableOracleObject.
void * function_key
identifier for c-code
Definition: CFunction.hxx:33
int(* cb_subgextp)(void *function_key, double *generating_primal, int n_indices, int *variable_indices, double *new_subgradient_values)
This routine is not needed unless variabls (constraints in Lagrangean relaxation) are added on the fl...
Definition: cb_cinterface.h:306
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
MinorantExtender for CFunction.
Definition: CFunction.hxx:83
for the "C" interface this maps c oracles to the standard function oracle with matrix classes ...
Definition: CFunction.hxx:30
int apply_modification(const OracleModification &oracle_modification, const CH_Matrix_Classes::Matrix *new_center, const CH_Matrix_Classes::Matrix *old_center, bool &discard_objective_in_center, bool &discard_model, bool &discard_aggregates, MinorantExtender *&minorant_extender)
see MatrixFunctionOracle::apply_modfication() for explanations
CH_Matrix_Classes::Integer max_new
maximum number of new vectors per call
Definition: CFunction.hxx:37
CFunctionMinorantExtender(void *fk, cb_subgextp se)
constructor
Definition: CFunction.hxx:91