lines 8-106 of file: include/cppad/core/atomic/two/for_sparse_jac.hpp

{xrst_begin atomic_two_for_sparse_jac app}

Atomic Forward Jacobian Sparsity Patterns
#########################################

Syntax
******

   *ok* = *afun* . ``for_sparse_jac`` ( *q* , *r* , *s* , *x* )

Deprecated 2016-06-27
*********************

   *ok* = *afun* . ``for_sparse_jac`` ( *q* , *r* , *s* )

Purpose
*******
This function is used by :ref:`ForSparseJac-name` to compute
Jacobian sparsity patterns.
For a fixed matrix :math:`R \in \B{R}^{n \times q}`,
the Jacobian of :math:`f( x + R * u)` with respect to :math:`u \in \B{R}^q` is

.. math::

   S(x) = f^{(1)} (x) * R

Given a :ref:`glossary@Sparsity Pattern` for :math:`R`,
``for_sparse_jac`` computes a sparsity pattern for :math:`S(x)`.

Implementation
**************
If you are using
:ref:`ForSparseJac-name` ,
:ref:`ForSparseHes-name` , or
:ref:`RevSparseHes-name` ,
one of the versions of this
virtual function must be defined by the
:ref:`atomic_two_ctor@atomic_user` class.

q
=
The argument *q* has prototype

   ``size_t`` *q*

It specifies the number of columns in
:math:`R \in \B{R}^{n \times q}` and the Jacobian
:math:`S(x) \in \B{R}^{m \times q}`.

r
=
This argument has prototype

   ``const`` *atomic_sparsity* & *r*

and is a :ref:`atomic_two_option@atomic_sparsity` pattern for
:math:`R \in \B{R}^{n \times q}`.

s
=
This argument has prototype

   *atomic_sparsity* & *s*

The input values of its elements
are not specified (must not matter).
Upon return, *s* is a
:ref:`atomic_two_option@atomic_sparsity` pattern for
:math:`S(x) \in \B{R}^{m \times q}`.

x
=
The argument has prototype

   ``const CppAD::vector<`` *Base* >& *x*

and size is equal to the *n* .
This is the :ref:`Value-name` value corresponding to the parameters in the
vector :ref:`atomic_two_afun@ax` (when the atomic function was called).
To be specific, if

| |tab| ``if`` ( ``Parameter`` ( *ax* [ *i* ]) == ``true`` )
| |tab| |tab| *x* [ *i* ] = ``Value`` ( *ax* [ *i* ] );
| |tab| ``else``
| |tab| |tab| *x* [ *i* ] = ``CppAD::numeric_limits<`` *Base* >:: ``quiet_NaN`` ();

The version of this function with out the *x* argument is deprecated;
i.e., you should include the argument even if you do not use it.

ok
**
The return value *ok* has prototype

   ``bool`` *ok*

If it is ``true`` , the corresponding evaluation succeeded,
otherwise it failed.

{xrst_end atomic_two_for_sparse_jac}
