ConicBundle
LPGroundsetModification.hxx
Go to the documentation of this file.
1 
2 
3 
4 #ifndef CONICBUNDLE_LPGROUNDSETMODIFICATION_HXX
5 #define CONICBUNDLE_LPGROUNDSETMODIFICATION_HXX
6 
7 
16 
17 namespace ConicBundle {
18 
22 
33 {
34 protected:
35  //Modification mdf;
36 
37 public:
38  //-----------------------------------------------------------------------
42 
45  {mdf.clear(var_olddim,row_olddim);offset=0.;}
46 
49  {clear(var_olddim,row_olddim);}
50 
51  virtual ~LPGroundsetModification();
52 
53 
55 
56  //-----------------------------------------------------------------------
60 
61 
69  {return mdf.add_set_lb(ind,lb);}
70 
78  {return mdf.add_set_ub(ind,ub);}
79 
80  //int add_append_vars(CH_Matrix_Classes::Integer append_dim,
81  // const CH_Matrix_Classes::Matrix* start_val=0)
82 
85  const CH_Matrix_Classes::Matrix* append_lb,
86  const CH_Matrix_Classes::Matrix* append_ub,
87  const CH_Matrix_Classes::Sparsemat* append_cols,
88  const CH_Matrix_Classes::Matrix* start_val,
89  const CH_Matrix_Classes::Matrix* append_costs)
90  {return mdf.add_append_vars(append_dim,append_lb,append_ub,append_cols,start_val,append_costs);}
91 
92  //int add_reassign_vars(const CH_Matrix_Classes::Indexmatrix& map_to_old);
93 
94  //int add_delete_vars(const CH_Matrix_Classes::Indexmatrix& del_ind,
95  // CH_Matrix_Classes::Indexmatrix& map_to_old);
96 
104  {return mdf.add_set_rhslb(ind,rhslb);}
105 
113  {return mdf.add_set_rhslb(ind,rhsub);}
114 
117  const CH_Matrix_Classes::Sparsemat* append_rows,
118  const CH_Matrix_Classes::Matrix* append_rhslb,
119  const CH_Matrix_Classes::Matrix* append_rhsub)
120  { return mdf.add_append_rows(append_dim,append_rows,append_rhslb,append_rhsub);}
121 
122  //int add_reassign_rows(const CH_Matrix_Classes::Indexmatrix& map_to_old);
123 
124  //int add_delete_rows(const CH_Matrix_Classes::Indexmatrix& rows_del_ind,
125  // CH_Matrix_Classes::Indexmatrix& rows_map_to_old);
126 
127  //int incorporate(const GroundsetModification& m);
128 
132  {
133  const LPGroundsetModification* lpgm=dynamic_cast<const LPGroundsetModification*>(&m);
134  if (lpgm) {offset+=lpgm->offset; return mdf.incorporate(lpgm->mdf);}
136  }
137 
140  {return new LPGroundsetModification(old_var_dim,0);}
141 
143 
144  //-----------------------------------------------------------------------
149 
150  //int apply_to_vars(CH_Matrix_Classes::Matrix& vars) const
151 
154  CH_Matrix_Classes::Matrix& ub) const
155  {return mdf.apply_to_vars(0,&lb,&ub,0);}
156 
157  //int apply_to_costs(CH_Matrix_Classes::Matrix& costs,CH_Matrix_Classes::Real& offset) const
158 
162  CH_Matrix_Classes::Matrix& rhsub) const
163  {return mdf.apply_to_rows(&rows,&rhslb,&rhsub);}
164 
166 
167  //-----------------------------------------------------------------------
172 
173  //bool no_modification() const;
174 
175  //bool no_additions_or_deletions_in_vars() const
176 
177  //bool deleted_variables_are_zero(const CH_Matrix_Classes::Matrix& oldpoint) const
178 
179  //bool new_variables_are_zero(const CH_Matrix_Classes::Matrix& newpoint) const
180 
181  //bool mapped_variables_are_equal(const CH_Matrix_Classes::Matrix& newpoint,
182  // const CH_Matrix_Classes::Matrix& oldpoint) const
183 
185 
186  //-----------------------------------------------------------------------
191 
192  //CH_Matrix_Classes::Integer old_vardim() const;
193  //CH_Matrix_Classes::Integer new_vardim() const;
194  //CH_Matrix_Classes::Integer appended_vardim() const;
195 
202 
203  //const CH_Matrix_Classes::Indexmatrix* map_to_old_variables() const;
204 
205  //const CH_Matrix_Classes::Indexmatrix* deleted_var_indices() const;
206 
207  //const CH_Matrix_Classes::Indexmatrix* new_var_indices() const;
208 
209  //const CH_Matrix_Classes::Indexmatrix* map_to_old_rows() const;
210 
211  //const CH_Matrix_Classes::Indexmatrix* deleted_row_indices() const;
212 
213  //const CH_Matrix_Classes::Indexmatrix* new_row_indices() const;
214 
215 };
216 
217 
218 
220 
221 }
222 
223 #endif
224 
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
int add_set_ub(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real ub)
set the upper bound on variable with index ind to value ub
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
int add_append_vars(CH_Matrix_Classes::Integer append_dim, const CH_Matrix_Classes::Matrix *append_lb, const CH_Matrix_Classes::Matrix *append_ub, const CH_Matrix_Classes::Sparsemat *append_cols, const CH_Matrix_Classes::Matrix *start_val, const CH_Matrix_Classes::Matrix *append_costs)
append append_dim new variables with lower bounds append_lb (NULL: default value) and upper bounds ap...
Definition: LPGroundsetModification.hxx:84
CH_Matrix_Classes::Integer new_rowdim() const
returns the number of rows once all stored modifications have been performed
Definition: LPGroundsetModification.hxx:199
int add_set_lb(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real lb)
set the lower bound on variable with index ind to value lb
Definition: LPGroundsetModification.hxx:68
CH_Matrix_Classes::Integer appended_rowdim() const
returns the number of rows that are appended (due to later reassignments they may no longer be locate...
Definition: Modification.hxx:680
int incorporate(const OracleModification &m)
Definition: LPGroundsetModification.hxx:131
CH_Matrix_Classes::Integer old_rowdim() const
returns the number of rows before modification (given on initialization)
Definition: LPGroundsetModification.hxx:197
int add_append_rows(CH_Matrix_Classes::Integer append_dim, const CH_Matrix_Classes::Sparsemat *append_rows, const CH_Matrix_Classes::Matrix *append_rhslb, const CH_Matrix_Classes::Matrix *append_rhsub)
append append_dim new rows as in append_rows (if NULL, use default value) with lower bound append_rhs...
Definition: LPGroundsetModification.hxx:116
int apply_to_rows(CH_Matrix_Classes::Sparsemat *rows, CH_Matrix_Classes::Matrix *rhslb, CH_Matrix_Classes::Matrix *rhsub) const
carry out the collected modifications on the given vectors
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
int add_set_rhsub(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real rhsub)
set the upper bound on row right hand side with index ind to value rhsub
Definition: LPGroundsetModification.hxx:112
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
int apply_to_vars(CH_Matrix_Classes::Matrix *vars, CH_Matrix_Classes::Matrix *lb, CH_Matrix_Classes::Matrix *ub, CH_Matrix_Classes::Matrix *cost) const
carry out the collected modifications on the given vectors
int clear(CH_Matrix_Classes::Integer var_olddim, CH_Matrix_Classes::Integer row_olddim, bool ensure_start_val_box_feasibility=false, bool ensure_bounds_consistency=true, CH_Matrix_Classes::Real start_val_def=0., CH_Matrix_Classes::Real bounds_minus_infty=CB_minus_infinity, CH_Matrix_Classes::Real bounds_plus_infty=CB_plus_infinity, CH_Matrix_Classes::Real rhs_minus_infty=CB_minus_infinity, CH_Matrix_Classes::Real rhs_plus_infty=CB_plus_infinity, CH_Matrix_Classes::Real cost_def=0.)
resets all variables so that the object to be modified has starting size var_olddim (number of variab...
void clear(CH_Matrix_Classes::Integer var_olddim, CH_Matrix_Classes::Integer row_olddim)
reset modifications to an unmodified object currently having var_olddim variables and row_olddim cons...
Definition: LPGroundsetModification.hxx:44
CH_Matrix_Classes::Integer appended_rowdim() const
returns the number of rows that are appended (due to later reassignments they may no longer be locate...
Definition: LPGroundsetModification.hxx:201
int add_set_rhslb(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real rhslb)
set the lower bound on row right hand side with index ind to value rhslb
Definition: LPGroundsetModification.hxx:103
int apply_to_rows(CH_Matrix_Classes::Sparsemat &rows, CH_Matrix_Classes::Matrix &rhslb, CH_Matrix_Classes::Matrix &rhsub) const
carry out the collected modification on the constraint matrix and the corresponding lower and upper b...
Definition: LPGroundsetModification.hxx:160
int add_set_rhslb(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real rhslb)
set the lower bound on row right hand side with index ind to value rhslb
Matrix class for real values of type Real
Definition: matrix.hxx:74
Header declaring the class ConicBundle::GroundsetModification.
int apply_to_bounds(CH_Matrix_Classes::Matrix &lb, CH_Matrix_Classes::Matrix &ub) const
carry out the collected modifications on the given vectors of lower and upper bounds on the variables...
Definition: LPGroundsetModification.hxx:153
Collects modifications for the linearly constrained LPGroundset for appending, deleting or reassignin...
Definition: LPGroundsetModification.hxx:32
Modification mdf
this class provides a restricted interface to this Modification instance where all modifications are ...
Definition: GroundsetModification.hxx:36
Matrix class of sparse matrices with real values of type Real
Definition: sparsmat.hxx:74
OracleModification * new_initial_oraclemodification(int old_var_dim) const
returns a new object on the heap, that allows to incorporate this but starts off from a function whos...
Definition: LPGroundsetModification.hxx:139
CH_Matrix_Classes::Integer old_rowdim() const
returns the number of rows before modification (given on initialization)
Definition: Modification.hxx:676
Collects modifications for the unconstrained Groundset for appending, deleting or reassigning variabl...
Definition: GroundsetModification.hxx:32
int add_set_lb(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real lb)
set the lower bound on variable with index ind to value lb
int add_append_rows(CH_Matrix_Classes::Integer append_dim, const CH_Matrix_Classes::Sparsemat *append_rows, const CH_Matrix_Classes::Matrix *append_rhslb, const CH_Matrix_Classes::Matrix *append_rhsub)
append information on new rows at the respective ends
int add_set_ub(CH_Matrix_Classes::Integer ind, CH_Matrix_Classes::Real ub)
set the upper bound on variable with index ind to value ub
Definition: LPGroundsetModification.hxx:77
CH_Matrix_Classes::Real offset
specifies which value should be added to the offset of the groundset objective
Definition: GroundsetModification.hxx:38
LPGroundsetModification(CH_Matrix_Classes::Integer var_olddim, CH_Matrix_Classes::Integer row_olddim, const CBout *cbo=0, int incr=-1)
calls clear(var_olddim,row_olddim)
Definition: LPGroundsetModification.hxx:48
int add_append_vars(CH_Matrix_Classes::Integer append_dim, const CH_Matrix_Classes::Matrix *append_lb, const CH_Matrix_Classes::Matrix *append_ub, const CH_Matrix_Classes::Sparsemat *append_cols, const CH_Matrix_Classes::Matrix *append_start_val, const CH_Matrix_Classes::Matrix *append_linear_costs)
append information on new variables at the respective ends
virtual int incorporate(const Modification &m)
add the modification specified in m on top of the modifications collected so far
CH_Matrix_Classes::Integer new_rowdim() const
returns the number of rows once all stored modifications have been performed
Definition: Modification.hxx:678
int incorporate(const OracleModification &m)
incorporate the OracleModification m (it should only contain variable changes, but this is not checke...
Definition: GroundsetModification.hxx:168