7#ifndef __IPITERATESVECTOR_HPP__
8#define __IPITERATESVECTOR_HPP__
15class IteratesVectorSpace;
46 bool create_new =
true
75 return GetIterateFromComp(0);
83 return GetNonConstIterateFromComp(0);
95 Set_x_NonConst(*curr_x_->MakeNew());
96 x_NonConst()->Copy(*curr_x_);
119 SetCompNonConst(0, vec);
125 return GetIterateFromComp(1);
134 return GetNonConstIterateFromComp(1);
145 Set_s_NonConst(*curr_s->MakeNew());
146 s_NonConst()->Copy(*curr_s);
169 SetCompNonConst(1, vec);
175 return GetIterateFromComp(2);
184 return GetNonConstIterateFromComp(2);
196 Set_y_c_NonConst(*curr_y_c_->MakeNew());
197 y_c_NonConst()->Copy(*curr_y_c_);
198 return y_c_NonConst();
220 SetCompNonConst(2, vec);
226 return GetIterateFromComp(3);
234 return GetNonConstIterateFromComp(3);
246 Set_y_d_NonConst(*curr_y_d_->MakeNew());
247 y_d_NonConst()->Copy(*curr_y_d_);
248 return y_d_NonConst();
270 SetCompNonConst(3, vec);
276 return GetIterateFromComp(4);
285 return GetNonConstIterateFromComp(4);
296 Set_z_L_NonConst(*curr_z_L_->MakeNew());
297 z_L_NonConst()->Copy(*curr_z_L_);
298 return z_L_NonConst();
320 SetCompNonConst(4, vec);
326 return GetIterateFromComp(5);
334 return GetNonConstIterateFromComp(5);
346 Set_z_U_NonConst(*curr_z_U_->MakeNew());
347 z_U_NonConst()->Copy(*curr_z_U_);
348 return z_U_NonConst();
370 SetCompNonConst(5, vec);
376 return GetIterateFromComp(6);
385 return GetNonConstIterateFromComp(6);
397 Set_v_L_NonConst(*curr_v_L->MakeNew());
398 v_L_NonConst()->Copy(*curr_v_L);
399 return v_L_NonConst();
420 SetCompNonConst(6, vec);
426 return GetIterateFromComp(7);
435 return GetNonConstIterateFromComp(7);
447 Set_v_U_NonConst(*curr_v_U->MakeNew());
448 v_U_NonConst()->Copy(*curr_v_U);
449 return v_U_NonConst();
471 SetCompNonConst(7, vec);
491 SetCompNonConst(0, x);
492 SetCompNonConst(1, s);
517 SetCompNonConst(2, y_c);
518 SetCompNonConst(3, y_d);
549 SetCompNonConst(4, z_L);
550 SetCompNonConst(5, z_U);
551 SetCompNonConst(6, v_L);
552 SetCompNonConst(7, v_U);
568 tag += x()->GetTag();
572 tag += s()->GetTag();
576 tag += y_c()->GetTag();
580 tag += y_d()->GetTag();
584 tag += z_L()->GetTag();
588 tag += z_U()->GetTag();
592 tag += v_L()->GetTag();
596 tag += v_U()->GetTag();
656 return GetCompNonConst(i);
697 bool create_new =
true
721 newvec->Set_y_c(y_c);
722 newvec->Set_y_d(y_d);
723 newvec->Set_z_L(z_L);
724 newvec->Set_z_U(z_U);
725 newvec->Set_v_L(v_L);
726 newvec->Set_v_U(v_U);
731 bool create_new =
true
734 return MakeNewIteratesVector(create_new);
746 return MakeNewIteratesVector();
759 DBG_ASSERT(
false &&
"This is an IteratesVectorSpace - a special compound vector for Ipopt iterates. The contained spaces should not be modified.");
This vectors space is the vector space for CompoundVector.
SmartPtr< const VectorSpace > GetCompSpace(Index icomp) const
Method for obtaining an individual component VectorSpace.
Class of Vectors consisting of other vectors.
Vector Space for the IteratesVector class.
virtual Vector * MakeNew() const
This method creates a new vector (and allocates space in all the contained vectors.
SmartPtr< const VectorSpace > y_d_space_
SmartPtr< const VectorSpace > x_space_
Contained Spaces.
SmartPtr< const VectorSpace > y_c_space_
virtual CompoundVector * MakeNewCompoundVector(bool create_new=true) const
Method for creating a new vector of this specific type.
IteratesVectorSpace & operator=(const IteratesVectorSpace &)
Default Assignment Operator.
SmartPtr< const VectorSpace > z_L_space_
virtual ~IteratesVectorSpace()
IteratesVectorSpace(const VectorSpace &x_space, const VectorSpace &s_space, const VectorSpace &y_c_space, const VectorSpace &y_d_space, const VectorSpace &z_L_space, const VectorSpace &z_U_space, const VectorSpace &v_L_space, const VectorSpace &v_U_space)
Constructor that takes the spaces for each of the iterates.
SmartPtr< const VectorSpace > v_U_space_
virtual IteratesVector * MakeNewIteratesVector(bool create_new=true) const
Method for creating vectors .
IteratesVectorSpace()
Default constructor.
virtual void SetCompSpace(Index, const VectorSpace &)
This method hides the CompoundVectorSpace::SetCompSpace method since the components of the Iterates a...
SmartPtr< const VectorSpace > s_space_
SmartPtr< const VectorSpace > z_U_space_
SmartPtr< const VectorSpace > v_L_space_
IteratesVectorSpace(const IteratesVectorSpace &)
Copy Constructor.
const SmartPtr< const IteratesVector > MakeNewIteratesVector(const Vector &x, const Vector &s, const Vector &y_c, const Vector &y_d, const Vector &z_L, const Vector &z_U, const Vector &v_L, const Vector &v_U)
Use this method to create a new const IteratesVector.
Specialized CompoundVector class specifically for the algorithm iterates.
SmartPtr< Vector > create_new_y_c_copy()
Create a new vector in the y_c entry and copy the current values into it.
SmartPtr< Vector > create_new_z_U_copy()
Create a new vector in the z_U entry and copy the current values into it.
SmartPtr< const Vector > v_U() const
Get the v_U iterate (const)
SmartPtr< const Vector > v_L() const
Get the v_L iterate (const)
SmartPtr< Vector > v_U_NonConst()
Get the v_U iterate (non-const) - this can only be called if the vector was created intenally,...
SmartPtr< Vector > v_L_NonConst()
Get the v_L iterate (non-const) - this can only be called if the vector was created internally,...
SmartPtr< Vector > create_new_v_L_copy()
Create a new vector in the v_L entry and copy the current values into it.
SmartPtr< Vector > create_new_v_L()
Create a new vector in the v_L entry.
SmartPtr< const Vector > x() const
Iterates Set/Get Methods.
SmartPtr< Vector > create_new_y_d()
Create a new vector in the y_d entry.
TaggedObject::Tag GetTagSum() const
Get a sum of the tags of the contained items.
SmartPtr< const Vector > z_U() const
Get the z_U iterate (const)
SmartPtr< Vector > create_new_z_L()
Create a new vector in the z_L entry.
SmartPtr< const Vector > z_L() const
Get the z_L iterate (const)
void Set_z_U_NonConst(Vector &vec)
Set the z_U iterate (non-const).
void Set_y_d(const Vector &vec)
Set the y_d iterate (const).
SmartPtr< Vector > y_d_NonConst()
Get the y_d iterate (non-const) - this can only be called if the vector was created internally,...
SmartPtr< const Vector > y_d() const
Get the y_d iterate (const)
SmartPtr< const Vector > y_c() const
Get the y_c iterate (const)
SmartPtr< Vector > create_new_z_U()
Create a new vector in the z_U entry.
SmartPtr< Vector > create_new_x()
Create a new vector in the x entry.
SmartPtr< Vector > y_c_NonConst()
Get the y_c iterate (non-const) - this can only be called if the vector was created internally,...
void Set_eq_mult(const Vector &y_c, const Vector &y_d)
Set the eq multipliers all in one shot.
void Set_y_c_NonConst(Vector &vec)
Set the y_c iterate (non-const).
SmartPtr< Vector > GetNonConstIterateFromComp(Index i)
private method to return the non-const element from the compound vector
void Set_x_NonConst(Vector &vec)
Set the x iterate (non-const).
SmartPtr< Vector > x_NonConst()
Get the x iterate (non-const) - this can only be called if the vector was created internally,...
SmartPtr< Vector > z_L_NonConst()
Get the z_L iterate (non-const) - this can only be called if the vector was created internally,...
void Set_bound_mult_NonConst(Vector &z_L, Vector &z_U, Vector &v_L, Vector &v_U)
Set the bound multipliers all in one shot.
SmartPtr< Vector > create_new_s()
Create a new vector in the s entry.
void Set_primal(const Vector &x, const Vector &s)
Set the primal variables all in one shot.
void Set_bound_mult(const Vector &z_L, const Vector &z_U, const Vector &v_L, const Vector &v_U)
Set the bound multipliers all in one shot.
SmartPtr< Vector > create_new_y_c()
Create a new vector in the y_c entry.
SmartPtr< Vector > s_NonConst()
Get the s iterate (non-const) - this can only be called if the vector was created internally,...
IteratesVector(const IteratesVector &)
Copy Constructor.
SmartPtr< Vector > create_new_s_copy()
Create a new vector in the s entry and copy the current values into it.
SmartPtr< const Vector > GetIterateFromComp(Index i) const
private method to return the const element from the compound vector
void operator=(const IteratesVector &)
Default Assignment Operator.
void Set_primal_NonConst(Vector &x, Vector &s)
SmartPtr< Vector > create_new_v_U()
Create a new vector in the v_U entry.
SmartPtr< Vector > create_new_x_copy()
Create a new vector in the x entry and copy the current values into it.
SmartPtr< Vector > create_new_y_d_copy()
Create a new vector in the y_d entry and copy the current values into it.
void Set_y_c(const Vector &vec)
Set the y_c iterate (const).
void Set_s_NonConst(Vector &vec)
Set the s iterate (non-const).
void Set_x(const Vector &vec)
Set the x iterate (const).
SmartPtr< Vector > create_new_v_U_copy()
Create a new vector in the v_U entry and copy the current values into it.
void Set_v_U_NonConst(Vector &vec)
Set the v_U iterate (non-const).
void Set_z_U(const Vector &vec)
Set the z_U iterate (const).
SmartPtr< Vector > create_new_z_L_copy()
Create a new vector in the z_L entry and copy the current values into it.
void Set_z_L_NonConst(Vector &vec)
Set the z_L iterate (non-const).
virtual ~IteratesVector()
void Set_eq_mult_NonConst(Vector &y_c, Vector &y_d)
Set the eq multipliers all in one shot.
SmartPtr< IteratesVector > MakeNewIteratesVectorCopy() const
Use this method to create a new iterates vector with a copy of all the data.
void Set_z_L(const Vector &vec)
Set the z_L iterate (const).
SmartPtr< IteratesVector > MakeNewIteratesVector(bool create_new=true) const
Make New methods.
void Set_s(const Vector &vec)
Set the s iterate (const).
const IteratesVectorSpace * owner_space_
void Set_v_L(const Vector &vec)
Set the v_L iterate (const).
SmartPtr< IteratesVector > MakeNewContainer() const
Use this method to create a new iterates vector container.
SmartPtr< const Vector > s() const
Get the s iterate (const)
SmartPtr< Vector > z_U_NonConst()
Get the z_U iterate (non-const) - this can only be called if the vector was created internally,...
IteratesVector(const IteratesVectorSpace *owner_space, bool create_new)
Constructors / Destructors.
void Set_v_L_NonConst(Vector &vec)
Set the v_L iterate (non-const).
IteratesVector()
Default Constructor.
void Set_y_d_NonConst(Vector &vec)
Set the y_d iterate (non-const).
void Set_v_U(const Vector &vec)
Set the v_U iterate (const).
Template class for Smart Pointers.
unsigned int Tag
Type for the Tag values.
VectorSpace base class, corresponding to the Vector base class.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
bool IsValid(const SmartPtr< U > &smart_ptr)
ipindex Index
Type of all indices of vectors, matrices etc.