42 #ifndef NLP_FULL_TO_REDUCED_H
43 #define NLP_FULL_TO_REDUCED_H
55 namespace NLPInterfacePack {
311 const Permutation&
P_var()
const;
313 const Permutation&
P_equ()
const;
413 :
f(f_in),
c(c_in),
h(h_in)
438 :
Gf(Gf_in),
f(first_order_info_in.
f),
c(first_order_info_in.
c),
h(first_order_info_in.
h)
607 IVector *var_perm_full
608 ,IVector *equ_perm_full
715 void var_from_full( DVectorSlice::const_iterator vec_full, DVectorSlice::iterator vec )
const;
718 void var_to_full(DVectorSlice::const_iterator vec, DVectorSlice::iterator vec_full)
const;
902 #endif // NLP_FULL_TO_REDUCED_H
NLP interface class that adds gradient information for the objective function {abstract}.
size_type num_bounded_x() const
void set_basis(const Permutation &P_var, const Range1D &var_dep, const Permutation *P_equ, const Range1D *equ_decomp)
perm_fcty_ptr_t factory_P_equ_
void var_to_full(DVectorSlice::const_iterator vec, DVectorSlice::iterator vec_full) const
bool get_next_basis_remove_fixed(IVector *var_perm, IVector *equ_perm, size_type *rank)
virtual bool imp_nlp_has_changed() const
Return if the definition of the NLP has changed since the last call to initialize() ...
AbstractLinAlgPack::size_type size_type
value_type * f
Pointer to objective function f (may be NULL if not set)
Struct for gradient (objective), objective and constriants (pointers)
const IVector & var_full_to_remove_fixed() const
Inverse permutation vector of var_remove_fixed_to_full().
void imp_calc_h_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
virtual size_type imp_m_orig() const =0
Return the number of general equality constraints in the original problem.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
bool is_initialized() const
const Permutation & P_var() const
InconsistantBounds(const std::string &what_arg)
value_type scale_f() const
const IVector & equ_perm() const
Permutes from the original constriant ordering to the current basis selection.
const IVector & var_remove_fixed_to_full() const
Permutation vector for partitioning free and fixed variables.
void var_from_full(DVectorSlice::const_iterator vec_full, DVectorSlice::iterator vec) const
const Vector & xl() const
virtual size_type ns() const
Range1D equ_decomp() const
const Permutation & P_equ() const
VectorSpaceSerial space_x_
const perm_fcty_ptr_t factory_P_equ() const
DVector * h
Pointer to constraints residual h (may be NULL if not set)
NLPSerialPreprocess()
Default Constructor.
vec_space_ptr_t space_x() const
VectorSpaceSerial space_c_breve_
virtual size_type imp_n_orig() const =0
Return the number of variables in the original problem (including those fixed by bounds) ...
DVector * c
Pointer to constraints residual c (may be NULL if not set)
void set_not_initialized()
Used by subclasses to set the state of the NLP to not initialized.
const ZeroOrderInfo zero_order_info() const
Return pointer to set quantities.
vec_space_ptr_t space_c() const
const ObjGradInfo obj_grad_info() const
Return objective gradient and zero order information.
vec_space_ptr_t space_h_breve() const
virtual void imp_calc_c_orig(const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const =0
Calculate the vector for all of the general equality constaints in the original NLP.
NLP interface class that adds variable and constriant permutations for variable reduction basis selec...
const IVector & var_perm() const
Permutes from the compated variable vector (removing fixed variables) to the current basis selection...
NLP node implementation subclass for preprocessing and basis manipulation.
DVectorSlice x_full() const
Give reference to current x_full.
const ObjGradInfoSerial obj_grad_orig_info() const
value_type * f
Pointer to objective function f (may be NULL if not set)
VectorMutableDense xinit_
virtual void imp_calc_Gf_orig(const DVectorSlice &x_full, bool newx, const ObjGradInfoSerial &obj_grad_info) const =0
Calculate the vector for the gradient of the objective in the original NLP.
virtual void imp_calc_h_orig(const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const =0
Calculate the vector for all of the general inequality constaints in the original NLP...
void report_final_solution(const Vector &x, const Vector *lambda, const Vector *nu, bool is_optimal)
Overridden to permute the variables back into an order that is natural to the subclass.
void get_basis(Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp) const
bool force_xinit_in_bounds() const
virtual const DVectorSlice imp_xinit_orig() const =0
Return the original initial point (size imp_n_orig()).
void imp_calc_f(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
virtual const DVectorSlice imp_xu_orig() const =0
Return the original upper variable bounds (size imp_n_orig()).
bool nlp_selects_basis() const
const Vector & xu() const
const ZeroOrderInfo zero_order_info_breve() const
Return pointer to set hat quantities.
void initialize(bool test_setup)
Struct for objective and constriants (pointer) as serial vectors.
void imp_calc_c(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
const Vector & xinit() const
DVector * Gf
Gradient of objective function Gf (may be NULL if not set)
ZeroOrderInfoSerial(value_type *f_in, DVector *c_in, DVector *h_in)
IVector inv_var_full_to_fixed_
Teuchos::RCP< const Teuchos::AbstractFactory< Permutation > > perm_fcty_ptr_t
virtual bool imp_has_var_bounds() const =0
Return if the NLP has bounds.
void assert_initialized() const
Assert if we have been initizlized (throws UnInitialized)
Struct for objective and constriants (pointer).
perm_fcty_ptr_t factory_P_var_
virtual void imp_report_orig_final_solution(const DVectorSlice &x_full, const DVectorSlice *lambda_orig, const DVectorSlice *lambdaI_orig, const DVectorSlice *nu_orig, bool optimal)
To be overridden by subclasses to report the final solution in the original ordering natural to the s...
DVector * c
Pointer to constraints residual c (may be NULL if not set)
virtual const DVectorSlice imp_hu_orig() const =0
Return the original upper general inequality bounds (size imp_mI_orig()).
const Vector & hu_breve() const
virtual void imp_calc_f_orig(const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const =0
Calculate the objective function for the original NLP.
Range1D equ_undecomp() const
virtual size_type imp_mI_orig() const =0
Return the number of general inequality constraints in the original problem.
void imp_calc_c_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
void assert_and_set_basis(const IVector &var_perm, const IVector &equ_perm, size_type rank)
const perm_fcty_ptr_t factory_P_var() const
VectorSpaceSerial space_c_
AbstractLinAlgPack::value_type value_type
Abstract interface for mutable coordinate vectors {abstract}.
void equ_from_full(const DVectorSlice &c_orig, const DVectorSlice &h_orig, const DVectorSlice &s_orig, DVectorSlice *c_full) const
const IVector & inv_equ_perm() const
Inverse of equ_perm()
Struct for serial gradient (objective), objective and constriants (pointers)
VectorSpaceSerial space_h_breve_
virtual bool imp_get_next_basis(IVector *var_perm_full, IVector *equ_perm_full, size_type *rank_full, size_type *rank)
Return the next basis selection (default returns false).
const ZeroOrderInfoSerial zero_order_orig_info() const
const Vector & hl_breve() const
IVector var_full_to_fixed_
void get_init_lagrange_mult(VectorMutable *lambda, VectorMutable *nu) const
virtual const DVectorSlice imp_xl_orig() const =0
Return the original lower variable bounds (size imp_n_orig()).
Range1D var_indep() const
void set_x_full(const DVectorSlice &x, bool newx, DVectorSlice *x_full) const
Set the full x vector if newx == true
void assert_bounds_on_variables() const
VectorMutableDense hl_breve_
static value_type fixed_var_mult()
Gives the value of a Lagrange multipler for a fixed variable bound .that has been preprocessed out of...
ObjGradInfoSerial(DVector *Gf_in, const ZeroOrderInfoSerial &first_order_info_in)
void do_force_xinit_in_bounds()
DVector * h
Pointer to constraints residual h (may be NULL if not set)
RangePack::Range1D Range1D
bool force_xinit_in_bounds_
virtual const DVectorSlice imp_hl_orig() const =0
Return the original lower general inequality bounds (size imp_mI_orig()).
VectorMutableDense hu_breve_
vec_space_ptr_t space_c_breve() const
void imp_calc_Gf(const Vector &x, bool newx, const ObjGradInfo &obj_grad_info) const
bool get_next_basis(Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp)