[CppAD] Computung the sparsity pattern

joao joaoruileal at gmail.com
Tue Oct 7 08:10:59 EDT 2014


Dear Philipp,

Have a look at:

https://github.com/joaoleal/CppADCodeGen/blob/master/include/cppad/extra/sparsity.hpp

It has some simple  functions for the evaluation of sparsities using CppAD, 
which you might want to reuse.

Best regards,
João Leal

A Terça, 7 de Outubro de 2014 13:57:12 Philipp Bender escreveu:
> Dear list,
> 
> I have a problem understanding the sparsity methods CppAD provides and
> following the example leaves me with some questions -- I hope someone
> here can help me out.
> 
> I think rev_sparse_hess.cpp is what I need to learn, along with
> Doc/forsparsejac.xml.
> 
> I have a function, for example R^6 --> R^2, and want to know where
> first and second derivatives are known to be zero, no matter what the
> input is like.
> 
> I have the tape called "f".
> 
> Now I begin to miss things. In my understanding, the sparsity pattern
> for my R^6 -> R^2 problem should be of the shape (2x6) in the
> Jacobian, and I should be able to directly obtain this from the tape.
> So I wonder why in the example and the documentation there is this "r"
> vector (shape nxn), and where it comes from?
> 
> Now for the Hessian. In the example h(nxn) should hold the result.
> With vector s, the "output" is selected (in which of both output
> variables of my range space am I interested in). Now I get an error if
> I just leave the ForSparceJac part out. So obtaining the sparsity for
> the Jacobian seems to have side effects needed by the Jacobian.
> 
> Are this practical issues I just have to live with or are there
> serious AutoDiff issues I am missing here?
> 
> Is there some documentation for me to read about where this "R" comes
> from which I need for the Jacobian? I think the identity matrix is
> just an example, but I don't get the relation here.
> 
> Best regards,
> Philipp
> 
> 
> 
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad




More information about the CppAD mailing list