Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Hessian Sparsity Patterns

Syntax
af.for_hes_sparsity(select_domainselect_rangepattern_out)
af.rev_hes_sparsity(select_domainselect_rangepattern_out)

Purpose
We use @(@ F : \B{R}^n \rightarrow \B{R}^m @)@ to denote the function corresponding to the operation sequence stored in af . Fix a diagonal matrix @(@ D \in \B{R}^{n \times n} @)@, fix a vector @(@ r \in \B{R}^m @)@, and define @[@ H(x) = D (r^\R{T} F)^{(2)} ( x ) D @]@ Given a sparsity pattern for @(@ D @)@ and @(@ r @)@, these routines compute a sparsity pattern for @(@ H(x) @)@.

x
Note that a sparsity pattern for @(@ H(x) @)@ corresponds to the operation sequence stored in af and does not depend on the argument x .

af
The object af has prototype
     a_fun 
af

select_domain
The argument select_domain has prototype
     const vec_bool& 
select_domain
It has size n and is a sparsity pattern for the diagonal of @(@ D @)@; i.e., select_domain[j] is true if and only if @(@ D_{j,j} @)@ is possibly non-zero.

select_range
The argument select_range has prototype
     const vec_bool& 
select_range
It has size m and is a sparsity pattern for the vector @(@ r @)@; i.e., select_range[i] is true if and only if @(@ r_i @)@ is possibly non-zero.

pattern_out
This argument has prototype
     sparse_rc<
SizeVector>& pattern_out
This input value of pattern_out does not matter. Upon return pattern_out is a sparsity pattern for @(@ J(x) @)@.

Sparsity for Component Wise Hessian
Suppose that @(@ D @)@ is the identity matrix, and only the i-th component of r is possibly non-zero. In this case, pattern_out is a sparsity pattern for @(@ F_i^{(2)} ( x ) @)@.

Example
C++ , Octave , Perl , Python .
Input File: lib/sparse.cpp