46 #include "NLPInterfacePack_ExampleNLPFirstOrder.hpp"
47 #include "NLPInterfacePack_ExampleBasisSystem.hpp"
48 #include "AbstractLinAlgPack_BasisSystemComposite.hpp"
49 #include "AbstractLinAlgPack_MatrixSymDiagStd.hpp"
50 #include "AbstractLinAlgPack_MatrixComposite.hpp"
51 #include "AbstractLinAlgPack_VectorStdOps.hpp"
52 #include "ReleaseResource_ref_count_ptr.hpp"
53 #include "Teuchos_dyn_cast.hpp"
54 #include "Teuchos_Assert.hpp"
56 namespace NLPInterfacePack {
59 const VectorSpace::space_ptr_t& vec_space
101 namespace rcp = MemMngPack;
106 factory_Gc_ = BasisSystemComposite::factory_Gc();
119 const Vector& x,
bool newx,
const FirstOrderInfo& first_order_info)
const
121 namespace rcp = MemMngPack;
137 BasisSystemComposite::get_C_N(
138 first_order_info.
Gc, &C_aggr, &N_aggr );
142 C_ptr = Teuchos::null;
144 N_ptr = Teuchos::null;
145 if( C_aggr == NULL ) {
146 const VectorSpace::space_ptr_t
148 space_xD = space_x->sub_space(var_dep);
149 C_ptr =
Teuchos::rcp(
new MatrixSymDiagStd(space_xD->create_member()));
150 N_ptr =
Teuchos::rcp(
new MatrixSymDiagStd(space_xD->create_member()));
151 C_aggr = C_ptr.
get();
152 N_aggr = N_ptr.
get();
157 &C =
dyn_cast<MatrixSymDiagStd>(*C_aggr);
159 &N =
dyn_cast<MatrixSymDiagStd>(*N_aggr);
162 x_D = x.sub_view(var_dep),
166 Vp_S( &C.diag(), -1.0 );
168 Vp_S( &N.diag(), -10.0 );
170 if( C_ptr.
get() != NULL ) {
171 BasisSystemComposite::initialize_Gc(
void initialize(bool test_setup)
void initialize(bool test_setup)
ExampleNLPFirstOrder(const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded)
Constructor (see ExampleNLPDirect::ExampleNLPDirect()).
T_To & dyn_cast(T_From &from)
virtual Range1D var_dep() const
bool is_initialized() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void imp_calc_Gc(const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const
Simple example NLP subclass to illustrate how to implement the NLPObjGrad interface for a specialized...
void set_Gc(MatrixOp *Gc)
Overridden to check the concrete type of Gc.
virtual Range1D var_indep() const
vec_space_ptr_t space_x() const
void initialize(bool test_setup)
void Vp_S(VectorMutable *v_lhs, const value_type &alpha)
vec_space_ptr_t space_c() const
const basis_sys_ptr_t basis_sys() const
Returns an ExampleBasisSystem.
Subclass of BasisSystem for example NLP.
virtual void set_Gc(MatrixOp *Gc)
const NLPFirstOrder::mat_fcty_ptr_t factory_Gc() const