MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ConstrainedOptPack::MatrixSymPosDefLBFGS Class Reference

Implementation of limited Memory BFGS matrix for arbitrary vector spaces. More...

#include <ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp>

Inheritance diagram for ConstrainedOptPack::MatrixSymPosDefLBFGS:
Inheritance graph
[legend]

Classes

class  PostMod
 PostMod class to use with MemMngPack::AbstractFactorStd. More...
 

Public Member Functions

 MatrixSymPosDefLBFGS (size_type max_size=0, size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
 Calls initial_setup(,,,) More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, auto_rescaling)
 Set whether automatic rescaling is used or not. More...
 
void initial_setup (size_type max_size=0, size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
 Initial setup for the matrix. More...
 
size_type m () const
 
size_type m_bar () const
 
size_type k_bar () const
 
value_type gamma_k () const
 
const DMatrixSlice S () const
 
const DMatrixSlice Y () const
 
bool maintain_original () const
 
bool maintain_inverse () const
 
size_type num_secant_updates () const
 Returns the total number of successful secant updates performed. More...
 
size_type rows () const
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymOpNonsing
MatrixSymOpNonsingoperator= (const MatrixSymOpNonsing &M)
 Calls operator=(MatrixOp&) More...
 
virtual mat_mswons_mut_ptr_t clone_mswons ()
 Clone the non-const matrix object (if supported). More...
 
virtual mat_mswons_ptr_t clone_mswons () const
 Clone the const matrix object (if supported). More...
 
mat_mut_ptr_t clone ()
 Returns this->clone_mswons(). More...
 
mat_ptr_t clone () const
 Returns this->clone_mswons(). More...
 
mat_mns_mut_ptr_t clone_mns ()
 Returns this->clone_mswons(). More...
 
mat_mns_ptr_t clone_mns () const
 Returns this->clone_mswons(). More...
 
mat_mswo_mut_ptr_t clone_mswo ()
 Returns this->clone_mswons(). More...
 
mat_mswo_ptr_t clone_mswo () const
 Returns this->clone_mswons(). More...
 
mat_msns_mut_ptr_t clone_msns ()
 Returns this->clone_mswons(). More...
 
mat_msns_ptr_t clone_msns () const
 Returns this->clone_mswons(). More...
 
mat_mwons_mut_ptr_t clone_mwons ()
 Returns this->clone_mswons(). More...
 
mat_mwons_ptr_t clone_mwons () const
 Returns this->clone_mswons(). More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymOp
virtual MatrixSymOpoperator= (const MatrixSymOp &M)
 Calls operator=(MatrixOp&) More...
 
size_type cols () const
 Returns this->rows() More...
 
const VectorSpacespace_rows () const
 Vector space for vectors that are compatible with the rows of the matrix. More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixOp
virtual void zero_out ()
 M_lhs = 0 : Zero out the matrix. More...
 
virtual void Mt_S (value_type alpha)
 M_lhs *= alpha : Multiply a matrix by a scalar. More...
 
virtual MatrixOpoperator= (const MatrixOp &mwo_rhs)
 M_lhs = mwo_rhs : Virtual assignment operator. More...
 
const MatNorm calc_norm (EMatNormType requested_norm_type=MAT_NORM_1, bool allow_replacement=false) const
 Compute a norm of this matrix. More...
 
virtual mat_ptr_t sub_view (const Range1D &row_rng, const Range1D &col_rng) const
 Create a transient constant sub-matrix view of this matrix (if supported). More...
 
mat_ptr_t sub_view (const index_type &rl, const index_type &ru, const index_type &cl, const index_type &cu) const
 Inlined implementation calls this->sub_view(Range1D(rl,ru),Range1D(cl,cu)). More...
 
virtual mat_ptr_t perm_view (const Permutation *P_row, const index_type row_part[], int num_row_part, const Permutation *P_col, const index_type col_part[], int num_col_part) const
 Create a permuted view: M_perm = P_row' * M * P_col. More...
 
virtual mat_ptr_t perm_view_update (const Permutation *P_row, const index_type row_part[], int num_row_part, const Permutation *P_col, const index_type col_part[], int num_col_part, const mat_ptr_t &perm_view) const
 Reinitialize a permuted view: M_perm = P_row' * M * P_col. More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixBase
virtual ~MatrixBase ()
 Virtual destructor. More...
 
virtual size_type nz () const
 Return the number of nonzero elements in the matrix. More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymNonsing
- Public Member Functions inherited from AbstractLinAlgPack::MatrixNonsing
virtual void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const =0
 v_lhs = inv(op(M_rhs1)) * vs_rhs2 More...
 
virtual void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2) const
 v_lhs = inv(op(M_rhs1)) * sv_rhs2 More...
 
virtual value_type transVtInvMtV (const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
 result = vs_rhs1' * inv(op(M_rhs2)) * vs_rhs3 More...
 
virtual value_type transVtInvMtV (const SpVectorSlice &sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3) const
 result = sv_rhs1' * inv(op(M_rhs2)) * sv_rhs3 More...
 
virtual void M_StInvMtM (MatrixOp *m_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * inv(op(M_rhs1)) * op(mwo_rhs2) (right). More...
 
virtual void M_StMtInvM (MatrixOp *m_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * op(mwo_rhs1) * inv(op(M_rhs2)) (left). More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixOpNonsing
MatrixOpNonsingoperator= (const MatrixOpNonsing &M)
 Calls operator=(MatrixOp&) More...
 
const MatNorm calc_cond_num (EMatNormType requested_norm_type=MAT_NORM_1, bool allow_replacement=false) const
 Compute an estimate of the condition number of this matrix. More...
 

Private Types

typedef
VectorSpace::multi_vec_mut_ptr_t 
multi_vec_mut_ptr_t
 

Private Member Functions

const DMatrixSliceTri R () const
 
const DMatrixSliceTri Lb () const
 Strictly lower triangular part of L. More...
 
DMatrixSlice STY ()
 
const DMatrixSlice STY () const
 
DMatrixSliceSym STS ()
 
const DMatrixSliceSym STS () const
 
DMatrixSliceSym YTY ()
 
const DMatrixSliceSym YTY () const
 
void V_invQtV (DVectorSlice *y, const DVectorSlice &x) const
 y = inv(Q) * x More...
 
void Vp_DtV (DVectorSlice *y, const DVectorSlice &x) const
 y += D * x More...
 
void update_Q () const
 Update Q. More...
 
void assert_initialized () const
 
const DMatrixSliceTri R () const
 
const DMatrixSliceTri Lb () const
 Strictly lower triangular part of L. More...
 
DMatrixSlice STY ()
 
const DMatrixSlice STY () const
 
DMatrixSliceSym STS ()
 
const DMatrixSliceSym STS () const
 
DMatrixSliceSym YTY ()
 
const DMatrixSliceSym YTY () const
 
void V_invQtV (DVectorSlice *y, const DVectorSlice &x) const
 y = inv(Q) * x More...
 
void Vp_DtV (DVectorSlice *y, const DVectorSlice &x) const
 y += D * x More...
 
void update_Q () const
 Update Q. More...
 
void assert_initialized () const
 

Private Attributes

bool maintain_original_
 
bool original_is_updated_
 
bool maintain_inverse_
 
bool inverse_is_updated_
 
VectorSpace::space_ptr_t vec_spc_
 
size_type n_
 
size_type m_
 
size_type m_bar_
 
size_type num_secant_updates_
 
value_type gamma_k_
 
multi_vec_mut_ptr_t S_
 
multi_vec_mut_ptr_t Y_
 
DMatrix STY_
 
DMatrix STSYTY_
 
bool Q_updated_
 
DMatrix QJ_
 
size_type n_max_
 
size_type k_bar_
 
DMatrix S_
 
DMatrix Y_
 
DVector work_
 

Public types

typedef Teuchos::RCP< const
MultiVector > 
multi_vec_ptr_t
 

Constructors and initializers

 MatrixSymPosDefLBFGS (size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
 Calls this->initial_setup() More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, auto_rescaling)
 Set whether automatic rescaling is used or not. More...
 
void initial_setup (size_type m=10, bool maintain_original=true, bool maintain_inverse=true, bool auto_rescaling=false)
 Initial setup for the matrix. More...
 
size_type m () const
 
size_type m_bar () const
 
value_type gamma_k () const
 
const multi_vec_ptr_t S () const
 
const multi_vec_ptr_t Y () const
 
bool maintain_original () const
 
bool maintain_inverse () const
 
size_type num_secant_updates () const
 Returns the total number of successful secant updates performed since this->init_identity() was called. More...
 

Overridden from MatrixOp

const VectorSpace & space_cols () const
 
std::ostream & output (std::ostream &out) const
 
MatrixOp & operator= (const MatrixOp &mwo)
 
void Vp_StMtV (VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
 
std::ostream & output (std::ostream &out) const
 
MatrixOp & operator= (const MatrixOp &m)
 
void Vp_StMtV (DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2, value_type beta) const
 

Overridden from MatrixOpNonsing

void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const
 

Overridden from MatrixSymSecant

void init_identity (const VectorSpace &space_diag, value_type alpha)
 
void init_diagonal (const Vector &diag)
 Actually this calls init_identity( diag.space(), diag.norm_inf() ). More...
 
void secant_update (VectorMutable *s, VectorMutable *y, VectorMutable *Bs)
 
void init_identity (size_type n, value_type alpha)
 
void init_diagonal (const DVectorSlice &diag)
 Actually this calls init_identity( (&diag)->size(), norm_inf(diag) ). More...
 
void secant_update (DVectorSlice *s, DVectorSlice *y, DVectorSlice *Bs)
 

Overridden from MatrixWithOpFactorized

void V_InvMtV (DVectorSlice *v_lhs, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2) const
 

Overridden from MatrixSymAddDelUpdateble

void initialize (value_type alpha, size_type max_size)
 This is fine as long as alpha > 0.0. More...
 
void initialize (const DMatrixSliceSym &A, size_type max_size, bool force_factorization, Inertia inertia, PivotTolerances pivot_tols)
 Sorry, this will throw an exception! More...
 
size_type max_size () const
 
Inertia inertia () const
 Returns (0,0,rows()) More...
 
void set_uninitialized ()
 Will set rows() == 0. More...
 
void augment_update (const DVectorSlice *t, value_type alpha, bool force_refactorization, EEigenValType add_eigen_val, PivotTolerances pivot_tols)
 Augment the matrix to add a row and column. More...
 
void delete_update (size_type jd, bool force_refactorization, EEigenValType drop_eigen_val, PivotTolerances pivot_tols)
 Should always succeed unless user gives a wrong value for drop_eigen_val. More...
 

Detailed Description

Implementation of limited Memory BFGS matrix for arbitrary vector spaces.

Implementation of limited Memory BFGS matrix.

The function set_num_updates_stored() must be called first to set the maximum number of the most recent updates that can be stored. The storage requirements for this class are O( n*m + m*m ) which is O(n*m) when n >> m which is expected (where n is the dimension of the vector space and m is the maximum number of updates stored).

This implementation is based on:

Byrd, Nocedal, and Schnabel, "Representations of quasi-Newton matrices and their use in limited memory methods", Mathematical Programming, 63 (1994)

Consider BFGS updates of the form:

( B^{k-1}, s^{k-1}, y^{k-1} ) -> B^{k}

where:

B^{k} = B^{k-1} - ( (B*s)*(B*s)' / (s'*B*s) )^{k-1} + ( (y*y') / (s'*y) )^{k-1}

B <: R^(n x n)
s <: R^(n)
y <: R^(n)

Now let us consider limited memory updating. For this implementation we set:

Bo = ( 1 / gamma_k ) * I

where:
              / (s^{k-1}'*y^{k-1})/(y^{k-1}'*y^{k-1})           :  if auto_rescaling() == true
    gamma_k = |
            \  1/alpha from last call to init_identity(n,alpha) :  otherwise

Now let us define the matrices S and Y that store the update vectors s^{i} and y^{i} for i = 1 ... m_bar:

S = [ s^{1}, s^{2},...,s^{m_bar} ] <: R^(n x m)
Y = [ y^{1}, y^{2},...,y^{m_bar} ] <: R^(n x m)

Here we are only storing the m_bar <= m most recent update vectors and their ordering is significant. The columns S(:,m_bar) and Y(:,m_bar) contain the most recent update vectors. This is all client needs to know in order to reconstruct the updates themselves.

This class allows matrix-vector products x = B*y and the inverse matrix-vector products x = inv(B)*y to be performed at a cost of about O(n*m_bar^2).

The function set_num_updates_stored(l) must be called first to set the maximum number of the most recent updates that can be stored. The storage requirements for this class are O( n_max*l + l*l ) which is O(n_max*l) when n_max >> l which is expected.

This implementation is based on:

Byrd, Nocedal, and Schnabel, "Representations of quasi-Newton matrices and their use in limited memory methods", Mathematical Programming, 63 (1994)

Consider BFGS updates of the form: {verbatim}

( B^{k-1}, s^{k-1}, y^{k-1} ) -> B^{k}

where:

B^{k} = B^{k-1} - ( (B*s)*(B*s)' / (s'*B*s) )^{k-1} + ( (y*y') / (s'*y) )^{k-1}

B <: R^(n x n) s <: R^(n) y <: R^(n)

{verbatim} Given that we start from the same initial matrix #Bo#, the updated matrix B^{k}# will be the same independent of the order the #(s^{i},y^{i})# updates are added.

Now let us consider limited memory updating. For this implementation we set: {verbatim}

Bo = ( 1 / gamma_k ) * I

where: / (s^{k-1}'*y^{k-1})/(y^{k-1}'*y^{k-1}) : if auto_rescaling() == true gamma_k = | \ alpha from last call to init_identity(n,alpha) : otherwise

{verbatim} Now let us define the matrices S# and Y# that store the update vectors #s^{i}# and #y^{i}# for #i = 1 ... m_bar#: {verbatim}

S = [ s^{1}, s^{2},...,s^{m_bar} ] <: R^(n x m) Y = [ y^{1}, y^{2},...,y^{m_bar} ] <: R^(n x m)

{verbatim} Here we are only storing the m_bar <= m# most recent update vectors and their ordering is arbitrary. The columns #S(:,k_bar)# and #Y(:,k_bar)# contain the most recent update vectors. The next most recent vectors are to the left (i.e. #p = k_bar-1#) and so forth until #p = 1#. Then the next most recent update vectors start at m_bar# and move to the left until you reach the oldest update vector stored at column k_bar+1#. This is all client need to know in order to reconstruct the updates themselves.

This class allows matrix vector products x = B*y and the inverse matrix vector products x = inv(B)*y to be performed at a cost of about O(n*m^2).

In addition, the class supports the MatixSymAddDelUpdateable interface with a few major restrictions. This allows the client to add and remove rows and columns from the matrix.

Definition at line 110 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

Member Typedef Documentation

Definition at line 120 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

typedef VectorSpace::multi_vec_mut_ptr_t ConstrainedOptPack::MatrixSymPosDefLBFGS::multi_vec_mut_ptr_t
private

Definition at line 286 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

Constructor & Destructor Documentation

ConstrainedOptPack::MatrixSymPosDefLBFGS::MatrixSymPosDefLBFGS ( size_type  m = 10,
bool  maintain_original = true,
bool  maintain_inverse = true,
bool  auto_rescaling = false 
)

Calls this->initial_setup()

Definition at line 161 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

ConstrainedOptPack::MatrixSymPosDefLBFGS::MatrixSymPosDefLBFGS ( size_type  max_size = 0,
size_type  m = 10,
bool  maintain_original = true,
bool  maintain_inverse = true,
bool  auto_rescaling = false 
)

Calls initial_setup(,,,)

Member Function Documentation

ConstrainedOptPack::MatrixSymPosDefLBFGS::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
auto_rescaling   
)

Set whether automatic rescaling is used or not.

This function must be called before a BFGS update is performed in order for it to take effect for that update.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::initial_setup ( size_type  m = 10,
bool  maintain_original = true,
bool  maintain_inverse = true,
bool  auto_rescaling = false 
)

Initial setup for the matrix.

This function must be called before init_identity(n) is called in order for these setting to have affect. When this function is called all current updates are lost and the matrix becomes uninitialized.

Parameters
m[in] Max number of recent update vectors s and y stored.
maintain_original[in] If true then quantities needed to compute x = Bk*y will be maintained, otherwise they will not be unless needed. This is to save computational costs in case matrix-vector products will never be needed. However, if a matrix vector product is needed then these quantities will be computed on the fly in order to satisfy the request.
maintain_inverse[in] If true then quantities needed to compute x = inv(Bk)*y = x = Hk*y will be maintained, otherwise they will not be unless needed. This is to save computational costs in case inverse matrix-vector products will never be needed. However, if the inverse product is ever needed then the needed quantities will be computed on the fly in order to satisfiy the request. Because it takes so little extra work to maintain the quantities needed for Hk it is recommended to always set this to true.
auto_rescaling[in] See intro.

Definition at line 171 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m ( ) const
inline

Definition at line 360 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m_bar ( ) const
inline

Definition at line 366 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

value_type ConstrainedOptPack::MatrixSymPosDefLBFGS::gamma_k ( ) const
inline

Definition at line 372 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::S ( ) const
inline

Definition at line 379 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::Y ( ) const
inline

Definition at line 386 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_original ( ) const
inline

Definition at line 392 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_inverse ( ) const
inline

Definition at line 398 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::num_secant_updates ( ) const
inline

Returns the total number of successful secant updates performed since this->init_identity() was called.

Definition at line 404 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

const VectorSpace & ConstrainedOptPack::MatrixSymPosDefLBFGS::space_cols ( ) const
virtual
std::ostream & ConstrainedOptPack::MatrixSymPosDefLBFGS::output ( std::ostream &  out) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 203 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

MatrixOp & ConstrainedOptPack::MatrixSymPosDefLBFGS::operator= ( const MatrixOp &  mwo)

Definition at line 227 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::Vp_StMtV ( VectorMutable *  v_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const Vector &  v_rhs2,
value_type  beta 
) const

Definition at line 263 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::V_InvMtV ( VectorMutable *  v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const Vector &  v_rhs2 
) const

Definition at line 353 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::init_identity ( const VectorSpace &  space_diag,
value_type  alpha 
)

Definition at line 477 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::init_diagonal ( const Vector &  diag)

Actually this calls init_identity( diag.space(), diag.norm_inf() ).

This initialization is not convienent for this implementation. Besides, when we are using automatric rescaling (auto_rescaling == true) then this will really not matter much anyway.

Definition at line 509 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::secant_update ( VectorMutable *  s,
VectorMutable *  y,
VectorMutable *  Bs 
)

Definition at line 514 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

const DMatrixSliceTri ConstrainedOptPack::MatrixSymPosDefLBFGS::R ( ) const
inlineprivate

Definition at line 111 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

const DMatrixSliceTri ConstrainedOptPack::MatrixSymPosDefLBFGS::Lb ( ) const
inlineprivate

Strictly lower triangular part of L.

Definition at line 117 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::STY ( )
inlineprivate

Definition at line 123 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::STY ( ) const
inlineprivate

Definition at line 129 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::STS ( )
inlineprivate

Definition at line 135 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

const DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::STS ( ) const
inlineprivate

Definition at line 141 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::YTY ( )
inlineprivate

Definition at line 147 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

const DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::YTY ( ) const
inlineprivate

Definition at line 153 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::V_invQtV ( DVectorSlice *  y,
const DVectorSlice &  x 
) const
private

y = inv(Q) * x

Definition at line 806 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::Vp_DtV ( DVectorSlice *  y,
const DVectorSlice &  x 
) const
private

y += D * x

Definition at line 676 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::update_Q ( ) const
private

Update Q.

Definition at line 716 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::assert_initialized ( ) const
private

Definition at line 912 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.cpp.

ConstrainedOptPack::MatrixSymPosDefLBFGS::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
auto_rescaling   
)

Set whether automatic rescaling is used or not.

This function must be called before a BFGS update is performed in order for it to take effect for that update.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::initial_setup ( size_type  max_size = 0,
size_type  m = 10,
bool  maintain_original = true,
bool  maintain_inverse = true,
bool  auto_rescaling = false 
)

Initial setup for the matrix.

This function must be called before init_identity(n) is called. When this function is called all current updates are lost and the matrix becomes uninitialized.

Parameters
max_size[in] If max_size > 0 then this is the max size the matrix is allowed to become. If max_size == 0 then this size will be determined by one of the initialization methods.
m[in] Max number of recent update vectors stored
maintain_original[in] If true then quantities needed to compute x = Bk*y will be maintained, otherwise they will not be unless needed. This is to save computational costs in case matrix vector products will never be needed. However, if a matrix vector product is needed then these quantities will be computed on the fly in order to satisfy the request.
maintain_inverse[in] If true then quantities needed to compute x = inv(Bk)*y = x = Hk*y will be maintained , otherwise they will not be unless needed. This is to save computational costs in case inverse matrix vector products will never be needed. However, if the inverse product is ever needed then the needed quantities will be computed on the fly in order to satisfiy the request. Because it takes so little extra work to maintain the quantities needed for Hk it is recommended to always set this to true.
auto_rescaling[in] See intro.
size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m ( ) const

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m_bar ( ) const

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::k_bar ( ) const
inline
value_type ConstrainedOptPack::MatrixSymPosDefLBFGS::gamma_k ( ) const

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::S ( ) const

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::Y ( ) const

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_original ( ) const

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_inverse ( ) const

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::num_secant_updates ( ) const

Returns the total number of successful secant updates performed.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::rows ( ) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixBase.

std::ostream& ConstrainedOptPack::MatrixSymPosDefLBFGS::output ( std::ostream &  out) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixOp.

MatrixOp& ConstrainedOptPack::MatrixSymPosDefLBFGS::operator= ( const MatrixOp &  m)

void ConstrainedOptPack::MatrixSymPosDefLBFGS::Vp_StMtV ( DVectorSlice *  vs_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const DVectorSlice &  vs_rhs2,
value_type  beta 
) const

void ConstrainedOptPack::MatrixSymPosDefLBFGS::V_InvMtV ( DVectorSlice *  v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const DVectorSlice &  vs_rhs2 
) const

void ConstrainedOptPack::MatrixSymPosDefLBFGS::init_identity ( size_type  n,
value_type  alpha 
)

void ConstrainedOptPack::MatrixSymPosDefLBFGS::init_diagonal ( const DVectorSlice &  diag)

Actually this calls init_identity( (&diag)->size(), norm_inf(diag) ).

This initialization is not convienent for this implementation. Besides, when we are using automatric rescaling (auto_rescaling == true) then this will really not matter much anyway.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::secant_update ( DVectorSlice *  s,
DVectorSlice *  y,
DVectorSlice *  Bs 
)

void ConstrainedOptPack::MatrixSymPosDefLBFGS::initialize ( value_type  alpha,
size_type  max_size 
)

This is fine as long as alpha > 0.0.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::initialize ( const DMatrixSliceSym &  A,
size_type  max_size,
bool  force_factorization,
Inertia  inertia,
PivotTolerances  pivot_tols 
)

Sorry, this will throw an exception!

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::max_size ( ) const

Inertia ConstrainedOptPack::MatrixSymPosDefLBFGS::inertia ( ) const

Returns (0,0,rows())

void ConstrainedOptPack::MatrixSymPosDefLBFGS::set_uninitialized ( )

Will set rows() == 0.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::augment_update ( const DVectorSlice *  t,
value_type  alpha,
bool  force_refactorization,
EEigenValType  add_eigen_val,
PivotTolerances  pivot_tols 
)

Augment the matrix to add a row and column.

This function is very limited in what it will do. It will throw exceptions if alpha <= 0.0 or t != NULL or add_eigen_val == EIGEN_VAL_NEG or this->rows() == this->max_size(). The obvious postconditions for this function will only technically be satisfied if alpha == this->gamma_k().

void ConstrainedOptPack::MatrixSymPosDefLBFGS::delete_update ( size_type  jd,
bool  force_refactorization,
EEigenValType  drop_eigen_val,
PivotTolerances  pivot_tols 
)

Should always succeed unless user gives a wrong value for drop_eigen_val.

const DMatrixSliceTri ConstrainedOptPack::MatrixSymPosDefLBFGS::R ( ) const
private

const DMatrixSliceTri ConstrainedOptPack::MatrixSymPosDefLBFGS::Lb ( ) const
private

Strictly lower triangular part of L.

DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::STY ( )
private

const DMatrixSlice ConstrainedOptPack::MatrixSymPosDefLBFGS::STY ( ) const
private

DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::STS ( )
private

const DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::STS ( ) const
private

DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::YTY ( )
private

const DMatrixSliceSym ConstrainedOptPack::MatrixSymPosDefLBFGS::YTY ( ) const
private

void ConstrainedOptPack::MatrixSymPosDefLBFGS::V_invQtV ( DVectorSlice *  y,
const DVectorSlice &  x 
) const
private

y = inv(Q) * x

void ConstrainedOptPack::MatrixSymPosDefLBFGS::Vp_DtV ( DVectorSlice *  y,
const DVectorSlice &  x 
) const
private

y += D * x

void ConstrainedOptPack::MatrixSymPosDefLBFGS::update_Q ( ) const
private

Update Q.

void ConstrainedOptPack::MatrixSymPosDefLBFGS::assert_initialized ( ) const
private

Member Data Documentation

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_original_
private

Definition at line 291 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::original_is_updated_
private

Definition at line 292 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::maintain_inverse_
private

Definition at line 293 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::inverse_is_updated_
private

Definition at line 294 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

VectorSpace::space_ptr_t ConstrainedOptPack::MatrixSymPosDefLBFGS::vec_spc_
private

Definition at line 297 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::n_
private

Definition at line 299 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m_
private

Definition at line 299 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::m_bar_
private

Definition at line 299 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::num_secant_updates_
private

Definition at line 299 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

value_type ConstrainedOptPack::MatrixSymPosDefLBFGS::gamma_k_
private

Definition at line 304 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

multi_vec_mut_ptr_t ConstrainedOptPack::MatrixSymPosDefLBFGS::S_
private

Definition at line 307 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

multi_vec_mut_ptr_t ConstrainedOptPack::MatrixSymPosDefLBFGS::Y_
private

Definition at line 307 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

DMatrix ConstrainedOptPack::MatrixSymPosDefLBFGS::STY_
private

Definition at line 311 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

DMatrix ConstrainedOptPack::MatrixSymPosDefLBFGS::STSYTY_
private

Definition at line 311 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

bool ConstrainedOptPack::MatrixSymPosDefLBFGS::Q_updated_
mutableprivate

Definition at line 317 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

DMatrix ConstrainedOptPack::MatrixSymPosDefLBFGS::QJ_
mutableprivate

Definition at line 318 of file ConstrainedOptPack_MatrixSymPosDefLBFGS.hpp.

size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::n_max_
private
size_type ConstrainedOptPack::MatrixSymPosDefLBFGS::k_bar_
private
DMatrix ConstrainedOptPack::MatrixSymPosDefLBFGS::S_
private
DMatrix ConstrainedOptPack::MatrixSymPosDefLBFGS::Y_
private
DVector ConstrainedOptPack::MatrixSymPosDefLBFGS::work_
mutableprivate

The documentation for this class was generated from the following files: