[CppAD] Format for sparse Jacobians/Hessians

Robert P. Goddard robert_goddard at apl.washington.edu
Mon Jan 9 12:32:57 EST 2012


Michael et al.,

Your proposed get_sparse_hessian interface seems backward to me. CppAD
can figure out which elements are nonzero; the application code calling
it can't, unless it does CppAD's work for it. Hence the indices defining
the sparse structure of the matrix should be outputs, not inputs (not
const). Am I missing something?

Apparently get_sparse_hessian is to be a member function of class
ADFun<Base>. If not, it needs another argument, the ADFun object to be
evaluated.

Bob Goddard

On 1/8/2012 9:00 AM, cppad-request at list.coin-or.org wrote:
> Send CppAD mailing list submissions to
> 	cppad at list.coin-or.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://list.coin-or.org/mailman/listinfo/cppad
> or, via email, send a message with subject or body 'help' to
> 	cppad-request at list.coin-or.org
> 
> You can reach the person managing the list at
> 	cppad-owner at list.coin-or.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of CppAD digest..."
> 
> 
> Today's Topics:
> 
>    1. Format for sparse Jacobians/Hessians (Michael Braun)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 7 Jan 2012 21:32:49 -0500
> From: Michael Braun <braunm at mit.edu>
> To: "cppad at list.coin-or.org" <cppad at list.coin-or.org>
> Subject: [CppAD] Format for sparse Jacobians/Hessians
> Message-ID: <AD40A191-DCD9-4AA1-9CD7-4E7C901093F0 at mit.edu>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hello, all:
> 
> Brad and I were discussing offline the potential need for routines that return Hessians and/or Jacobians in some kind of sparse matrix format.  One of the outstanding questions is what format these sparse matrices should be in.  So Brad asked me to pose the question to the mailing list, and I am doing that now.
> 
> My thought is that one or more of CSC, CSR or triplet format should cover the vast majority of cases, and if not, there are probably conversion routines available.  Using CSC as an example, I was thinking something along the lines of:
> 
> void get_sparse_hessian(const Vector<double>& x, const Vector<int>& ipntr, const Vector<int>&jcol, Vector<double>& vals);
> 
> where x is point at which the Hessian is computed, ipntr and jcol are the row indices and column pointers for the CSC format, and vals is the output of the corresponding nonzero elements of the Hessian.  x, ipntr and jcol are inputs, and vals is output.
> 
> For hessians, only the elements in the lower triangle would be considered.  Not so for Jacobians.
>   
> For triplet format, replace ipntr and jcol with row_index and col_index.
> 
> Let the discussion begin!
> 
> Michael
> 
> 
> 
> 
> 
> 
> -------------------------------------------
> Michael Braun
> Associate Professor of Management Science (Marketing Group)
> MIT Sloan School of Management
> 100 Main St.., E62-535
> Cambridge, MA 02139
> braunm at mit.edu
> 617-253-3436
> 
> 
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://list.coin-or.org/pipermail/cppad/attachments/20120107/5fd43b9d/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 1844 bytes
> Desc: not available
> URL: <http://list.coin-or.org/pipermail/cppad/attachments/20120107/5fd43b9d/attachment-0001.p7s>
> 
> ------------------------------
> 
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
> 
> 
> End of CppAD Digest, Vol 52, Issue 4
> ************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: robert_goddard.vcf
Type: text/x-vcard
Size: 385 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/cppad/attachments/20120109/1cdf48e9/attachment.vcf>


More information about the CppAD mailing list