Prev Next Index-> contents reference index search external Up-> CppAD AD ADValued atomic atomic_base atomic_rev_sparse_jac ADValued-> Arithmetic unary_standard_math binary_math CondExp Discrete numeric_limits atomic atomic-> checkpoint atomic_base atomic_base-> atomic_ctor atomic_option atomic_afun atomic_forward atomic_reverse atomic_for_sparse_jac atomic_rev_sparse_jac atomic_for_sparse_hes atomic_rev_sparse_hes atomic_base_clear atomic_get_started.cpp atomic_norm_sq.cpp atomic_reciprocal.cpp atomic_set_sparsity.cpp atomic_tangent.cpp atomic_eigen_mat_mul.cpp atomic_eigen_mat_inv.cpp atomic_eigen_cholesky.cpp atomic_mat_mul.cpp atomic_rev_sparse_jac-> atomic_rev_sparse_jac.cpp Headings-> Syntax Deprecated 2016-06-27 Purpose Implementation ---..q ---..rt ---..st ---..x ok Examples

$\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }$
Atomic Reverse Jacobian Sparsity Patterns

Syntax
ok = afun.rev_sparse_jac(q, rt, st, x) 
Deprecated 2016-06-27
ok = afun.rev_sparse_jac(q, rt, st) 
Purpose
This function is used by RevSparseJac to compute Jacobian sparsity patterns. If you are using RevSparseJac , one of the versions of this virtual function must be defined by the atomic_user class.  For a fixed matrix $R \in B^{q \times m}$, the Jacobian of $R * f( x )$ with respect to $x \in B^n$ is $$S(x) = R * f^{(1)} (x)$$ Given a sparsity pattern for $R$, rev_sparse_jac computes a sparsity pattern for $S(x)$.

Implementation
If you are using RevSparseJac or ForSparseHes , this virtual function must be defined by the atomic_user class.

q
The argument q has prototype       size_t q  It specifies the number of rows in $R \in B^{q \times m}$ and the Jacobian $S(x) \in B^{q \times n}$.

rt
This argument has prototype       const atomic_sparsity& rt  and is a atomic_sparsity pattern for $R^\R{T} \in B^{m \times q}$.

st
This argument has prototype       atomic_sparsity& st  The input value of its elements are not specified (must not matter). Upon return, s is a atomic_sparsity pattern for $S(x)^\R{T} \in B^{n \times q}$.

x
The argument has prototype       const CppAD::vector<Base>& x  and size is equal to the n . This is the Value corresponding to the parameters in the vector ax (when the atomic function was called). To be specific, if       if( Parameter(ax[i]) == true )           x[i] = Value( ax[i] );      else           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.

Examples
The file atomic_rev_sparse_jac.cpp contains an example and test that uses this routine. It returns true if the test passes and false if it fails.