[CppAD] How to get Jacobian & Hessian matrix in sparse form

Brad Bell bradbell at seanet.com
Mon Oct 22 08:33:07 EDT 2007


The routines ForTwo
    http://www.coin-or.org/CppAD/Doc/fortwo.xml
and RevTwo
    http://www.coin-or.org/CppAD/Doc/revtwo.xml
can be used to compute a subset of the Hessian elements,
but they do not take advantage of the sparsity structure of the function.

As you note below, CppAD does have routines for detecting the sparsity 
structure
of Jacobians and Hessians. I have considered combining this sparsity 
structure with
the ideas in the following article:

The efficient computation of sparse Jacobian matrices using automatic 
differentiation
Coleman, T.F.; Verma, A. Source: SIAM Journal on Scientific Computing, v 
19, n 4, July 1998, p 1210-33

Perhaps this should be put on the CppAD wish list ?
    http://www.coin-or.org/CppAD/Doc/wishlist.xml
Perhaps you think some other approach would be better ?

Guangchao Geng wrote:

> Hi,
>  
> I am trying to use CppAD in power system optimization code, which requests
> calculating sparse Jacobian & Hessian matrix. In the "Jacobian" and "Hessian"
> routines of CppAD shown in the online document, the functions return the full
> matrix (including the zero elements) and this makes the whole code quite
> ineffective. Is there an elegant way to get a sparse Jacobian/Hessian matrix using
> CppAD ? (e.g get matrix in the form of iRow[], jCol[], values[], which specify the
> row/column position and values of all non-zero elements in the matrix)
>
> p.s Though the sparse structures of Jacobians & Hessians can be deduced from
> original function, or got from "ForSparseJac" & "RevSparseHes" routines in the
> form of vector<bool>, if they can be figured out by CppAD in the way memtioned
> above , things will be better.
>  
> Thanks in advance,
>  
> Guangchao Geng
>
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>
>
>   



More information about the CppAD mailing list