42 #ifndef NLP_SERIAL_PREPROCESS_EXPL_JAC_H
43 #define NLP_SERIAL_PREPROCESS_EXPL_JAC_H
47 #include "NLPInterfacePack_NLPSerialPreprocess.hpp"
48 #include "NLPInterfacePack_NLPFirstOrder.hpp"
49 #include "AbstractLinAlgPack_BasisSystemFactoryStd.hpp"
50 #include "DenseLinAlgPack_DVectorClass.hpp"
51 #include "Teuchos_AbstractFactory.hpp"
54 namespace NLPInterfacePack {
117 const basis_sys_fcty_ptr_t &basis_sys_fcty =
Teuchos::rcp(
new BasisSystemFactoryStd())
185 const Vector& x,
bool newx
229 typedef std::valarray<value_type>
val_t;
233 typedef std::valarray<index_type> jvect_t;
242 index_type* Gc_nz_in,
val_t* Gc_val_in,
ivect_t* Gc_ivect_in, jvect_t* Gc_jvect_in
243 ,index_type* Gh_nz_in,
val_t* Gh_val_in,
ivect_t* Gh_ivect_in, jvect_t* Gh_jvect_in
248 ,
Gf(obj_grad.
Gf),
f(obj_grad.
f),
c(obj_grad.
c),
h(obj_grad.
h)
338 const DVectorSlice&
x_full,
bool newx
383 const DVectorSlice&
x_full,
bool newx
418 mutable FirstOrderExplInfo::jvect_t Gc_jvect_orig_;
421 mutable FirstOrderExplInfo::jvect_t Gh_jvect_orig_;
423 mutable bool Gc_perm_new_basis_updated_;
429 void imp_calc_Gc_or_Gh(
431 ,
const Vector& x,
bool newx
436 void imp_fill_jacobian_entries(
440 ,
const index_type col_offset
441 ,
const value_type *val_full
442 ,
const value_type *val_full_end
443 ,
const index_type *ivect_full
444 ,
const index_type *jvect_full
447 ,index_type *ivect_itr
448 ,index_type *jvect_itr
475 #endif // NLP_SERIAL_PREPROCESS_EXPL_JAC_H
void set_basis(const Permutation &P_var, const Range1D &var_dep, const Permutation *P_equ, const Range1D *equ_decomp)
virtual void calc_Gc(const Vector &x, bool newx=true) const
Update the matrix for Gc at the point x and put it in the stored reference.
NLP node subclass complementing NLPSerialPreprocess for explicit Jacobians.
const Permutation & P_var() const
const basis_sys_ptr_t basis_sys() const
Calls basis_sys_fcty()->create()
void set_factory_Gc_full(const factory_mat_ptr_t &factory_Gc_full)
Initialize with matrix factory for original matrices Gc.
NLPSerialPreprocessExplJac(const basis_sys_fcty_ptr_t &basis_sys_fcty=Teuchos::rcp(new BasisSystemFactoryStd()), const factory_mat_ptr_t &factory_Gc_full=Teuchos::null)
Calls this->set_basis_sys_fcty() and this->set_mat_factories() methods.
Range1D equ_decomp() const
const Permutation & P_equ() const
const FirstOrderExplInfo first_order_expl_info() const
const mat_fcty_ptr_t factory_Gc() const
bool get_next_basis(Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp)
const FirstOrderInfo first_order_info() const
Return objective gradient and zero order information.
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
std::valarray< value_type > val_t
bool is_initialized() const
FirstOrderExplInfo(index_type *Gc_nz_in, val_t *Gc_val_in, ivect_t *Gc_ivect_in, jvect_t *Gc_jvect_in, index_type *Gh_nz_in, val_t *Gh_val_in, ivect_t *Gh_ivect_in, jvect_t *Gh_jvect_in, const ObjGradInfoSerial &obj_grad)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void imp_calc_Gh_orig(const DVectorSlice &x_full, bool newx, const FirstOrderExplInfo &first_order_expl_info) const =0
Calculate the COOR matrix for the gradient for all of the h(x) constaints in the original NLP...
const options_ptr_t & get_options() const
Struct for zero and first order quantities (pointers)
Teuchos::RCP< const OptionsFromStreamPack::OptionsFromStream > options_ptr_t
Teuchos::RCP< const Teuchos::AbstractFactory< MatrixOp > > factory_mat_ptr_t
Struct for zero and explicit first order quantities that subclass must fill in.
virtual size_type imp_Gh_nz_orig() const =0
Return the number of nonzero elements in Gh before elements are removed for fixed variables...
void set_Gc(MatrixOp *Gc)
Validates the type of Gc is correct.
NLP first order information interface class {abstract}.
std::valarray< index_type > ivect_t
virtual void imp_calc_Gc_orig(const DVectorSlice &x_full, bool newx, const FirstOrderExplInfo &first_order_expl_info) const =0
Calculate the COOR matrix for the gradient for all of the c(x) constaints in the original NLP...
virtual size_type imp_Gc_nz_orig() const =0
Return the number of nonzero elements in Gc before elements are removed for fixed variables...
virtual MatrixOp & Gc()
Returns non-const *this->get_Gc().
void set_options(const options_ptr_t &options)
Passes these options on to this->basis_sys_fcty().set_options(options).
void assert_initialized() const
Assert if we have been initizlized (throws UnInitialized)
Struct for serial gradient (objective), objective and constriants (pointers)
void imp_calc_Gc(const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const
STANDARD_COMPOSITION_MEMBERS(BasisSystemFactory, basis_sys_fcty)
Set the BasisSystemFactory object used to create the basis system.
void initialize(bool test_setup)