[CppAD] Computung the sparsity pattern

Brad Bell bradbell at seanet.com
Tue Oct 7 14:26:27 EDT 2014


Perhaps the documentation under the heading Entire Sparsity Pattern one
http://www.coin-or.org/CppAD/Doc/revsparsehes.xml#Entire%20Sparsity%20Pattern
will help; i.e.,  you can use the argument s to
     h = f.RevSparseHes(q, s)
to select a particular component f_k (x).


On 10/7/2014 4:57 AM, Philipp Bender wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQIcBAEBAgAGBQJUM9UYAAoJEMSOzTAqQDLoPfQQAJznCpCXFaWoM1ScBW3fRpjn
> N1MJcVZyEKS2YG/UO6iyTDE9XEPnqcrefFL7VJwbahp8tPf+0FmHHV0qv3dG17Bj
> GD4pmA49K1FuXe2bSbqolMkebvT/6XkPvlS6CZ6wto0zpkmkoUCfFgCrwbzXEyo5
> jYwTv5HPYi2Ktyv4NYMKG8zca9gMKYL5WvS/tesDfEsMXa0efr5peJeegNdAYcgu
> ifsfQ3sYWhICOcVXC1nytafslxsXcFANIArpcPSqvbXTiOB7cWjBv4brgLFR6KCw
> Y+1sA2KhBHu+tPrhI0RcWJDzPySZdH5tS09zvTpDx8y5BBLhNeZlkocdU+WUaqPn
> v9OfTwHUCRPN5LtmL/zPn2tavb73A7wXwrHIISPS67fo3DpN1G0OjMZQJWvyjjJA
> gs2H9x/niZn9jy0tmoP8OpyoS61M6B5I9cXY2lE8MZRKUkw2XL3YZID+R7j35lfX
> yoLKUpmmpKjHJbBBd17Nx5VgKe1NF4Dt3v5if+7OESxsv9nObun7hqrY+iuW8Sm3
> qvi/OPiOgtE1PmA1ql5Oh1MvtavpiL+X+fXgJ0IOD2cg1sbtSmoBkl0M6Fb+Ui4p
> GvQQn4AJ8AflrhoIe20owID/XHgDE7vr78a5SsV27a+woMGOra1B8BkiAhkNB/OB
> iwhbFHj7bUioxAz9qsyf
> =IQ/n
> -----END PGP SIGNATURE-----
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>



More information about the CppAD mailing list