ConicBundle
SOCSupportFunction.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_SOCSUPPORTFUNCTION_HXX
4 #define CONICBUNDLE_SOCSUPPORTFUNCTION_HXX
5 
13 //------------------------------------------------------------
14 
15 #include <map>
17 #include "SOCOracle.hxx"
18 
19 //------------------------------------------------------------
20 
21 namespace ConicBundle {
22 
93 
95  class SOCSupportFunction;
96 
108  {
109  private:
112 
113  public:
116 
119 
120  /*@brief called by ConicBundle to update internal Minorant objects, has to return 0 on success
121 
122  for each relevant index i the minorant value is set to the projection
123  of 0 onto the interval [lower_bound(i),upper_bound(i)]
124 
125  @param[in,out] minorant (Minorant&)
126  it holds a (possibly aggregated) minorant that was generated
127  from minorants returned by oracle calls, e.g. as in
128  FunctionOracle::evaluate()
129 
130  @param[in] n_coords (int)
131  the number of coordinate positions that have to be filled in
132 
133  @param[out] new_subgradient_values (DVector &)
134  the indices of these coordinate positions (sorted in
135  strictly increasing order)
136 
137  @return
138  - 0 on success,
139  - 1 if extension/update is impossible
140 
141  */
142  int extend(Minorant& minorant,int n_coords,const int* indices);
143 
144  };
145 
146 
147 
151  class SOCSupportFunction: public SOCOracle, public CBout
152  {
153  private:
156 
158  int apply_modification(const SOCSupportModification& mod);
159 
160  public:
163 
165  SOCSupportFunction(CH_Matrix_Classes::Integer socdim,const CBout* cb=0,int incr=-1);
166 
168  ~SOCSupportFunction(){}
169 
171 
172  //----------- Oracle Implementation of SOCOracle ----------
175 
177  Minorant* generate_minorant(const CH_Matrix_Classes::Matrix& SOCvec);
178 
180  int extract_SOCvector(CH_Matrix_Classes::Matrix& SOCvec, const Minorant* SOCminorant);
181 
183  int projection(CH_Matrix_Classes::Matrix& offset,
185  const CH_Matrix_Classes::Matrix& bar_P,
186  const CH_Matrix_Classes::Indexmatrix* index_subset=0);
187 
189  virtual
190  int
191  evaluate
192  (
193  const CH_Matrix_Classes::Matrix& current_point,
194  const CH_Matrix_Classes::Real relprec,
195  CH_Matrix_Classes::Real& SOC_value,
196  CH_Matrix_Classes::Matrix& SOC_vector,
197  SOCPrimalExtender*& primal_extender
198  );
199 
201  virtual
202  int
203  evaluate_projection
204  (
205  const CH_Matrix_Classes::Matrix& current_point,
206  const CH_Matrix_Classes::Matrix& P,
207  const CH_Matrix_Classes::Real relprec,
208  CH_Matrix_Classes::Real& projected_SOC_value
209  );
210 
211 
216  virtual
217  int
218  apply_modification
219  (
220  const OracleModification& oracle_modification ,
221  const CH_Matrix_Classes::Matrix* new_center,
222  const CH_Matrix_Classes::Matrix* old_center,
223  bool& discard_objective_in_center,
224  bool& discard_model,
225  bool& discard_aggregates,
226  MinorantExtender*& minorant_extender
227  );
228 
229 
231  virtual
232  bool
234  {return true;}
236 
237 
238  //------------------ routines for querying the problem ----------------
241 
244 
245 
247 
248 
249  //------------------ routines for IO ----------------
252 
254  void set_out(std::ostream* o=0,int pril=1);
256  void set_cbout(const CBout* cb,int incr=-1);
257 
259  std::ostream& print_problem_data(std::ostream& out) const;
260 
262  std::istream& read_problem_data(std::istream& in);
263 
265  std::ostream& print_problem_data_to_mfile(std::ostream& out, CH_Matrix_Classes::Integer blocknr) const;
266  //std::istream& read_problem_data_from_mfile(std::istream& in);
267 
268 
269  };
270 
271 
273 
274 }
275 
276 #endif
277 
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
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
SOCSupportFunction * fun
the oracle this MinorantExtender was generated by, needed for retrieving problem data ...
Definition: SOCSupportFunction.hxx:111
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
Oracle interface for minimization of the support function over the seoncd order cone with for an aff...
Definition: SOCOracle.hxx:186
virtual bool check_correctness() const
see SOCOracle::check_correctness() (true only needed for debugging)
Definition: SOCSupportFunction.hxx:233
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: SOCOracle.hxx:141
general purpose implementation of SOCOracle as explained in implemention of a SOCOracle (SOCSupportFu...
Definition: SOCSupportFunction.hxx:151
Implementation of MinorantExtender for SOCSupportFunction.
Definition: SOCSupportFunction.hxx:107
this is used to describe affine minorants of convex functions that will be used for generating cuttin...
Definition: CBSolver.hxx:274
Header declaring the class ConicBundle::SOCSupportModification.
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
int extend(Minorant &minorant, int n_coords, const int *indices)
called by ConicBundle to update internal Minorant objects, has to return 0 on success ...
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
Header declaring the classes ConicBundle::SOCOracle and ConicBundle::SOCBundleParameters (needed for ...
Collects modifications for SOCSupportFunction for appending, deleting or reassigning variables...
Definition: SOCSupportModification.hxx:32
CH_Matrix_Classes::Integer get_socdim()
returns the dimension of the second order cone
Definition: SOCSupportFunction.hxx:243
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...
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
CH_Matrix_Classes::Integer socdim
dimension of the second order cone (for consistency checks)
Definition: SOCSupportFunction.hxx:155
SOCSupportMinorantExtender(SOCSupportFunction *fun)
the SOCSupportFunction pointed to has to be valid for the livetime of this object ...
virtual void set_cbout(const CBout *cb, int incr=-1)
Specifies the output level relative to the given CBout class.