NLPInterfacePack::NLPSerialPreprocessExplJac Class Reference

NLP node subclass complementing NLPSerialPreprocess for explicit Jacobians. More...

#include <NLPInterfacePack_NLPSerialPreprocessExplJac.hpp>

Inheritance diagram for NLPInterfacePack::NLPSerialPreprocessExplJac:

[legend]
List of all members.

Public types

typedef Teuchos::RefCountPtr<
const Teuchos::AbstractFactory<
MatrixOp > > 
factory_mat_ptr_t
 

Constructors / initializers

typedef Teuchos::RefCountPtr<
BasisSystemFactory > 
basis_sys_fcty_ptr_t
void set_basis_sys_fcty (const Teuchos::RefCountPtr< BasisSystemFactory > &basis_sys_fcty)
 Set the BasisSystemFactory object used to create the basis system.
Teuchos::RefCountPtr< BasisSystemFactory > get_basis_sys_fcty () const
BasisSystemFactory & basis_sys_fcty ()
const BasisSystemFactory & basis_sys_fcty () const
 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.
void set_factory_Gc_full (const factory_mat_ptr_t &factory_Gc_full)
 Initialize with matrix factory for original matrices Gc.
Teuchos::RefCountPtr< BasisSystemFactory > basis_sys_fcty_

Overridden public members from NLP

void set_options (const options_ptr_t &options)
 Passes these options on to this->basis_sys_fcty().set_options(options).
const options_ptr_tget_options () const
 
void initialize (bool test_setup)
 
bool is_initialized () const
 

Overridden public members from NLPFirstOrder

const mat_fcty_ptr_t factory_Gc () const
 
const basis_sys_ptr_t basis_sys () const
 Calls basis_sys_fcty()->create().
void set_Gc (MatrixOp *Gc)
 Validates the type of Gc is correct.

Overridden public members from NLPVarReductPerm

bool get_next_basis (Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp)
 
void set_basis (const Permutation &P_var, const Range1D &var_dep, const Permutation *P_equ, const Range1D *equ_decomp)
 

Overridden protected members from NLPFirstOrder

void imp_calc_Gc (const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const
 

Pure virtual template methods to be defined by subclasses

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 size_type imp_Gh_nz_orig () const =0
 Return the number of nonzero elements in Gh before elements are removed for fixed variables.
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 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.

Protected member functions for subclasses to use

void assert_initialized () const
 Assert if we have been initizlized (throws UnInitialized).
const FirstOrderExplInfo first_order_expl_info () const
 

Private Member Functions

void imp_calc_Gc_or_Gh (bool calc_Gc, const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const
void imp_fill_jacobian_entries (size_type n, size_type n_full, bool load_struct, const index_type col_offset, const value_type *val_full, const value_type *val_full_end, const index_type *ivect_full, const index_type *jvect_full, index_type *nz, value_type *val_itr, index_type *ivect_itr, index_type *jvect_itr) const

Private Attributes

bool initialized_
bool test_setup_
options_ptr_t options_
factory_mat_ptr_t factory_Gc_full_
mat_fcty_ptr_t factory_Gc_
size_type Gc_nz_orig_
size_type Gh_nz_orig_
size_type Gc_nz_full_
size_type Gh_nz_full_
FirstOrderExplInfo::val_t Gc_val_orig_
FirstOrderExplInfo::ivect_t Gc_ivect_orig_
FirstOrderExplInfo::jvect_t Gc_jvect_orig_
FirstOrderExplInfo::val_t Gh_val_orig_
FirstOrderExplInfo::ivect_t Gh_ivect_orig_
FirstOrderExplInfo::jvect_t Gh_jvect_orig_
bool Gc_perm_new_basis_updated_

Detailed Description

NLP node subclass complementing NLPSerialPreprocess for explicit Jacobians.

This subclass does a lot of work. It has to consider several different types of variability. The matrices Gc and Gh that are computed must take into consideration whether or not inequalities are converted to equalities (convert_inequ_to_equ) and the permutation of the entries according to the current basis selection.


    Gc = P_var * [  Gc_orig    Gh_orig   ] * P_equ'
                 [     0          -I     ]

 
This class also comes with a default implementation for the BasisSystemPerm object which is created by a BasisSystemPermFactory object that the client (or the subclass) can specify. The default implementation for this factory object is from BasisSystemPermFactoryStd which uses the AbstractLinAlgPack::BasisSystemPermDirectSparse subclass and supports several different linear solvers by default. The client (or subclass) can augment the list of supported linear solvers easily.

ToDo: Finish documentation!

Subclass developers

Subclass developer's don't have to worry about slack variables or basis permutations. A concreate subclass just has to override the functions that defined the original NLP (see the tutorial example NLP ???).

In addition to the methods that must be overridden in NLPSerialPreprocess (see) the following methods must be overridden as well: imp_Gc_nz_orig(), imp_Gh_nz_orig(), imp_calc_Gc_orig(), imp_calc_Gh_orig().

Definition at line 80 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.


Member Typedef Documentation

typedef Teuchos::RefCountPtr< const Teuchos::AbstractFactory<MatrixOp> > NLPInterfacePack::NLPSerialPreprocessExplJac::factory_mat_ptr_t
 

Definition at line 91 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

typedef Teuchos::RefCountPtr< BasisSystemFactory > NLPInterfacePack::NLPSerialPreprocessExplJac::basis_sys_fcty_ptr_t
 

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.


Constructor & Destructor Documentation

NLPInterfacePack::NLPSerialPreprocessExplJac::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.

Definition at line 55 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.


Member Function Documentation

void NLPInterfacePack::NLPSerialPreprocessExplJac::set_basis_sys_fcty const Teuchos::RefCountPtr< BasisSystemFactory > &  basis_sys_fcty  )  [inline]
 

Set the BasisSystemFactory object used to create the basis system.

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

Teuchos::RefCountPtr< BasisSystemFactory > NLPInterfacePack::NLPSerialPreprocessExplJac::get_basis_sys_fcty  )  const [inline]
 

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

BasisSystemFactory& NLPInterfacePack::NLPSerialPreprocessExplJac::basis_sys_fcty  )  [inline]
 

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

const BasisSystemFactory& NLPInterfacePack::NLPSerialPreprocessExplJac::basis_sys_fcty  )  const [inline]
 

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::set_factory_Gc_full const factory_mat_ptr_t factory_Gc_full  ) 
 

Initialize with matrix factory for original matrices Gc.

This matrix type will be used for AbstractLinAlgPack::MatrixPermAggr::mat_orig() returned by the initialized Gc.

Parameters:
factory_Gc_full [in] Smart pointer to matrix factory for Gc_full. If factory_Gc_full.get() == NULL then the concrete matrix type ??? will be used as the default.

Definition at line 65 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::set_options const options_ptr_t options  )  [virtual]
 

Passes these options on to this->basis_sys_fcty().set_options(options).

Reimplemented from NLPInterfacePack::NLP.

Definition at line 79 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

const NLP::options_ptr_t & NLPInterfacePack::NLPSerialPreprocessExplJac::get_options  )  const [virtual]
 

Reimplemented from NLPInterfacePack::NLP.

Definition at line 85 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::initialize bool  test_setup  )  [virtual]
 

Reimplemented from NLPInterfacePack::NLPFirstOrder.

Reimplemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

Definition at line 90 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

bool NLPInterfacePack::NLPSerialPreprocessExplJac::is_initialized  )  const [virtual]
 

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Reimplemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

Definition at line 124 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

const NLPFirstOrder::mat_fcty_ptr_t NLPInterfacePack::NLPSerialPreprocessExplJac::factory_Gc  )  const [virtual]
 

Implements NLPInterfacePack::NLPFirstOrder.

Definition at line 131 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

const NLPFirstOrder::basis_sys_ptr_t NLPInterfacePack::NLPSerialPreprocessExplJac::basis_sys  )  const [virtual]
 

Calls basis_sys_fcty()->create().

Reimplemented from NLPInterfacePack::NLPFirstOrder.

Definition at line 137 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::set_Gc MatrixOp *  Gc  )  [virtual]
 

Validates the type of Gc is correct.

Reimplemented from NLPInterfacePack::NLPFirstOrder.

Definition at line 144 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

bool NLPInterfacePack::NLPSerialPreprocessExplJac::get_next_basis Permutation *  P_var,
Range1D var_dep,
Permutation *  P_equ,
Range1D equ_decomp
[virtual]
 

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 156 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::set_basis const Permutation &  P_var,
const Range1D var_dep,
const Permutation *  P_equ,
const Range1D equ_decomp
[virtual]
 

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 170 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::imp_calc_Gc const Vector x,
bool  newx,
const FirstOrderInfo &  first_order_info
const [protected, virtual]
 

Implements NLPInterfacePack::NLPFirstOrder.

Definition at line 183 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

virtual size_type NLPInterfacePack::NLPSerialPreprocessExplJac::imp_Gc_nz_orig  )  const [protected, pure virtual]
 

Return the number of nonzero elements in Gc before elements are removed for fixed variables.

The value returned from this method before the first time imp_calc_Gc() is called is an upper estimate of the number of nonzeros. To get the actual number of nonzeros, call this function again after imp_calc_Gc() has been called.

Implemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

virtual size_type NLPInterfacePack::NLPSerialPreprocessExplJac::imp_Gh_nz_orig  )  const [protected, pure virtual]
 

Return the number of nonzero elements in Gh before elements are removed for fixed variables.

The value returned from this method before the first time imp_calc_Gh() is called is an upper estimate of the number of nonzeros. To get the actual number of nonzeros, call this function again after imp_calc_Gh() has been called.

Implemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

virtual void NLPInterfacePack::NLPSerialPreprocessExplJac::imp_calc_Gc_orig const DVectorSlice x_full,
bool  newx,
const FirstOrderExplInfo first_order_expl_info
const [protected, pure virtual]
 

Calculate the COOR matrix for the gradient for all of the c(x) constaints in the original NLP.

Parameters:
x_full [in] Unknown vector (size n_full).
newx [in] True if is a new point.
first_order_expl_info [out] Pointers to zero and first order quantities . On output, *first_order_expl_info.Gc_nz must be set to the actual number of nonzero elements in Gc and the array of nonzero entry values *first_order_expl_info.Gc_val must also be set. The nonzero structure must also be set in the arrays *first_order_expl_info.Gc_ivect and *first_order_expl_info.Gc_jvect if first_order_expl_info.Gc_ivect != NULL. In addition, any of the other quantities pointed to in first_order_expl_info may be set on output, but are not guaranteed to be.
Preconditions:
  • first_order_expl_info.Gc_nz != NULL
  • first_order_expl_info.Gc_val != NULL
  • (first_order_expl_info.Gc_ivect != NULL) == (first_order_expl_info.Gc_jvect != NULL)

Postconditions:

  • *first_order_expl_info.Gc_nz is updated to number of nonzero elements set in *first_order_expl_info.Gc_val.
  • (*first_order_expl_info.Gc_val)[k], for k = 1...*first_order_expl_info.Gc_nz is set to the nonzero entry values in Gc.
  • [first_order_expl_info.Gc_ivect != NULL] (*first_order_expl_info.Gc_ivect)[k], for k = 1...*first_order_expl_info.Gc_nz is set to the row indexes for the nonzero entires in Gc.
  • [first_order_expl_info.Gc_jvect != NULL] (*first_order_expl_info.Gc_jvect)[k], for k = 1...*first_order_expl_info.Gc_nz is set to the column indexes for the nonzero entires in Gc.

Note that duplicate entires with the same row and column indexes are allowed. In this case, the matrix entries are considered to be summed.

Implemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

virtual void NLPInterfacePack::NLPSerialPreprocessExplJac::imp_calc_Gh_orig const DVectorSlice x_full,
bool  newx,
const FirstOrderExplInfo first_order_expl_info
const [protected, pure virtual]
 

Calculate the COOR matrix for the gradient for all of the h(x) constaints in the original NLP.

Parameters:
x_full [in] Unknown vector (size n_full).
newx [in] True if is a new point.
first_order_expl_info [out] Pointers to zero and first order quantities . On output, *first_order_expl_info.Gh_nz must be set to the actual number of nonzero elements in Gh and the array of nonzero entry values *first_order_expl_info.Gh_val must also be set. The nonzero structure must also be set in the arrays *first_order_expl_info.Gh_ivect and *first_order_expl_info.Gh_jvect if first_order_expl_info.Gh_ivect != NULL. In addition, any of the other quantities pointed to in first_order_expl_info may be set on output, but are not guaranteed to be.
Preconditions:
  • first_order_expl_info.Gh_nz != NULL
  • first_order_expl_info.Gh_val != NULL
  • (first_order_expl_info.Gh_ivect != NULL) == (first_order_expl_info.Gh_jvect != NULL)

Postconditions:

  • *first_order_expl_info.Gh_nz is updated to number of nonzero elements set in *first_order_expl_info.Gh_val.
  • (*first_order_expl_info.Gh_val)[k], for k = 1...*first_order_expl_info.Gh_nz is set to the nonzero entry values in Gh.
  • [first_order_expl_info.Gh_ivect != NULL] (*first_order_expl_info.Gh_ivect)[k], for k = 1...*first_order_expl_info.Gh_nz is set to the row indexes for the nonzero entires in Gh.
  • [first_order_expl_info.Gh_jvect != NULL] (*first_order_expl_info.Gh_jvect)[k], for k = 1...*first_order_expl_info.Gh_nz is set to the column indexes for the nonzero entires in Gh.

Note that duplicate entires with the same row and column indexes are allowed. In this case, the matrix entries are considered to be summed.

Implemented in NLPInterfacePack::ExampleNLPBanded, and NLPInterfacePack::NLPWBCounterExample.

void NLPInterfacePack::NLPSerialPreprocessExplJac::assert_initialized  )  const [protected]
 

Assert if we have been initizlized (throws UnInitialized).

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 435 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.

const NLPSerialPreprocessExplJac::FirstOrderExplInfo NLPInterfacePack::NLPSerialPreprocessExplJac::first_order_expl_info  )  const [inline, protected]
 

Definition at line 445 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

void NLPInterfacePack::NLPSerialPreprocessExplJac::imp_calc_Gc_or_Gh bool  calc_Gc,
const Vector x,
bool  newx,
const FirstOrderInfo &  first_order_info
const [private]
 

void NLPInterfacePack::NLPSerialPreprocessExplJac::imp_fill_jacobian_entries size_type  n,
size_type  n_full,
bool  load_struct,
const index_type  col_offset,
const value_type val_full,
const value_type val_full_end,
const index_type ivect_full,
const index_type jvect_full,
index_type nz,
value_type val_itr,
index_type ivect_itr,
index_type jvect_itr
const [private]
 

Definition at line 444 of file NLPInterfacePack_NLPSerialPreprocessExplJac.cpp.


Member Data Documentation

Teuchos::RefCountPtr< BasisSystemFactory > NLPInterfacePack::NLPSerialPreprocessExplJac::basis_sys_fcty_ [private]
 

Definition at line 99 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

bool NLPInterfacePack::NLPSerialPreprocessExplJac::initialized_ [private]
 

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 392 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

bool NLPInterfacePack::NLPSerialPreprocessExplJac::test_setup_ [private]
 

Definition at line 393 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

options_ptr_t NLPInterfacePack::NLPSerialPreprocessExplJac::options_ [private]
 

Definition at line 394 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

factory_mat_ptr_t NLPInterfacePack::NLPSerialPreprocessExplJac::factory_Gc_full_ [private]
 

Definition at line 396 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

mat_fcty_ptr_t NLPInterfacePack::NLPSerialPreprocessExplJac::factory_Gc_ [private]
 

Definition at line 397 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

size_type NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_nz_orig_ [mutable, private]
 

Definition at line 399 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

size_type NLPInterfacePack::NLPSerialPreprocessExplJac::Gh_nz_orig_ [mutable, private]
 

Definition at line 400 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

size_type NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_nz_full_ [mutable, private]
 

Definition at line 401 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

size_type NLPInterfacePack::NLPSerialPreprocessExplJac::Gh_nz_full_ [mutable, private]
 

Definition at line 402 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::val_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_val_orig_ [mutable, private]
 

Definition at line 403 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::ivect_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_ivect_orig_ [mutable, private]
 

Definition at line 404 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::jvect_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_jvect_orig_ [mutable, private]
 

Definition at line 405 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::val_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gh_val_orig_ [mutable, private]
 

Definition at line 406 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::ivect_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gh_ivect_orig_ [mutable, private]
 

Definition at line 407 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

FirstOrderExplInfo::jvect_t NLPInterfacePack::NLPSerialPreprocessExplJac::Gh_jvect_orig_ [mutable, private]
 

Definition at line 408 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.

bool NLPInterfacePack::NLPSerialPreprocessExplJac::Gc_perm_new_basis_updated_ [mutable, private]
 

Definition at line 410 of file NLPInterfacePack_NLPSerialPreprocessExplJac.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:36:24 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1