ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization Version of the Day

Constraints subclass that is used to represent generic varaible bounds, and general inequality and equality constraints. More...
#include <ConstrainedOptPack_ConstraintsRelaxedStd.hpp>
Classes  
class  MatrixConstraints 
Matrix type for A_bar. More...  
Public Types  
enum  EInequalityPickPolicy 
More...  
Public member functions  
STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, bounds_tol)  
<<std comp>="">> members for feasibility tolerance for the bound constriants.  
STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, inequality_tol)  
<<std comp>="">> members for feasibility tolerance for the general inequality constraints.  
STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, equality_tol)  
<<std comp>="">> members for feasibility tolerance for the general equality constriants.  
STANDARD_MEMBER_COMPOSITION_MEMBERS (EInequalityPickPolicy, inequality_pick_policy)  
<<std comp>="">> members for policy used to select a violated constraint.  
ConstraintsRelaxedStd ()  
Constructs to uninitialized.  
void  initialize (const VectorSpace::space_ptr_t &space_d_eta, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, size_type m_undecomp, const size_type j_f_undecomp[], VectorMutable *Ed, bool check_F=true, value_type bounds_tol=1e10, value_type inequality_tol=1e10, value_type equality_tol=1e10) 
Initialize constriants.  
const MatrixConstraints &  A_bar_relaxed () const 
 
Overridden from Constraints  
size_type  n () const 
 
size_type  m_breve () const 
 
const MatrixOp &  A_bar () const 
Represents the constraints matrix.  
void  pick_violated_policy (EPickPolicy pick_policy) 
 
EPickPolicy  pick_violated_policy () const 
 
void  pick_violated (const DVectorSlice &x, size_type *j_viol, value_type *constr_val, value_type *viol_bnd_val, value_type *norm_2_constr, EBounds *bnd, bool *can_ignore) const 
Here the next violated constraint to add to the active set is selected.  
void  ignore (size_type j) 
 
value_type  get_bnd (size_type j, EBounds bnd) const 

Constraints subclass that is used to represent generic varaible bounds, and general inequality and equality constraints.
The generic constraints represented by this class are those of the QPSolverRelaxed
interface which are:
(1.2) etaL <= eta (1.3) dL <= d <= dU (1.4) eL <= op(E)*d  b*eta <= eU (1.5) P_u'*op(F)*d + (1  eta) * P_u'*f = 0
These constraints are converted into the form:
[ dL ] [ I ] [ dU ] [ etaL ] <= [ 1 ] * [ d ] <= [ inf ] (2) [ eL ] [ op(E) b ] [ eta ] [ eU ] [ P_u'*f ] [ P_u'*op(F) P_u'*f ] [ P_u'*f ] \_________/ \______________________/ \_____/ \_________/ cL_bar A_bar' x cU_bar => (3) [ xl ] [ I ] [ xu ] [ cl_breve ] <= [ A_breve' ] * x <= [ cu_breve ] => (4) cl_bar <= A_bar'*x <= cu_bar
The main responsibilities of this class are to expose a MatrixOp
object for A_bar
shown in (2) and to pick violated constraints.
Definition at line 76 of file ConstrainedOptPack_ConstraintsRelaxedStd.hpp.
Definition at line 211 of file ConstrainedOptPack_ConstraintsRelaxedStd.hpp.
ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::ConstraintsRelaxedStd  (  ) 
Constructs to uninitialized.
Definition at line 89 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::STANDARD_MEMBER_COMPOSITION_MEMBERS  (  value_type  , 
bounds_tol  
) 
<<std comp>="">> members for feasibility tolerance for the bound constriants.
ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::STANDARD_MEMBER_COMPOSITION_MEMBERS  (  value_type  , 
inequality_tol  
) 
<<std comp>="">> members for feasibility tolerance for the general inequality constraints.
ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::STANDARD_MEMBER_COMPOSITION_MEMBERS  (  value_type  , 
equality_tol  
) 
<<std comp>="">> members for feasibility tolerance for the general equality constriants.
ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::STANDARD_MEMBER_COMPOSITION_MEMBERS  (  EInequalityPickPolicy  , 
inequality_pick_policy  
) 
<<std comp>="">> members for policy used to select a violated constraint.
void ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::initialize  (  const VectorSpace::space_ptr_t &  space_d_eta, 
value_type  etaL,  
const Vector *  dL,  
const Vector *  dU,  
const MatrixOp *  E,  
BLAS_Cpp::Transp  trans_E,  
const Vector *  b,  
const Vector *  eL,  
const Vector *  eU,  
const MatrixOp *  F,  
BLAS_Cpp::Transp  trans_F,  
const Vector *  f,  
size_type  m_undecomp,  
const size_type  j_f_undecomp[],  
VectorMutable *  Ed,  
bool  check_F = true , 

value_type  bounds_tol = 1e10 , 

value_type  inequality_tol = 1e10 , 

value_type  equality_tol = 1e10 

) 
Initialize constriants.
If there are no variable bounds then set:
void(dL) == void(dU) == NULL
If there are no general inequality constraints then set:
void(E) == void(b) == void(eL) == void(eU) == NULL
If there are no general equality constraints then set:
void(F) = void(f) == NULL
If check_F == false
, then the equality constriants in op(F)
will not be checked as violated constriants. This is to facilitate the addition of the equality constraints to the initial schur complement and therefore these constraints should never be violated (except for illconditioning). The tolerances below which a constriant will not be considered violated are given by bounds_tol
, inequality_tol
and equality_tol
.
Here, Ed
is updated (if Ed != NULL
) within the function this>pick_violated}(...)
. This saves some computational work of having to compute op(E)*d
again. To skip computing this value, just set Ed == NULL
.
ToDo: Specify more concretely exactly what the criteria is for considering that a constraint is violated or in picking the most violated constraint.
m_undecomp  [in] Number of undecomposed equality constraints. 
j_f_undecomp  [in] array (size m_undecomp) of indexes of constraints in op(F)*d + (1eta)*f that are not decomposed and therefore should be considered when looking for violated constraints. This array is used to define the mapping matrix P_u. It is required that this be sorted and that: j_f_undecomp[k+1] >= j_f_undecomp[k], for k = 0...m_undecomp2. If m_undecomp == f>size() then j_f_undecomp == NULL is allowed and the matrix P_u will be the identity matrix. 
Definition at line 103 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
const ConstraintsRelaxedStd::MatrixConstraints & ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::A_bar_relaxed  (  )  const 
Definition at line 225 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
size_type ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::n  (  )  const [virtual] 
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 232 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
size_type ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::m_breve  (  )  const [virtual] 
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 237 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
const MatrixOp & ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::A_bar  (  )  const [virtual] 
Represents the constraints matrix.
A_bar = [ I 0 op(E') op(F')*P_u ] [ 0 1 b' f'*P_u ]
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 242 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
void ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::pick_violated_policy  (  EPickPolicy  pick_policy  )  [virtual] 
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 247 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
Constraints::EPickPolicy ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::pick_violated_policy  (  )  const [virtual] 
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 262 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
void ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::pick_violated  (  const DVectorSlice &  x, 
size_type *  j_viol,  
value_type *  constr_val,  
value_type *  viol_bnd_val,  
value_type *  norm_2_constr,  
EBounds *  bnd,  
bool *  can_ignore  
)  const [virtual] 
Here the next violated constraint to add to the active set is selected.
Violated constraints are selected to to add to the active set in the following order:
ADD_BOUNDS_THEN_MOST_VIOLATED_INEQUALITY
Check the variable bounds first and add the most violated. If no variable bounds are violated by more than this>bounds_tol()
then check for the most violated inequality constraint by computing r = op(E)*d+b*eta
and add the most violated bound (eL
, eU
) if one exists. ADD_BOUNDS_THEN_FIRST_VIOLATED_INEQUALITY
Check the variable bounds first and add the most violated. If no variable bounds are violated by more than this>bounds_tol()
then check for the first violated inequality constraint by computing e(j)'*(op(E)*d+b*eta)
one or more constraints at a time. This option may be better if the cost of computing op(E)*d
is significant. ADD_MOST_VIOLATED_BOUNDS_AND_INEQUALITY
Select the most violated constraint from the variable bounds and the general inequality constraints by computing r = op(E)*d+b*eta then add the most violated variable bound. This option is always the most expensive but may result in less QP iterations. As a side effect, the vector pointed to by Ed
which was passed to this>initialize(...)
will be guarrenteed to be updated for the current op(E)*d, where d = x(1,nd), if any of the following is true:
j_viol == 0
this>pick_violated_policy() == ADD_MOST_VIOLATED_BOUNDS_AND_INEQUALITY
this>pick_violated_policy() == ADD_BOUNDS_THEN_MOST_VIOLATED_INEQUALITY && j_viol > this>n()
If none of the above criteria applies then the client can not assume that Ed
was updated and therefore the client must compute this value on its own.
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 277 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 493 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.
value_type ConstrainedOptPack::QPSchurPack::ConstraintsRelaxedStd::get_bnd  (  size_type  j, 
EBounds  bnd  
)  const [virtual] 
Implements ConstrainedOptPack::QPSchurPack::Constraints.
Definition at line 501 of file ConstrainedOptPack_ConstraintsRelaxedStd.cpp.