# Changeset 1535

Ignore:
Timestamp:
Sep 29, 2009 10:14:41 AM (11 years ago)
Message:

trunk: Add doxygen documentation for sparsity calculations.

check_doxygen.sh: check classes that have been documented, check sparsity doc.
whats_new_09.omh: change that matters to user.
player.hpp: fix doxygen warning in player class documention.
vector_pack.hpp: fix doxygen warning in vector_pack class documention.
for_sparse_jac.hpp: add doxygen documentation for this sparsity routine.
rev_sparse_jac.hpp: add doxygen documentation for this sparsity routine.
optimize.hpp: fix doxygen confusion by moving CPPAD_END_NAMESPACE.
rev_sparse_hes.hpp: add doxygen documentation, fix user doc error.
vector_set.hpp: fix doxygen warning in vector_set class documention.

Location:
trunk
Files:
10 edited

Unmodified
Removed
• ## trunk/check_doxygen.sh

 r1529 # ----------------------------------------------------------------------------- # list=" # classes that have been completely documented class_list=" player recorder vector_pack vector_set " # files that have been completely documented file_list=" abs_op.hpp add_op.hpp forward_sweep.hpp for_jac_sweep.hpp for_sparse_jac.hpp hash_code.hpp load_op.hpp rev_hes_sweep.hpp rev_jac_sweep.hpp rev_sparse_hes.hpp rev_sparse_jac.hpp sin_op.hpp sinh_op.hpp vector_set.hpp " for name in \$list # -------------------------------------------------------------------------- for class in \$class_list do if [ ! -e "cppad/local/\$name" ] && [ ! -e "cppad/\$name" ] if grep -i "warning:.*\$class::" doxygen.log then echo "check_doxygen.sh: cannot find file \$name" exit 1 fi if grep -i "\$name.*warning" doxygen.log then echo "Unexpected doxygen error or warning for \$name." echo "Unexpected doxygen error or warning for \$file." exit 1 fi done # -------------------------------------------------------------------------- for file in \$file_list do if [ ! -e "cppad/local/\$file" ] && [ ! -e "cppad/\$file" ] then echo "check_doxygen.sh: cannot find file \$file" exit 1 fi if grep -i "\$file.*warning" doxygen.log then echo "Unexpected doxygen error or warning for \$file." exit 1 fi done

 r1534 ----------------------------------------------------------------------------- */ // BEGIN CppAD namespace namespace CppAD { CPPAD_BEGIN_NAMESPACE /*! \file for_sparse_jac.hpp Forward mode Jacobian sparsity patterns. */ /*! Calculate Jacobian sparsity patterns using forward mode. The C++ source code corresponding to this operation is \verbatim s = f.ForSparseJac(q, r, packed) \endverbatim \tparam Base is the base type for this recording. \tparam VectorBool is a simple vector with elements of type bool. \tparam VectorSet is either \c vector_pack or \c vector_set. \param q is the number of columns in the matrix \f\$ R \f\$. \param r is a sparsity pattern for the matrix \f\$ R \f\$. \param s the input value of \a s must be a vector with size \c m*q where \c m is the number of dependent variables corresponding to the operation sequence stored in \a play. The input value of its elements does not matter. On output, the \a s is the sparsity pattern for the matrix \f[ J(x) = F^{(1)} (x) * R \f] where \f\$ F \f\$ is the function corresponding to the operation sequence and \a x is any argument value. \param total_num_var is the total number of variable in this recording. \param dep_taddr maps dependendent variable index to the corresponding variable in the tape. \param ind_taddr maps independent variable index to the corresponding variable in the tape. \param play is the recording that defines the function we are computing the sparsity pattern for. \param for_jac_sparsity the input value of \a for_jac_sparsity does not matter. On output, \a for_jac_sparsity.n_set() == \a total_num_var and \a for_jac_sparsity.limit() == \a q. It contains the forward sparsity pattern for all of the variables on the tape (given the sparsity pattern for the independent variables is \f\$ R \f\$). */ template void ForSparseJac( } /*! User API for Jacobian sparsity patterns using forward mode. The C++ source code corresponding to this operation is \verbatim s = f.ForSparseJac(q, r, packed) \endverbatim \tparam Base is the base type for this recording. \tparam VectorBool is a simple vector with elements of type bool. \param q is the number of columns in the matrix \f\$ R \f\$. \param r is a sparsity pattern for the matrix \f\$ R \f\$. \param packed If \a packed is true, the type \c vector_pack is used for the calculations. Otherwise the type \c vector_set is used for the calculations. \return the return value \c s is a vector with size \c m*q where \c m is the number of dependent variables corresponding to the operation sequence stored in \c f. The value of \a s is the sparsity pattern for the matrix \f[ J(x) = F^{(1)} (x) * R \f] where \f\$ F \f\$ is the function corresponding to the operation sequence and \a x is any argument value. \par Side Effects If \a packed is true, the forward sparsity pattern for all of the variables on the tape is stored in \c for_jac_sparse_pack__. In this case \verbatim for_jac_sparse_pack_.n_set() == total_num_var_ for_jac_sparse_pack_.limit() == q for_jac_sparse_set_.n_set()  == 0 for_jac_sparse_set_.limit()  == 0 \endverbatim \n \n If \a packed is false, the forward sparsity pattern for all of the variables on the tape is stored in \c for_jac_sparse_set__. In this case \verbatim for_jac_sparse_set_.n_set()   == total_num_var_ for_jac_sparse_set_.limit()   == q for_jac_sparse_pack_.n_set()  == 0 for_jac_sparse_pack_.limit()  == 0 \endverbatim */ template template VectorBool ADFun::ForSparseJac( size_t             q      , const VectorBool&  r      , bool               packed ) size_t             q             , const VectorBool&  r             , bool               packed        ) {       size_t m = dep_taddr_.size(); VectorBool s( m * q ); } } // END CppAD namespace CPPAD_END_NAMESPACE # endif

 r1534 } } CPPAD_END_NAMESPACE /*! */ template void CppAD::ADFun::optimize(void) void ADFun::optimize(void) {       // place to store the optimized version of the recording recorder rec; } CPPAD_END_NAMESPACE # endif

 r1497 } /// Creating an operation sequence player from a recorder. /*!  Creating an object that palys back an operation sequence. \param rec the object that was used to record the operation sequence. */ void operator=(const recorder &rec) {       size_t i;

 r1534 with respect to \$latex u\$\$ at \$latex u = 0\$\$ and with respect to x \$latex \[ H(x)  =  R^T * (S * F)^{(2)} ( x ) H(x)  =  R^T * (S * F)^{(2)} ( x ) * R \] \$\$ where \$latex (S * F)^{(2)} (x)\$\$ is the Hessian of the scalar size_t %q% %\$\$ It specifies the number of columns in the Jacobian \$latex J(x)\$\$. It specifies the number of rows and columns in the Hessian \$latex H(x)\$\$. It must be the same value as in the previous \$xref/ForSparseJac/\$\$ call \$syntax% # include // BEGIN CppAD namespace namespace CppAD { CPPAD_BEGIN_NAMESPACE /*! \file rev_sparse_hes.hpp Reverse mode Hessian sparsity patterns. */ /*! Calculate Hessian sparsity patterns using reverse mode. The C++ source code corresponding to this operation is \verbatim h = f.RevSparseHes(q, s) \endverbatim \tparam Base is the base type for this recording. \tparam VectorBool is a simple vector with elements of type bool. \tparam VectorSet is either \c vector_pack or \c vector_set. \param q is the value of \a q in the by the previous call of the form \verbatim f.ForSparseJac(q, r, packed) \endverbatim The value \c r in this call is a sparsity pattern for the matrix \f\$ R \f\$. \param s is a vector with size \c m that specifies the sparsity pattern for the vector \f\$ S \f\$, where \c m is the number of dependent variables corresponding to the operation sequence stored in \a play. \param h the input value of \a h must be a vector with size \c q*q. The input value of its elements does not matter. On output, \a h is the sparsity pattern for the matrix \f[ H(x) = R^T ( S * F)^{(2)} (x) * R \f] where \f\$ F \f\$ is the function corresponding to the operation sequence and \a x is any argument value. \param total_num_var is the total number of variables in this recording. \param dep_taddr maps dependendent variable index to the corresponding variable in the tape. \param ind_taddr maps independent variable index to the corresponding variable in the tape. \param play is the recording that defines the function we are computing the sparsity pattern for. \param for_jac_sparsity is a  vector of sets containing the the forward sparsity pattern for all of the variables on the tape. */ template return; } /*! User API for Hessian sparsity patterns using reverse mode. The C++ source code corresponding to this operation is \verbatim h = f.RevSparseHes(q, r, packed) \endverbatim \tparam Base is the base type for this recording. \tparam VectorBool is a simple vector with elements of type bool. \param q is the value of \a q in the by the previous call of the form \verbatim f.ForSparseJac(q, r, packed) \endverbatim The value \c r in this call is a sparsity pattern for the matrix \f\$ R \f\$. \param s is a vector with size \c m that specifies the sparsity pattern for the vector \f\$ S \f\$, where \c m is the number of dependent variables corresponding to the operation sequence stored in \a play. \return is a vector with size \c q*q. containing a sparsity pattern for the matrix \f[ H(x) = R^T ( S * F)^{(2)} (x) * R \f] where \f\$ F \f\$ is the function corresponding to the operation sequence and \a x is any argument value. */ template } } // END CppAD namespace CPPAD_END_NAMESPACE # endif