Prev Next

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
Atomic Forward Hessian Sparsity Patterns

ok = afun.for_sparse_hes(vxrshx)

Deprecated 2016-06-27
ok = afun.for_sparse_hes(vxrsh)

This function is used by ForSparseHes to compute Hessian sparsity patterns. If you are using ForSparseHes , one of the versions of this virtual function must be defined by the atomic_user class.

Given a sparsity pattern for a diagonal matrix @(@ R \in B^{n \times n} @)@, and a row vector @(@ S \in B^{1 \times m} @)@, this routine computes the sparsity pattern for @[@ H(x) = R^\R{T} \cdot (S \cdot f)^{(2)}( x ) \cdot R @]@

If you are using and ForSparseHes , this virtual function must be defined by the atomic_user class.

The argument vx has prototype
     const CppAD:vector<bool>& 
vx.size() == n , and for @(@ j = 0 , \ldots , n-1 @)@, vx[j] is true if and only if ax[j] is a variable in the corresponding call to

This argument has prototype
     const CppAD:vector<bool>& 
and is a atomic_sparsity pattern for the diagonal of @(@ R \in B^{n \times n} @)@.

The argument s has prototype
     const CppAD:vector<bool>& 
and its size is m . It is a sparsity pattern for @(@ S \in B^{1 \times m} @)@.

This argument has prototype
The input value of its elements are not specified (must not matter). Upon return, h is a atomic_sparsity pattern for @(@ H(x) \in B^{n \times n} @)@ which is defined above.

The argument has prototype
     const CppAD::vector<
Base>& x
and size is equal to the n . This is the Value value corresponding to the parameters in the vector ax (when the atomic function was called). To be specific, if
     if( Parameter(
ax[i]) == true )
x[i] = Value( ax[i] );
x[i] = CppAD::numeric_limits<Base>::quiet_NaN();
The version of this function with out the x argument is deprecated; i.e., you should include the argument even if you do not use it.

The file atomic_for_sparse_hes.cpp contains an example and test that uses this routine. It returns true if the test passes and false if it fails.
Input File: cppad/core/atomic_base.hpp