ConicBundle
NNCBoxSupportFunction.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_NNCBOXSUPPORTFUNCTION_HXX
4 #define CONICBUNDLE_NNCBOXSUPPORTFUNCTION_HXX
5 
13 //------------------------------------------------------------
14 
15 #include <map>
16 #include "MatrixCBSolver.hxx"
18 
19 //------------------------------------------------------------
20 
21 namespace ConicBundle {
22 
111 
112  class NNCBoxSupportFunction;
113 
125  {
126  private:
129 
130  public:
133 
136 
137  /*@brief called by ConicBundle to update internal Minorant objects, has to return 0 on success
138 
139  for each relevant index i the minorant value is set to the projection
140  of 0 onto the interval [lower_bound(i),upper_bound(i)]
141 
142  @param[in,out] minorant (Minorant&)
143  it holds a (possibly aggregated) minorant that was generated
144  from minorants returned by oracle calls, e.g. as in
145  FunctionOracle::evaluate()
146 
147  @param[in] n_coords (int)
148  the number of coordinate positions that have to be filled in
149 
150  @param[out] new_subgradient_values (DVector &)
151  the indices of these coordinate positions (sorted in
152  strictly increasing order)
153 
154  @return
155  - 0 on success,
156  - 1 if extension/update is impossible
157 
158  */
159  int extend(Minorant& minorant,int n_coords,const int* indices);
160 
161  };
162 
163 
164 
169  {
170  private:
173 
175  int apply_modification(const NNCBoxSupportModification& mod);
176 
177  public:
182  const CH_Matrix_Classes::Matrix& ub,
183  const CBout* cb=0,int incr=-1);
184 
187 
189 
190  //----------- Oracle Implementation of MatrixFunctionOracle ----------
193 
195  int evaluate(const CH_Matrix_Classes::Matrix& current_point,
196  CH_Matrix_Classes::Real relprec,
197  CH_Matrix_Classes::Real& objective_value,
198  std::vector<Minorant*>& minorants,
199  PrimalExtender*& primal_extender);
200 
201 
206  virtual
207  int
208  apply_modification
209  (
210  const OracleModification& oracle_modification ,
211  const CH_Matrix_Classes::Matrix* new_center,
212  const CH_Matrix_Classes::Matrix* old_center,
213  bool& discard_objective_in_center,
214  bool& discard_model,
215  bool& discard_aggregates,
216  MinorantExtender*& minorant_extender
217  );
218 
219 
221  virtual
222  bool
224  {return true;}
226 
227 
228  //------------------ routines for querying the problem ----------------
231 
234 
237 
239 
240 
241  //------------------ routines for IO ----------------
244 
246  void set_out(std::ostream* o=0,int pril=1);
248  void set_cbout(const CBout* cb,int incr=-1);
249 
251  std::ostream& print_problem_data(std::ostream& out) const;
252 
254  std::istream& read_problem_data(std::istream& in);
255 
257  std::ostream& print_problem_data_to_mfile(std::ostream& out, CH_Matrix_Classes::Integer blocknr) const;
258  //std::istream& read_problem_data_from_mfile(std::istream& in);
259 
260 
261  };
262 
263 
264 }
265 
267 
268 #endif
269 
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
CH_Matrix_Classes::Matrix ub
column vector of upper bounds
Definition: NNCBoxSupportFunction.hxx:172
Implementation of MinorantExtender for NNCBoxSupportFunction.
Definition: NNCBoxSupportFunction.hxx:124
general purpose implementation of MatrixFunctionOracle as explained in implemention of MatrixFunction...
Definition: NNCBoxSupportFunction.hxx:168
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
Collects modifications for NNCBoxSupport for appending, deleting or reassigning variables and respect...
Definition: NNCBoxSupportModification.hxx:32
NNCBoxSupportFunction * fun
the oracle this MinorantExtender was generated by, needed for retrieving problem data ...
Definition: NNCBoxSupportFunction.hxx:128
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::Matrix lb
column vector of lower bounds
Definition: NNCBoxSupportFunction.hxx:171
NNCBoxSupportMinorantExtender(NNCBoxSupportFunction *fun)
the NNCBoxSupportFunction pointed to has to be valid for the livetime of this object ...
const CH_Matrix_Classes::Matrix & get_lower_bounds()
returns the column vector of lower bounds
Definition: NNCBoxSupportFunction.hxx:233
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
Header declaring the class ConicBundle::NNCBoxSupportModification.
const CH_Matrix_Classes::Matrix & get_upper_bounds()
retunrs the column vector of upper bounds
Definition: NNCBoxSupportFunction.hxx:236
virtual void set_out(std::ostream *out=0, int print_level=1)
Specifies the output level (out==NULL: no output at all, out!=NULL and level=0: errors and warnings...
virtual bool check_correctness() const
see MatrixFunctionOracle::check_correctness() (true only needed for debugging)
Definition: NNCBoxSupportFunction.hxx:223
Matrix class for real values of type Real
Definition: matrix.hxx:74
std::ostream * out
not output at all if out==0, otherwise use this output stream
Definition: CBout.hxx:33
Header declaring the classes ConicBundle::MatrixCBSolver, ConicBundle::MatrixFunctionOracle, ConicBundle::PrimalMatrix, ConicBundle::MatrixMinorant, ConicBundle::ModifiableOracleObject.
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
int extend(Minorant &minorant, int n_coords, const int *indices)
called by ConicBundle to update internal Minorant objects, has to return 0 on success ...
virtual void set_cbout(const CBout *cb, int incr=-1)
Specifies the output level relative to the given CBout class.