CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CppAD::old_atomic< Base > Class Template Reference

Class that actually implements the afun(id, ax, ay) calls. More...

Inheritance diagram for CppAD::old_atomic< Base >:
CppAD::atomic_base< Base >

Public Types

typedef bool(* F )(size_t id, size_t k, size_t n, size_t m, const vector< bool > &vx, vector< bool > &vy, const vector< Base > &tx, vector< Base > &ty)
 type for user routine that computes forward mode results More...
 
typedef bool(* FJS )(size_t id, size_t n, size_t m, size_t q, const vector< std::set< size_t > > &r, vector< std::set< size_t > > &s)
 type for user routine that computes forward mode Jacobian sparsity More...
 
enum  option_enum { pack_sparsity_enum, bool_sparsity_enum, set_sparsity_enum }
 
typedef bool(* R )(size_t id, size_t k, size_t n, size_t m, const vector< Base > &tx, const vector< Base > &ty, vector< Base > &px, const vector< Base > &py)
 type for user routine that computes reverse mode results More...
 
typedef bool(* RHS )(size_t id, size_t n, size_t m, size_t q, const vector< std::set< size_t > > &r, const vector< bool > &s, vector< bool > &t, const vector< std::set< size_t > > &u, vector< std::set< size_t > > &v)
 type for user routine that computes reverse mode Hessian sparsity More...
 
typedef bool(* RJS )(size_t id, size_t n, size_t m, size_t q, vector< std::set< size_t > > &r, const vector< std::set< size_t > > &s)
 type for user routine that computes reverse mode Jacobian sparsity More...
 

Public Member Functions

const std::string & afun_name (void) const
 Name corresponding to a base_atomic object. More...
 
void allocate_work (size_t thread)
 allocates work_ for a specified thread More...
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vector< std::set< size_t > > &h, const vector< Base > &x)
 Link, after case split, from for_hes_sweep to atomic_base. More...
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vector< bool > &h, const vector< Base > &x)
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vectorBool &h, const vector< Base > &x)
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vector< std::set< size_t > > &h)
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vector< bool > &h)
 
virtual bool for_sparse_hes (const vector< bool > &vx, const vector< bool > &r, const vector< bool > &s, vectorBool &h)
 
template<class InternalSparsity >
void for_sparse_hes (const vector< Base > &x, const vector< size_t > &x_index, const vector< size_t > &y_index, const InternalSparsity &for_jac_sparsity, const InternalSparsity &rev_jac_sparsity, InternalSparsity &for_hes_sparsity)
 Link, before case split, from for_hes_sweep to atomic_base. More...
 
virtual bool for_sparse_jac (size_t q, const vector< std::set< size_t > > &r, vector< std::set< size_t > > &s, const vector< Base > &x)
 Link from forward Jacobian sparsity sweep to old_atomic. More...
 
virtual bool for_sparse_jac (size_t q, const vector< bool > &r, vector< bool > &s, const vector< Base > &x)
 
virtual bool for_sparse_jac (size_t q, const vectorBool &r, vectorBool &s, const vector< Base > &x)
 
virtual bool for_sparse_jac (size_t q, const vector< std::set< size_t > > &r, vector< std::set< size_t > > &s)
 
virtual bool for_sparse_jac (size_t q, const vector< bool > &r, vector< bool > &s)
 
virtual bool for_sparse_jac (size_t q, const vectorBool &r, vectorBool &s)
 
template<class InternalSparsity >
void for_sparse_jac (const vector< Base > &x, const vector< size_t > &x_index, const vector< size_t > &y_index, InternalSparsity &var_sparsity)
 Link, before case split, from for_jac_sweep to atomic_base. More...
 
virtual bool forward (size_t p, size_t q, const vector< bool > &vx, vector< bool > &vy, const vector< Base > &tx, vector< Base > &ty)
 Link from old_atomic to forward mode. More...
 
void free_work (size_t thread)
 frees work_ for a specified thread More...
 
 old_atomic (const char *afun, F f, R r, FJS fjs, RJS rjs, RHS rhs)
 Constructor called for each invocation of CPPAD_USER_ATOMIC. More...
 
template<class ADVector >
void operator() (const ADVector &ax, ADVector &ay, size_t id=0)
 Implement the user call to afun(ax, ay) and old_atomic call to afun(ax, ay, id). More...
 
template<class ADVector >
void operator() (size_t id, const ADVector &ax, ADVector &ay)
 Implement the user call to afun(id, ax, ay). More...
 
void option (enum option_enum option_value)
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vector< std::set< size_t > > &r, const vector< std::set< size_t > > &u, vector< std::set< size_t > > &v, const vector< Base > &x)
 Link from reverse Hessian sparsity sweep to old_atomic. More...
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vector< bool > &r, const vector< bool > &u, vector< bool > &v, const vector< Base > &x)
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vectorBool &r, const vectorBool &u, vectorBool &v, const vector< Base > &x)
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vector< std::set< size_t > > &r, const vector< std::set< size_t > > &u, vector< std::set< size_t > > &v)
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vector< bool > &r, const vector< bool > &u, vector< bool > &v)
 
virtual bool rev_sparse_hes (const vector< bool > &vx, const vector< bool > &s, vector< bool > &t, size_t q, const vectorBool &r, const vectorBool &u, vectorBool &v)
 
template<class InternalSparsity >
void rev_sparse_hes (const vector< Base > &x, const vector< size_t > &x_index, const vector< size_t > &y_index, const InternalSparsity &for_jac_sparsity, bool *rev_jac_flag, InternalSparsity &rev_hes_sparsity)
 Link, before case split, from rev_hes_sweep to atomic_base. More...
 
virtual bool rev_sparse_jac (size_t q, const vector< std::set< size_t > > &rt, vector< std::set< size_t > > &st, const vector< Base > &x)
 Link from reverse Jacobian sparsity sweep to old_atomic. More...
 
virtual bool rev_sparse_jac (size_t q, const vector< bool > &rt, vector< bool > &st, const vector< Base > &x)
 
virtual bool rev_sparse_jac (size_t q, const vectorBool &rt, vectorBool &st, const vector< Base > &x)
 
virtual bool rev_sparse_jac (size_t q, const vector< std::set< size_t > > &rt, vector< std::set< size_t > > &st)
 
virtual bool rev_sparse_jac (size_t q, const vector< bool > &rt, vector< bool > &st)
 
virtual bool rev_sparse_jac (size_t q, const vectorBool &rt, vectorBool &st)
 
template<class InternalSparsity >
void rev_sparse_jac (const vector< Base > &x, const vector< size_t > &x_index, const vector< size_t > &y_index, InternalSparsity &var_sparsity)
 Link, before case split, from rev_jac_sweep to atomic_base. More...
 
virtual bool reverse (size_t q, const vector< Base > &tx, const vector< Base > &ty, vector< Base > &px, const vector< Base > &py)
 Link from old_atomic to reverse mode. More...
 
virtual void set_old (size_t id)
 Store id for next virtual function callback. More...
 
option_enum sparsity (void) const
 current sparsity setting More...
 

Static Public Member Functions

static const std::string & class_name (size_t index)
 atomic_base function name corresponding to a certain index More...
 
static atomic_baseclass_object (size_t index)
 atomic_base function object corresponding to a certain index More...
 
static void clear (void)
 disable old_atomic<Base>::clear(void) More...
 

Private Attributes

const F f_
 user's implementation of forward mode More...
 
const FJS fjs_
 user's implementation of forward jacobian sparsity calculations More...
 
size_t id_
 id value corresponding to next virtual callback More...
 
const R r_
 user's implementation of reverse mode More...
 
const RHS rhs_
 user's implementation of reverse Hessian sparsity calculations More...
 
const RJS rjs_
 user's implementation of reverse jacobian sparsity calculations More...
 

Detailed Description

template<class Base>
class CppAD::old_atomic< Base >

Class that actually implements the afun(id, ax, ay) calls.

A new old_atomic object is generated each time the user invokes the CPPAD_USER_ATOMIC macro; see static object in that macro.

Definition at line 826 of file old_atomic.hpp.


The documentation for this class was generated from the following file: