CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Base >
template<class VectorBase , class VectorSet , class VectorSize >
size_t CppAD::ADFun< Base >::SparseHessianCompute ( const VectorBase &  x,
const VectorBase &  w,
VectorSet &  sparsity,
const VectorSize &  user_row,
const VectorSize &  user_col,
VectorBase &  hes,
sparse_hessian_work work 

Private helper function that does computation for all Sparse Hessian cases.

Template Parameters
Baseis the base type for the recording that is stored in this ADFun<Base object.
VectorBaseis a simple vector class with elements of type Base.
VectorSetis a simple vector class with elements of type bool or std::set<size_t>.
VectorSizeis sparse_pack or sparse_list.
x[in] is a vector specifing the point at which to compute the Hessian.
w[in] is the weighting vector that defines a scalar valued function by a weighted sum of the components of the vector valued function $latex F(x)$$.
sparsity[in] is the sparsity pattern for the Hessian that we are calculating.
user_row[in] is the vector of row indices for the returned Hessian values.
user_col[in] is the vector of columns indices for the returned Hessian values. It must have the same size as user_row.
hes[out] is the vector of Hessian values. It must have the same size as user_row. The return value hes[k] is the second partial of $ w^{\rm T} F(x)$ with respect to the row[k] and col[k] component of $ x$.
workThis structure contains information that is computed by SparseHessianCompute. If the sparsity pattern, row vector, or col vectors are not the same between calls to SparseHessianCompute, work.clear() must be called to reinitialize work.
Is the number of first order forward sweeps used to compute the requested Hessian values. (This is also equal to the number of second order reverse sweeps.) The total work, not counting the zero order forward sweep, or the time to combine computations, is proportional to this return value.

Definition at line 418 of file sparse_hessian.hpp.