47 #include "MoochoPack_Types.hpp"
48 #include "IterationPack_IterQuantityAccess.hpp"
49 #include "IterationPack_AlgorithmState.hpp"
50 #include "IterationPack_cast_iq.hpp"
51 #include "IterationPack_IterQuantityAccessContiguous.hpp"
52 #include "AbstractLinAlgPack_VectorSpace.hpp"
53 #include "AbstractLinAlgPack_Permutation.hpp"
54 #include "ConstrainedOptPack_DecompositionSystem.hpp"
55 #include "AbstractLinAlgPack_MatrixOp.hpp"
60 namespace MoochoPack {
69 extern const std::string num_basis_name;
71 extern const std::string x_name;
72 extern const std::string f_name;
73 extern const std::string Gf_name;
74 extern const std::string HL_name;
75 extern const std::string c_name;
76 extern const std::string h_name;
77 extern const std::string Gc_name;
79 extern const std::string Y_name;
80 extern const std::string Z_name;
81 extern const std::string R_name;
82 extern const std::string Uy_name;
83 extern const std::string Uz_name;
85 extern const std::string py_name;
86 extern const std::string Ypy_name;
87 extern const std::string pz_name;
88 extern const std::string Zpz_name;
89 extern const std::string d_name;
91 extern const std::string rGf_name;
92 extern const std::string rHL_name;
93 extern const std::string w_name;
94 extern const std::string zeta_name;
95 extern const std::string qp_grad_name;
96 extern const std::string eta_name;
98 extern const std::string alpha_name;
99 extern const std::string merit_func_nlp_name;
100 extern const std::string mu_name;
101 extern const std::string phi_name;
103 extern const std::string opt_kkt_err_name;
104 extern const std::string feas_kkt_err_name;
105 extern const std::string comp_kkt_err_name;
106 extern const std::string GL_name;
107 extern const std::string rGL_name;
108 extern const std::string lambda_name;
109 extern const std::string nu_name;
126 #define STATE_IQ_DECL(TYPE,NAME) \
127 virtual IterQuantityAccess<TYPE>& NAME(); \
128 virtual const IterQuantityAccess<TYPE>& NAME() const; \
130 iq_id_encap NAME ## _iq_id_; \
135 #define STATE_INDEX_IQ_DECL(NAME) \
136 STATE_IQ_DECL(index_type,NAME) \
140 #define STATE_SCALAR_IQ_DECL(NAME) \
141 STATE_IQ_DECL(value_type,NAME) \
145 #define STATE_VECTOR_IQ_DECL(NAME) \
146 STATE_IQ_DECL(VectorMutable,NAME) \
155 #define STATE_IQ_DEF(CLASS,TYPE,NAME,NAME_STR) \
156 IterQuantityAccess<TYPE>& \
159 update_iq_id( NAME_STR, &NAME ## _iq_id_ ); \
160 return IterationPack::cast_iq<TYPE>( \
161 *this, NAME ## _iq_id_.iq_id, NAME_STR ); \
163 const IterQuantityAccess<TYPE>& \
164 CLASS::NAME() const \
166 return const_cast<CLASS*>(this)->NAME(); \
173 #define STATE_INDEX_IQ_DEF(CLASS,NAME,NAME_STR) \
174 IterQuantityAccess<index_type>& \
177 update_index_type_iq_id( NAME_STR, &NAME ## _iq_id_ ); \
178 return IterationPack::cast_iq<index_type>( \
179 *this, NAME ## _iq_id_.iq_id, NAME_STR ); \
181 const IterQuantityAccess<index_type>& \
182 CLASS::NAME() const \
184 return const_cast<CLASS*>(this)->NAME(); \
191 #define STATE_SCALAR_IQ_DEF(CLASS,NAME,NAME_STR) \
192 IterQuantityAccess<value_type>& \
195 update_value_type_iq_id( NAME_STR, &NAME ## _iq_id_ ); \
196 return IterationPack::cast_iq<value_type>( \
197 *this, NAME ## _iq_id_.iq_id, NAME_STR ); \
199 const IterQuantityAccess<value_type>& \
200 CLASS::NAME() const \
202 return const_cast<CLASS*>(this)->NAME(); \
214 #define STATE_VECTOR_IQ_DEF(CLASS,NAME,NAME_STR,VEC_SPC,VEC_RN) \
215 IterQuantityAccess<VectorMutable>& \
218 update_vector_iq_id( NAME_STR, VEC_SPC, VEC_RN, &NAME ## _iq_id_ ); \
219 return IterationPack::cast_iq<VectorMutable>( \
220 *this, NAME ## _iq_id_.iq_id, NAME_STR ); \
222 const IterQuantityAccess<VectorMutable>& \
223 CLASS::NAME() const \
225 return const_cast<CLASS*>(this)->NAME(); \
274 {
public:
InvalidType(
const std::string& what_arg) : std::logic_error(what_arg) {}};
315 const VectorSpace& space_range()
const;
325 const VectorSpace& space_null()
const;
332 const decomp_sys_ptr_t& decomp_sys = Teuchos::null
485 enum { NUM_VEC_SPACE_TYPES = 5 };
501 const std::string& iq_name
506 const std::string& iq_name
511 const std::string& iq_name
516 const std::string& iq_name
517 ,
const VectorSpace::space_ptr_t& vec_space
518 ,EVecSpaceType vec_space_type
527 typedef std::deque<iq_id_type> iq_vector_list_t;
535 iq_vector_list_t vector_iqs_lists_[NUM_VEC_SPACE_TYPES];
542 void update_vector_factories(
543 EVecSpaceType vec_space_type
558 {
return space_range_ ; }
562 {
return space_range_; }
565 const VectorSpace& NLPAlgoState::space_range()
const
566 {
return *space_range_; }
570 {
return space_null_ ; }
574 {
return space_null_; }
577 const VectorSpace& NLPAlgoState::space_null()
const
578 {
return *space_null_; }
582 #endif // RSQP_STATE_H
void update_iq_id(const std::string &iq_name, iq_id_encap *iq_id) const
#define STATE_IQ_DECL(TYPE, NAME)
Add class declarations for an arbitrary iteration quantity.
#define STATE_SCALAR_IQ_DECL(NAME)
Add class declarations for a scalar (i.e. value_type) iteration quantity.
void update_vector_iq_id(const std::string &iq_name, const VectorSpace::space_ptr_t &vec_space, EVecSpaceType vec_space_type, iq_id_encap *iq_id)
void update_value_type_iq_id(const std::string &iq_name, iq_id_encap *iq_id)
Reduced space SQP state encapsulation interface.
STANDARD_COMPOSITION_MEMBERS(DecompositionSystem, decomp_sys)
Set the DecompositionSystem object that all share.
Teuchos::RCP< const VectorSpace > vec_space_ptr_t
#define STATE_INDEX_IQ_DECL(NAME)
Add class declarations for an index (i.e. index_type) iteration quantity.
Thrown if an iteration quantity is of an invalid type.
void set_space_null(const vec_space_ptr_t &space_null)
Set the VectorSpace of the null space (pz).
void update_index_type_iq_id(const std::string &iq_name, iq_id_encap *iq_id)
NLPAlgoState(const decomp_sys_ptr_t &decomp_sys=Teuchos::null, const vec_space_ptr_t &space_x=Teuchos::null, const vec_space_ptr_t &space_c=Teuchos::null, const vec_space_ptr_t &space_range=Teuchos::null, const vec_space_ptr_t &space_null=Teuchos::null)
Construct.
STANDARD_CONST_COMPOSITION_MEMBERS(VectorSpace, space_x)
Set the VectorSpace of x.
STANDARD_MEMBER_COMPOSITION_MEMBERS(Range1D, var_dep)
Range of dependent variables [1,r].
void set_space_range(const vec_space_ptr_t &space_range)
Set the VectorSpace of the range space (py).
#define STATE_VECTOR_IQ_DECL(NAME)
Add class declarations for a VectorMutable iteration quantity.