63 class init_rtop_server_t {
65 init_rtop_server_t() {
69 init_rtop_server_t init_rtop_server;
73 namespace NLPInterfacePack {
76 const VectorSpace::space_ptr_t& vec_space
81 :vec_space_(vec_space), vec_space_comp_(Teuchos::null)
82 ,initialized_(false), obj_scale_(1.0)
83 ,has_bounds_(has_bounds), force_xinit_in_bounds_(true), n_(2*vec_space->dim())
85 namespace rcp = MemMngPack;
89 vec_space->dim() <= 0, std::logic_error
90 ,
"ExampleNLPObjGrad::ExampleNLPObjGrad(...) Error!" );
93 BasisSystemComposite::initialize_space_x(
115 *
xl_->sub_view(bounded_rng) = 0.01;
117 *
xu_->sub_view(bounded_rng) = 20.0;
267 const Vector* vecs[] = { xD.get(), xI.get() };
void initialize(bool test_setup)
Initialize the NLP for its first use.
virtual value_type & f()
Returns non-const *this->get_f().
virtual vec_ptr_t sub_view(const Range1D &rng) const
Create an abstract view of a vector object .
AbstractLinAlgPack::size_type size_type
VectorMutable * c
Pointer to constraints residual c (Will be NULL if not set)
Struct for gradient (objective), objective and constriants (pointers)
Adapter subclass that uses a RTOp_RTOp object.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
VectorSpace::space_ptr_t vec_space_comp_
VectorSpace::space_ptr_t vec_space_
VectorMutable * Gf
Pointer to gradient of objective function Gf (may be NULL if not set)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const Vector & xu() const
void V_StV(VectorMutable *v_lhs, value_type alpha, const V &V_rhs)
v_lhs = alpha * V_rhs.
void imp_calc_f(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
void report_final_solution(const Vector &x, const Vector *lambda, const Vector *nu, bool optimal)
const Vector & xinit() const
virtual Range1D var_dep() const
bool is_initialized() const
void assert_is_initialized() const
int RTOp_TOp_explnlp2_c_eval_construct(struct RTOp_RTOp *op)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void imp_calc_c(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
VectorSpace::vec_mut_ptr_t xu_
bool force_xinit_in_bounds_
bool force_xinit_in_bounds() const
size_type num_bounded_x() const
void imp_calc_h(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
This implementation does nothing (should never be called though).
VectorSpace::vec_mut_ptr_t xl_
value_type scale_f() const
Struct for objective and constriants (pointer).
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2
virtual Range1D var_indep() const
vec_space_ptr_t space_x() const
ExampleNLPObjGrad(const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded)
Constructor.
virtual index_type dim() const
Return the dimension of this vector.
void initialize(bool test_setup)
AbstractLinAlgPack::value_type value_type
Abstract interface for mutable coordinate vectors {abstract}.
value_type * f
Pointer to objective function f (Will be NULL if not set)
void apply_op(EApplyBy apply_by, const RTOpPack::RTOp &primary_op, const size_t num_multi_vecs, const MultiVector *multi_vecs[], const size_t num_targ_multi_vecs, MultiVectorMutable *targ_multi_vecs[], RTOpPack::ReductTarget *reduct_objs[]=NULL, const index_type primary_first_ele=1, const index_type primary_sub_dim=0, const index_type primary_global_offset=0, const index_type secondary_first_ele=1, const index_type secondary_sub_dim=0)
Apply a reduction/transformation operator column by column and return an array of the reduction objec...
void force_in_bounds(const Vector &xl, const Vector &xu, VectorMutable *x)
Force a vector in bounds.
const Vector & xl() const
value_type max_var_bounds_viol() const
vec_space_ptr_t space_c() const
static value_type infinite_bound()
Value for an infinite bound.
void imp_calc_Gf(const Vector &x, bool newx, const ObjGradInfo &obj_grad_info) const
RangePack::Range1D Range1D
VectorSpace::vec_mut_ptr_t xinit_
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)