TMB Documentation  v1.9.11
Public Member Functions | List of all members
TMBad::Decomp2< ADFun > Struct Template Reference

Decomposition of computational graph. More...

#include <TMBad.hpp>

Public Member Functions

Decomp3< ADFunHesFun (std::vector< bool > keep_rc=std::vector< bool >(0), bool sparse_1=true, bool sparse_2=true, bool sparse_3=true)
 Calculate a sparse plus low rank representation of the Hessian. More...
 

Detailed Description

template<class ADFun>
struct TMBad::Decomp2< ADFun >

Decomposition of computational graph.

This structure holds a decomposition (f,g) of a computational graph of the form x -> f(x, g(x)) mapping R^n to R^m.

Definition at line 13 of file TMBad.hpp.

Member Function Documentation

§ HesFun()

template<class ADFun>
Decomp3<ADFun> TMBad::Decomp2< ADFun >::HesFun ( std::vector< bool >  keep_rc = std::vector<bool>(0),
bool  sparse_1 = true,
bool  sparse_2 = true,
bool  sparse_3 = true 
)
inline

Calculate a sparse plus low rank representation of the Hessian.

Recall that the present object represents a composition f(x, g(x)). Its Hessian is a sum of five terms:

\[ \nabla_x^2 f(x, g(x)) = f''_{xx}(x, g(x)) + f''_{xy}(x, g(x)) g'(x) + g'(x) f''_{yx}(x, g(x)) + f'_y(x, g(x)) g''(x) + g'(x) f''_{yy}(x, g(x)) g'(x) \]

The result is a structure of three components

  1. The first four terms are represented by a sparse matrix H
  2. The g' of the last term represented by a sparse matrix
  3. f''_{yy} represented by a sparse matrix
Parameters
keep_rcRows/cols to keep. If used this mask selects a subset of x.
sparse_1Return sparse first component
sparse_2Return sparse second component
sparse_3Return sparse third component
Note
This function preserves the inner/outer parameter categories if in use.

Definition at line 1285 of file TMBad.hpp.


The documentation for this struct was generated from the following file:
License: GPL v2