48 #include "NLPInterfacePack_Types.hpp"
49 #include "AbstractLinAlgPack_VectorMutable.hpp"
50 #include "AbstractLinAlgPack_Permutation.hpp"
51 #include "StandardCompositionRelationshipsPack.hpp"
53 #include "Teuchos_VerboseObject.hpp"
55 namespace OptionsFromStreamPack {
56 class OptionsFromStream;
59 namespace NLPInterfacePack {
321 {
public:
UnInitialized(
const std::string& what_arg) : std::logic_error(what_arg) {}};
329 {
public:
IncompatibleType(
const std::string& what_arg) : std::logic_error(what_arg) {}};
333 {
public:
NoBounds(
const std::string& what_arg) : std::logic_error(what_arg) {}};
395 virtual void initialize(
bool test_setup =
false );
474 virtual const Vector&
xl()
const = 0;
483 virtual const Vector&
xu()
const = 0;
553 virtual void set_f(value_type*
f);
560 virtual value_type*
get_f();
568 virtual value_type&
f();
576 virtual const value_type&
f()
const;
616 virtual const Vector&
c()
const;
663 virtual value_type
scale_f()
const = 0;
686 virtual void calc_f(
const Vector& x,
bool newx =
true)
const;
709 virtual void calc_c(
const Vector& x,
bool newx =
true)
const;
908 virtual const Permutation&
P_var()
const;
923 virtual const Permutation&
P_equ()
const;
989 :
f(f_in),
c(c_in),
h(h_in)
1098 StandardCompositionRelationshipsPack::assert_role_name_set(p,
false, info);
1106 #ifdef DOXYGEN_COMPILE
1117 mutable ZeroOrderInfo first_order_info_;
1118 mutable ZeroOrderInfo first_order_info_breve_;
1130 return first_order_info_;
1136 return first_order_info_breve_;
virtual value_type & f()
Returns non-const *this->get_f().
Thrown if an incompatible object is used.
virtual void calc_c(const Vector &x, bool newx=true) const
Update the constraint residual vector for c at the point x and put it in the stored reference...
VectorMutable * c
Pointer to constraints residual c (Will be NULL if not set)
virtual size_type ns() const
Return the number of slack variables (i.e. number of general inequalities).
virtual void report_final_solution(const Vector &x, const Vector *lambda, const Vector *nu, bool is_optimal)
Used by the solver to report the final solution and multipliers.
ZeroOrderInfo(value_type *f_in, VectorMutable *c_in, VectorMutable *h_in)
virtual size_type num_c_evals() const
Gives the number of constraint function c(x) evaluations called by the solver since initialize() was ...
virtual value_type scale_f() const =0
Return the scaling being used for the objective function.
virtual VectorMutable & c_breve()
Returns non-const *this->get_c_breve().
virtual VectorMutable * get_c_breve()
Return pointer passed to this->set_c_breve().
virtual vec_space_ptr_t space_x() const =0
Vector space object for unknown variables x (dimension n).
virtual vec_space_ptr_t space_c_breve() const
Vector space object for the original equalities c_breve(x_breve)
virtual void get_init_lagrange_mult(VectorMutable *lambda, VectorMutable *nu) const
Get the initial value of the Lagrange multipliers lambda.
const ZeroOrderInfo zero_order_info() const
Return pointer to set quantities.
virtual void imp_calc_c_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
Overridden to compute c_breve(x_breve) and perhaps f(x) and/or h_breve(x_breve)
virtual void imp_calc_f(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const =0
Overridden to compute f(x) (and perhaps other quantities if set).
void assert_ref_set(T *p, std::string info) const
Assert referece has been set for a quanity.
virtual void set_options(const options_ptr_t &options)
Set the options that this NLP may be interested in.
virtual void imp_calc_h_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
Overridden to compute h_breve(x_breve) and perhaps f(x) and/or c_breve(x_breve).
virtual void imp_calc_c(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const =0
Overridden to compute c(x) and perhaps f(x) and/or h(x) (if multiple calculaiton = true)...
virtual void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
virtual const Vector & hl_breve() const
Returns a reference to the vector of lower bounds on the general inequality constraints h_breve(x_bre...
virtual void calc_f(const Vector &x, bool newx=true) const
Update the value for the objective f at the point x and put it in the stored reference.
virtual size_type n() const
Return the number of variables.
virtual vec_space_ptr_t space_c() const =0
Vector space object for general equality constraints c(x) (dimension m).
virtual const Vector & xl() const =0
Returns the lower bounds on the variables x.
const ZeroOrderInfo zero_order_info_breve() const
Return pointer to set hat quantities.
virtual size_type num_bounded_x() const =0
Returns the number of variables in x(i) for which xl(i)> -infinite_bound() or xu(i) < +infinite_bound...
Teuchos::RCP< const OptionsFromStreamPack::OptionsFromStream > options_ptr_t
virtual void set_c(VectorMutable *c)
Set a pointer to a vector to be updated when this->calc_c() is called.
virtual bool force_xinit_in_bounds() const =0
Returns if the initial point must be within the bounds.
virtual const Vector & xu() const =0
Returns a reference to the vector of upper bounds on the variables x.
virtual value_type * get_f()
Return pointer passed to this->set_f().
Teuchos::RCP< const VectorSpace > vec_space_ptr_t
virtual ~NLP()
Destructor that cleans all the memory it owns.
Struct for objective and constriants (pointer).
virtual const options_ptr_t & get_options() const
Get the OptionsFromStream object being used to extract the options from.
NLP interface class {abstract}.
virtual vec_space_ptr_t space_h_breve() const
Vector space object for the original inequalities h_breve(x_breve)
Thrown if any member functions are called before initialize() has been called.
virtual const Permutation & P_var() const
Return the permutation object for the variables.
virtual value_type max_var_bounds_viol() const =0
Set the maximum absolute value for which the variable bounds may be violated by when computing functi...
NLP()
Initialize to no reference set to calculation quanities.
virtual void set_c_breve(VectorMutable *c_breve)
Set a pointer to a vector to be updated when this->calc_c_breve() is called.
virtual const Permutation & P_equ() const
Return the permutation object for the constraints.
virtual const Vector & hu_breve() const
Returns a reference to the vector of upper bounds on the general inequality constraints h_breve(x_bre...
virtual void calc_h_breve(const Vector &x, bool newx=true) const
Update the constraint residual vector for h_breve at the point x and put it in the stored reference...
value_type * f
Pointer to objective function f (Will be NULL if not set)
virtual void set_h_breve(VectorMutable *h_breve)
Set a pointer to a vector to be updated when this->calc_h_breve() is called.
virtual bool is_initialized() const =0
Return if this is initialized.
virtual void calc_c_breve(const Vector &x, bool newx=true) const
Update the constraint residual vector for c_breve at the point x and put it in the stored reference...
virtual const Vector & xinit() const =0
Returns a reference to the vector of the initial guess for the solution x.
Thrown some bounds do not existe.
Thrown from initialize() if some logical error occured.
virtual size_type m() const
Return the number of general equality constraints.
virtual void initialize(bool test_setup=false)
Initialize the NLP before it is used.
virtual size_type num_f_evals() const
Gives the number of object function f(x) evaluations called by the solver since initialize() was call...
virtual VectorMutable * get_h_breve()
Return pointer passed to this->set_h_breve().
static value_type infinite_bound()
Value for an infinite bound.
virtual VectorMutable * get_c()
Return pointer passed to this->set_c().
VectorMutable * h
Pointer to inequality constraints h (Will be NULL if not set)
virtual void set_f(value_type *f)
Set a pointer to an value to be updated when this->calc_f() is called.
virtual VectorMutable & c()
Returns non-const *this->get_c().
virtual VectorMutable & h_breve()
Returns non-const *this->get_h_breve().