contents

Table of Contents

1 cppad-20240512: CppAD User’s Manual
1.1 CppAD Download, Test, and Install Instructions
1.1.1 Download The CppAD Source Code
1.1.2 Using CMake to Configure CppAD
1.1.2.1 Download and Install The CppAD Optional Packages
1.1.2.1.1 Download and Install Adolc in Build Directory
1.1.2.1.2 Download and Install CppADCodeGen in Build Directory
1.1.2.1.3 Download and Install ColPack in Build Directory
1.1.2.1.4 Download and Install Eigen in Build Directory
1.1.2.1.5 Download and Install Fadbad in Build Directory
1.1.2.1.6 Download and Install Ipopt in Build Directory
1.1.2.1.7 Download and Install Sacado in Build Directory
1.1.2.2 Including Adolc Examples and Tests
1.1.2.3 Including Eigen Examples, Tests, and sparse2eigen
1.1.2.4 Including CppADCodeGen Examples and Tests
1.1.2.5 Including Ipopt Library Examples, Tests, and pkg-config
1.1.2.6 Including Fadbad Speed Tests
1.1.2.7 Including Sacado Speed Tests
1.1.2.8 Enabling Colpack Sparsity Calculations
1.1.2.8.1 ColPack: Sparse Jacobian Example and Test
1.1.2.8.2 ColPack: Sparse Jacobian Example and Test
1.1.2.8.3 ColPack: Sparse Hessian Example and Test
1.1.2.8.4 ColPack: Sparse Hessian Example and Test
1.1.2.9 Choosing the CppAD Test Vector Template Class
1.1.3 Checking the CppAD Examples and Tests
1.1.4 CppAD pkg-config Files
1.2 The Theory of Derivative Calculations
1.2.1 An Introduction by Example to Algorithmic Differentiation
1.2.1.1 Second Order Exponential Approximation
1.2.1.1.1 exp_2: Implementation
1.2.1.1.2 exp_2: Test
1.2.1.1.3 exp_2: Operation Sequence and Zero Order Forward Mode
1.2.1.1.3.1 exp_2: Verify Zero Order Forward Sweep
1.2.1.1.4 exp_2: First Order Forward Mode
1.2.1.1.4.1 exp_2: Verify First Order Forward Sweep
1.2.1.1.5 exp_2: First Order Reverse Mode
1.2.1.1.5.1 exp_2: Verify First Order Reverse Sweep
1.2.1.1.6 exp_2: Second Order Forward Mode
1.2.1.1.6.1 exp_2: Verify Second Order Forward Sweep
1.2.1.1.7 exp_2: Second Order Reverse Mode
1.2.1.1.7.1 exp_2: Verify Second Order Reverse Sweep
1.2.1.1.8 exp_2: CppAD Forward and Reverse Sweeps
1.2.1.2 An Epsilon Accurate Exponential Approximation
1.2.1.2.1 exp_eps: Implementation
1.2.1.2.2 exp_eps: Test of exp_eps
1.2.1.2.3 exp_eps: Operation Sequence and Zero Order Forward Sweep
1.2.1.2.3.1 exp_eps: Verify Zero Order Forward Sweep
1.2.1.2.4 exp_eps: First Order Forward Sweep
1.2.1.2.4.1 exp_eps: Verify First Order Forward Sweep
1.2.1.2.5 exp_eps: First Order Reverse Sweep
1.2.1.2.5.1 exp_eps: Verify First Order Reverse Sweep
1.2.1.2.6 exp_eps: Second Order Forward Mode
1.2.1.2.6.1 exp_eps: Verify Second Order Forward Sweep
1.2.1.2.7 exp_eps: Second Order Reverse Sweep
1.2.1.2.7.1 exp_eps: Verify Second Order Reverse Sweep
1.2.1.2.8 exp_eps: CppAD Forward and Reverse Sweeps
1.2.1.3 Correctness Tests For Exponential Approximation in Introduction
1.2.2 The Theory of Forward Mode
1.2.2.1 Exponential Function Forward Mode Theory
1.2.2.2 Logarithm Function Forward Mode Theory
1.2.2.3 Square Root Function Forward Mode Theory
1.2.2.4 Trigonometric and Hyperbolic Sine and Cosine Forward Theory
1.2.2.5 Inverse Tangent and Hyperbolic Tangent Forward Mode Theory
1.2.2.6 Inverse Sine and Hyperbolic Sine Forward Mode Theory
1.2.2.7 Inverse Cosine and Hyperbolic Cosine Forward Mode Theory
1.2.2.8 Power Function Forward Mode Theory
1.2.2.9 Tangent and Hyperbolic Tangent Forward Taylor Polynomial Theory
1.2.2.10 Error Function Forward Taylor Polynomial Theory
1.2.3 The Theory of Reverse Mode
1.2.3.1 Exponential Function Reverse Mode Theory
1.2.3.2 Logarithm Function Reverse Mode Theory
1.2.3.3 Square Root Function Reverse Mode Theory
1.2.3.4 Trigonometric and Hyperbolic Sine and Cosine Reverse Theory
1.2.3.5 Inverse Tangent and Hyperbolic Tangent Reverse Mode Theory
1.2.3.6 Inverse Sine and Hyperbolic Sine Reverse Mode Theory
1.2.3.7 Inverse Cosine and Hyperbolic Cosine Reverse Mode Theory
1.2.3.8 Tangent and Hyperbolic Tangent Reverse Mode Theory
1.2.3.9 Error Function Reverse Mode Theory
1.2.3.10 Power Function Reverse Mode Theory
1.2.4 An Important Reverse Mode Identity
1.2.5 AD Theory for Solving ODE’s Using Taylor’s Method
1.2.5.1 Taylor’s Ode Solver: An Example and Test
1.2.6 Research and Software Engineering Projects Related to CppAD
1.3 AD Objects
1.3.1 AD Constructors
1.3.1.1 AD Constructors: Example and Test
1.3.2 AD Assignment Operator
1.3.2.1 AD Assignment: Example and Test
1.3.3 Conversion and I/O of AD Objects
1.3.3.1 Convert From an AD Type to its Base Type
1.3.3.1.1 Convert From AD to its Base Type: Example and Test
1.3.3.2 Convert From AD to Integer
1.3.3.2.1 Convert From AD to Integer: Example and Test
1.3.3.3 Convert An AD or Base Type to String
1.3.3.4 AD Input Stream Operator
1.3.3.4.1 AD Output Operator: Example and Test
1.3.3.5 AD Output Stream Operator
1.3.3.5.1 AD Output Operator: Example and Test
1.3.3.6 Printing AD Values During Forward Mode
1.3.3.6.1 Printing During Forward Mode: Example and Test
1.3.3.6.2 Print During Zero Order Forward Mode: Example and Test
1.3.3.7 Convert an AD Variable or Dynamic Parameter to a Constant
1.3.3.7.1 Convert a Variable or Dynamic Parameter a Constant: Example and Test
1.3.4 AD Valued Operations and Functions
1.3.4.1 AD Arithmetic Operators and Compound Assignments
1.3.4.1.1 AD Unary Plus Operator
1.3.4.1.1.1 AD Unary Plus Operator: Example and Test
1.3.4.1.2 AD Unary Minus Operator
1.3.4.1.2.1 AD Unary Minus Operator: Example and Test
1.3.4.1.3 AD Binary Arithmetic Operators
1.3.4.1.3.1 AD Binary Addition: Example and Test
1.3.4.1.3.2 AD Binary Subtraction: Example and Test
1.3.4.1.3.3 AD Binary Multiplication: Example and Test
1.3.4.1.3.4 AD Binary Division: Example and Test
1.3.4.1.4 AD Compound Assignment Operators
1.3.4.1.4.1 AD Compound Assignment Addition: Example and Test
1.3.4.1.4.2 AD Compound Assignment Subtraction: Example and Test
1.3.4.1.4.3 AD Compound Assignment Multiplication: Example and Test
1.3.4.1.4.4 AD Compound Assignment Division: Example and Test
1.3.4.2 The Unary Standard Math Functions
1.3.4.2.1 Inverse Cosine Function: acos
1.3.4.2.1.1 The AD acos Function: Example and Test
1.3.4.2.2 The Inverse Hyperbolic Cosine Function: acosh
1.3.4.2.2.1 The AD acosh Function: Example and Test
1.3.4.2.3 Inverse Sine Function: asin
1.3.4.2.3.1 The AD asin Function: Example and Test
1.3.4.2.4 The Inverse Hyperbolic Sine Function: asinh
1.3.4.2.4.1 The AD asinh Function: Example and Test
1.3.4.2.5 Inverse Tangent Function: atan
1.3.4.2.5.1 The AD atan Function: Example and Test
1.3.4.2.6 The Inverse Hyperbolic Tangent Function: atanh
1.3.4.2.6.1 The AD atanh Function: Example and Test
1.3.4.2.7 The Cosine Function: cos
1.3.4.2.7.1 The AD cos Function: Example and Test
1.3.4.2.8 The Hyperbolic Cosine Function: cosh
1.3.4.2.8.1 The AD cosh Function: Example and Test
1.3.4.2.9 The Error Function
1.3.4.2.9.1 The AD erf Function: Example and Test
1.3.4.2.10 The Complementary Error Function: erfc
1.3.4.2.10.1 The AD erfc Function: Example and Test
1.3.4.2.11 The Exponential Function: exp
1.3.4.2.11.1 The AD exp Function: Example and Test
1.3.4.2.12 The Exponential Function Minus One: expm1
1.3.4.2.12.1 The AD exp Function: Example and Test
1.3.4.2.13 The Exponential Function: log
1.3.4.2.13.1 The AD log Function: Example and Test
1.3.4.2.14 The Logarithm of One Plus Argument: log1p
1.3.4.2.14.1 The AD log1p Function: Example and Test
1.3.4.2.15 The Base 10 Logarithm Function: log10
1.3.4.2.15.1 The AD log10 Function: Example and Test
1.3.4.2.16 The Sine Function: sin
1.3.4.2.16.1 The AD sin Function: Example and Test
1.3.4.2.17 The Hyperbolic Sine Function: sinh
1.3.4.2.17.1 The AD sinh Function: Example and Test
1.3.4.2.18 The Square Root Function: sqrt
1.3.4.2.18.1 The AD sqrt Function: Example and Test
1.3.4.2.19 The Tangent Function: tan
1.3.4.2.19.1 The AD tan Function: Example and Test
1.3.4.2.20 The Hyperbolic Tangent Function: tanh
1.3.4.2.20.1 The AD tanh Function: Example and Test
1.3.4.2.21 AD Absolute Value Functions: abs, fabs
1.3.4.2.21.1 AD Absolute Value Function: Example and Test
1.3.4.2.22 The Sign: sign
1.3.4.2.22.1 Sign Function: Example and Test
1.3.4.3 The Binary Math Functions
1.3.4.3.1 AD Two Argument Inverse Tangent Function
1.3.4.3.1.1 The AD atan2 Function: Example and Test
1.3.4.3.2 The AD Power Function
1.3.4.3.2.1 The AD Power Function: Example and Test
1.3.4.3.2.2 pow: Nan in Result of Pow Function: Example and Test
1.3.4.3.3 Absolute Zero Multiplication
1.3.4.3.3.1 AD Absolute Zero Multiplication: Example and Test
1.3.4.4 AD Conditional Expressions
1.3.4.4.1 Conditional Expressions: Example and Test
1.3.4.5 Discrete AD Functions
1.3.4.5.1 Taping Array Index Operation: Example and Test
1.3.4.5.2 Interpolation With Out Retaping: Example and Test
1.3.4.5.3 Interpolation With Retaping: Example and Test
1.3.4.6 Numeric Limits For an AD and Base Types
1.3.4.6.1 Numeric Limits: Example and Test
1.3.4.7 Atomic AD Functions
1.3.4.7.1 Atomic AD Functions: Fourth Generation
1.3.4.7.1.1 Defining Atomic Functions: Fourth Generation
1.3.4.7.1.1.1 Atomic Function Constructor
1.3.4.7.1.1.2 Calling an Atomic Function
1.3.4.7.1.1.3 Atomic Function Forward Type Calculation
1.3.4.7.1.1.4 Atomic Function Forward Mode
1.3.4.7.1.1.5 Atomic Function Reverse Mode
1.3.4.7.1.1.6 Atomic Function Jacobian Sparsity Patterns
1.3.4.7.1.1.7 Atomic Function Hessian Sparsity Patterns
1.3.4.7.1.1.8 Atomic Function Reverse Dependency
1.3.4.7.1.2 Examples Defining Atomic Functions: Fourth Generation
1.3.4.7.1.2.1 Getting Started with Atomic Functions: Example and Test
1.3.4.7.1.2.2 Atomic Euclidean Norm Squared: Example and Test
1.3.4.7.1.2.3 Bilinear Interpolation Atomic Function: Example and Test
1.3.4.7.1.2.4 Atomic Functions and Forward Mode: Example and Test
1.3.4.7.1.2.5 Atomic Functions with Dynamic Parameters: Example and Test
1.3.4.7.1.2.6 Atomic Vector Element-wise Operators: Example and Test
1.3.4.7.1.2.6.1 Atomic Vector Addition Example
1.3.4.7.1.2.6.2 Atomic Vector Division Example
1.3.4.7.1.2.6.3 Atomic Vector Sparsity Patterns Example
1.3.4.7.1.2.6.4 Atomic Vector Sparsity Patterns Example
1.3.4.7.1.2.6.5 Atomic Vector Multiplication Example
1.3.4.7.1.2.6.6 Atomic Vector Negation Example
1.3.4.7.1.2.6.7 Example Optimizing Atomic Vector Usage
1.3.4.7.1.2.6.8 Atomic Vector Subtraction Example
1.3.4.7.1.2.6.9 Implementing Atomic Vector Operations
1.3.4.7.1.2.6.9.1 Atomic Vector Class: Example Implementation
1.3.4.7.1.2.6.9.2 Atomic Vector Forward Mode: Example Implementation
1.3.4.7.1.2.6.9.3 Atomic Vector Forward Mode: Example Implementation
1.3.4.7.1.2.6.9.4 Atomic Vector Jacobian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.6.9.5 Atomic Vector Hessian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.6.9.6 Atomic Vector Forward Type Calculation: Example Implementation
1.3.4.7.1.2.6.9.7 Atomic Vector Forward Type Calculation: Example Implementation
1.3.4.7.1.2.6.9.8 Atomic Vector Add Operator: Example Implementation
1.3.4.7.1.2.6.9.9 Atomic Vector Subtract Operator: Example Implementation
1.3.4.7.1.2.6.9.10 Atomic Vector Multiply Operator: Example Implementation
1.3.4.7.1.2.6.9.11 Atomic Vector Divide Operator: Example Implementation
1.3.4.7.1.2.6.9.12 Atomic Vector Negative Operator: Example Implementation
1.3.4.7.1.2.7 Atomic Matrix Multiply Class: Example Implementation
1.3.4.7.1.2.7.1 Implementing Atomic Matrix Multiply
1.3.4.7.1.2.7.1.1 Atomic Matrix Multiply Class: Example Implementation
1.3.4.7.1.2.7.1.2 atomic_mat_mul Set Routine: Example Implementation
1.3.4.7.1.2.7.1.3 atomic_mat_mul Get Routine: Example Implementation
1.3.4.7.1.2.7.1.4 Atomic Multiply Base Matrices: Example Implementation
1.3.4.7.1.2.7.1.5 Atomic Matrix Multiply Forward Type Calculation: Example Implementation
1.3.4.7.1.2.7.1.6 Atomic Matrix Multiply Forward Mode: Example Implementation
1.3.4.7.1.2.7.1.7 Atomic Matrix Multiply Reverse Mode: Example Implementation
1.3.4.7.1.2.7.1.8 Atomic Matrix Multiply Jacobian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.7.1.9 Atomic Matrix Multiply Jacobian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.7.1.10 Atomic Matrix Multiply Reverse Dependency Analysis: Example Implementation
1.3.4.7.1.2.7.2 Atomic Matrix Multiply Forward Mode: Example and Test
1.3.4.7.1.2.7.3 Atomic Matrix Multiply Reverse Mode: Example and Test
1.3.4.7.1.2.7.4 Atomic Matrix Multiply Sparsity Patterns: Example and Test
1.3.4.7.1.2.7.5 Atomic Matrix Multiply Reverse Dependency: Example and Test
1.3.4.7.1.2.7.6 Atomic Matrix Multiply Identical Zero: Example and Test
1.3.4.7.1.2.8 Atomic First Order Linear ODE Method: Example Implementation
1.3.4.7.1.2.8.1 Implementing Atomic Linear ODE
1.3.4.7.1.2.8.1.1 Atomic Linear ODE Class: Example Implementation
1.3.4.7.1.2.8.1.2 atomic_lin_ode Set Routine: Example Implementation
1.3.4.7.1.2.8.1.3 atomic_lin_ode Get Routine: Example Implementation
1.3.4.7.1.2.8.1.4 Atomic Linear ODE: Example Implementation
1.3.4.7.1.2.8.1.5 Atomic Linear ODE Forward Type Calculation: Example Implementation
1.3.4.7.1.2.8.1.6 Atomic Linear ODE Forward Mode: Example Implementation
1.3.4.7.1.2.8.1.7 Atomic Linear ODE Reverse Mode: Example Implementation
1.3.4.7.1.2.8.1.7.1 Atomic Linear ODE Second Order Reverse
1.3.4.7.1.2.8.1.8 Atomic Linear ODE Jacobian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.8.1.9 Atomic Linear ODE Hessian Sparsity Pattern: Example Implementation
1.3.4.7.1.2.8.1.10 Atomic Linear ODE Forward Type Calculation: Example Implementation
1.3.4.7.1.2.8.2 Atomic Linear ODE Forward Mode: Example and Test
1.3.4.7.1.2.8.3 Atomic Linear ODE Reverse Mode: Example and Test
1.3.4.7.1.2.8.4 Atomic Linear ODE Sparsity Calculations: Example and Test
1.3.4.7.1.2.8.5 Atomic Linear ODE Reverse Dependency Analysis: Example and Test
1.3.4.7.2 Atomic AD Functions: Third Generation
1.3.4.7.2.1 Defining Atomic Functions: Third Generation
1.3.4.7.2.1.1 Atomic Function Constructor
1.3.4.7.2.1.2 Using AD Version of an Atomic Function
1.3.4.7.2.1.3 Atomic Function Forward Type Calculation
1.3.4.7.2.1.4 Atomic Function Forward Mode
1.3.4.7.2.1.4.1 Atomic Functions and Forward Mode: Example and Test
1.3.4.7.2.1.4.2 Atomic Functions with Dynamic Parameters: Example and Test
1.3.4.7.2.1.5 Atomic Function Reverse Mode
1.3.4.7.2.1.5.1 Atomic Functions and Reverse Mode: Example and Test
1.3.4.7.2.1.6 Atomic Function Jacobian Sparsity Patterns
1.3.4.7.2.1.6.1 Atomic Function Jacobian Sparsity: Example and Test
1.3.4.7.2.1.7 Atomic Function Hessian Sparsity Patterns
1.3.4.7.2.1.7.1 Atomic Forward Hessian Sparsity: Example and Test
1.3.4.7.2.1.8 Atomic Function Reverse Dependency Calculation
1.3.4.7.2.1.8.1 Atomic Functions Reverse Dependency Analysis: Example and Test
1.3.4.7.2.2 Example Defining Atomic Functions: Third Generation
1.3.4.7.2.2.1 Getting Started with Atomic Functions: Example and Test
1.3.4.7.2.2.2 Atomic Euclidean Norm Squared: Example and Test
1.3.4.7.2.2.3 Tan and Tanh as User Atomic Operations: Example and Test
1.3.4.7.2.2.4 base2ad with Atomic Operations: Example and Test
1.3.4.7.2.2.5 Reciprocal as an Atomic Operation: Example and Test
1.3.4.7.2.2.6 User Atomic Matrix Multiply: Example and Test
1.3.4.7.2.2.6.1 Matrix Multiply as an Atomic Operation
1.3.4.7.3 Checkpoint Functions: Second Generation
1.3.4.7.3.1 Checkpoint Function Constructor
1.3.4.7.3.2 Using Checkpoint Functions
1.3.4.7.3.3 Dynamic Parameters in Checkpoint Functions
1.3.4.7.3.4 Get Started Checkpointing: Example and Test
1.3.4.7.3.5 Compare With and Without Checkpointing: Example and Test
1.3.4.7.3.6 Checkpointing With base2ad: Example and Test
1.3.4.7.3.7 Checkpoint Functions with Dynamic Parameters: Example and Test
1.3.4.7.3.8 Checkpointing an ODE Solver: Example and Test
1.3.5 Bool Valued Operations and Functions with AD Arguments
1.3.5.1 AD Binary Comparison Operators
1.3.5.1.1 AD Binary Comparison Operators: Example and Test
1.3.5.2 Compare AD and Base Objects for Nearly Equal
1.3.5.2.1 Compare AD with Base Objects: Example and Test
1.3.5.3 AD Boolean Functions
1.3.5.3.1 AD Boolean Functions: Example and Test
1.3.5.4 Constant, Dynamic, Parameter, and Variable
1.3.5.4.1 AD Parameter and Variable Functions: Example and Test
1.3.5.5 Check if Two Value are Identically Equal
1.3.5.5.1 EqualOpSeq: Example and Test
1.3.6 AD Vectors that Record Index Operations
1.3.6.1 AD Vectors that Record Index Operations: Example and Test
1.3.7 AD<Base> Requirements for a CppAD Base Type
1.3.7.1 Required Base Class Member Functions
1.3.7.2 Base Type Requirements for Conditional Expressions
1.3.7.3 Base Type Requirements for Identically Equal Comparisons
1.3.7.4 Base Type Requirements for Ordered Comparisons
1.3.7.5 Base Type Requirements for Standard Math Functions
1.3.7.6 Base Type Requirements for Numeric Limits
1.3.7.7 Extending to_string To Another Floating Point Type
1.3.7.8 Base Type Requirements for Hash Coding Values
1.3.7.9 Example AD Base Types That are not AD<OtherBase>
1.3.7.9.1 Example AD<Base> Where Base Constructor Allocates Memory
1.3.7.9.2 Using a User Defined AD Base Type: Example and Test
1.3.7.9.3 Enable use of AD<Base> where Base is Adolc’s adouble Type
1.3.7.9.3.1 Using Adolc with Multiple Levels of Taping: Example and Test
1.3.7.9.4 valvector: An Example Machine Learning Base Class
1.3.7.9.4.1 The valvector Constructors
1.3.7.9.4.1.1 Example and Test of valvector Constructors
1.3.7.9.4.2 Resize a valvector
1.3.7.9.4.2.1 Example and Test of valvector Resize
1.3.7.9.4.3 The valvector Assignment Operator
1.3.7.9.4.3.1 Example and Test of valvector Assignment Operator
1.3.7.9.4.4 Size of a valvector
1.3.7.9.4.4.1 Example and Test of valvector Size
1.3.7.9.4.5 Sum elements of a valvector
1.3.7.9.4.5.1 Example and Test of valvector Size
1.3.7.9.4.6 Accessing Elements of a valvector
1.3.7.9.4.6.1 Example and Test of valvector Element Access
1.3.7.9.4.7 The valvector Numeric Unary Operators
1.3.7.9.4.7.1 Example and Test of valvector Unary Operators
1.3.7.9.4.8 The valvector Numeric Binary Operators
1.3.7.9.4.8.1 Example and Test of valvector Binary Operators
1.3.7.9.4.9 The valvector Numeric Compound Assignment Operators
1.3.7.9.4.9.1 Example and Test of valvector Compound Assignment Operators
1.3.7.9.4.10 The valvector Compare Operators
1.3.7.9.4.10.1 Example and Test of valvector Compare Operators
1.3.7.9.4.11 Outputting a valvector
1.3.7.9.4.11.1 Example and Test of Outputting a valvector
1.3.7.9.4.12 The valvector Unary Math Functions
1.3.7.9.4.12.1 Example and Test of valvector Unary Math Functions
1.3.7.9.4.13 The valvector Pow Function
1.3.7.9.4.13.1 Example and Test of valvector pow Function
1.3.7.9.4.14 Absolute Zero Multiply of valvectors
1.3.7.9.4.14.1 Example and Test of valvector azmul Function
1.3.7.9.4.15 The valvector Conditional Expressions
1.3.7.9.4.15.1 Example and Test of valvector Conditional Expressions
1.3.7.9.4.16 The valvector Implementation of CppAD Base Type Requirements
1.3.7.9.4.16.1 Example and Test of valvector Base Requirements
1.3.7.9.4.17 Split A AD valvector
1.3.7.9.4.17.1 Example and Test of Splitting a valvector
1.3.7.9.4.18 Join a Vector of AD valvectors
1.3.7.9.4.18.1 Example and Test of Joining a valvector
1.3.7.9.4.19 Sum The Elements of and AD valvector
1.3.7.9.4.19.1 Example and Test of Summing a valvector
1.3.7.9.4.20 Getting Started Using valvector as a CppAD Base Class
1.3.7.9.4.21 Using valvector to Represent Linear Least Squares Objective
1.3.7.9.5 Enable use of AD<Base> where Base is float
1.3.7.9.6 Enable use of AD<Base> where Base is double
1.3.7.9.7 Enable use of AD<Base> where Base is std::complex<double>
1.3.7.9.7.1 Complex Polynomial: Example and Test
1.4 ADFun Objects
1.4.1 Create an ADFun Object by Recording an Operation Sequence
1.4.1.1 Declare Independent Variables and Start Recording
1.4.1.1.1 Independent and ADFun Constructor: Example and Test
1.4.1.2 Construct an ADFun Object and Stop Recording
1.4.1.2.1 ADFun Assignment: Example and Test
1.4.1.3 Stop Recording and Store Operation Sequence
1.4.1.4 Abort Recording of an Operation Sequence
1.4.1.4.1 Abort Current Recording: Example and Test
1.4.1.5 ADFun Function Properties
1.4.1.5.1 ADFun Function Properties: Example and Test
1.4.1.6 Setting and Getting a Function’s Name
1.4.1.6.1 ADFun Function Name: Example and Test
1.4.2 Other Ways to Create an ADFun Object
1.4.2.1 Create an AD<Base> Function From a Base Function
1.4.2.1.1 Taylor’s Ode Solver: base2ad Example and Test
1.4.2.1.2 Using base2ad and VecAD together: Example and Test
1.4.2.2 Json Representation of an AD Graph
1.4.2.2.1 Json AD Graph Operator Definitions
1.4.2.2.1.1 Json Unary Operators: Example and Test
1.4.2.2.1.2 Json add Operator: Example and Test
1.4.2.2.1.3 Json azmul Operator: Example and Test
1.4.2.2.1.4 Json div Operator: Example and Test
1.4.2.2.1.5 Json mul Operator: Example and Test
1.4.2.2.1.6 Json pow Operator: Example and Test
1.4.2.2.1.7 Json sub Operator: Example and Test
1.4.2.2.1.8 Json sum Operator: Example and Test
1.4.2.2.1.9 Json Conditional Expressions: Example and Test
1.4.2.2.1.10 Json Comparison Operators: Example and Test
1.4.2.2.1.11 Json add Operator: Example and Test
1.4.2.2.1.12 Json Atomic Function Three Operator: Example and Test
1.4.2.2.1.13 Json Atomic Function Operator: Example and Test
1.4.2.2.1.14 Json AD Graph print Operator: Example and Test
1.4.2.2.2 ADFun Object Corresponding to a Json AD Graph
1.4.2.2.2.1 Convert Jason Graph to an ADFun Object: Example and Test
1.4.2.2.3 Json AD Graph Corresponding to an ADFun Object
1.4.2.2.3.1 Convert an ADFun Object to a Json AD Graph: Example and Test
1.4.2.2.4 Json Get Started: Example and Test
1.4.2.2.5 Json Representation of a Sparse Matrix: Example and Test
1.4.2.3 C++ Representation of an AD Graph
1.4.2.3.1 C++ AD Graph Operator Enum Type
1.4.2.3.1.1 C++ AD Graph add Operator: Example and Test
1.4.2.3.1.2 C++ AD Graph add Operator: Example and Test
1.4.2.3.1.3 C++ AD Graph div Operator: Example and Test
1.4.2.3.1.4 C++ AD Graph mul Operator: Example and Test
1.4.2.3.1.5 C++ AD Graph pow Operator: Example and Test
1.4.2.3.1.6 C++ AD Graph sub Operator: Example and Test
1.4.2.3.1.7 Graph Unary Operator: Example and Test
1.4.2.3.1.8 C++ AD Graph sum Operator: Example and Test
1.4.2.3.1.9 C++ AD Graph Comparison Operators: Example and Test
1.4.2.3.1.10 C++ AD Graph Conditional Expressions: Example and Test
1.4.2.3.1.11 C++ AD Graph add Operator: Example and Test
1.4.2.3.1.12 C++ AD Graph Atomic Three Functions: Example and Test
1.4.2.3.1.13 C++ AD Graph Atomic Four Functions: Example and Test
1.4.2.3.1.14 C++ AD Graph print Operator: Example and Test
1.4.2.3.2 A C++ AD Graph Class
1.4.2.3.2.1 C++ AD Graph Constructor
1.4.2.3.2.2 C++ AD Graph Scalar Values
1.4.2.3.2.3 C++ AD Graph Vector Values
1.4.2.3.2.4 Print A C++ AD Graph
1.4.2.3.2.4.1 Print a C++ AD Graph: Example and Test
1.4.2.3.3 ADFun Object Corresponding to a CppAD Graph
1.4.2.3.3.1 Switching Between Variables and Dynamic Parameters: Example and Test
1.4.2.3.4 Create a C++ AD Graph Corresponding to an ADFun Object
1.4.2.4 Create An Abs-normal Representation of a Function
1.4.2.4.1 Examples and Tests: Abs-normal Representation of Non-Smooth Functions
1.4.2.4.1.1 abs_normal Getting Started: Example and Test
1.4.2.4.1.2 abs_normal: Print a Vector or Matrix
1.4.2.4.1.3 abs_normal: Evaluate First Order Approximation
1.4.2.4.1.3.1 abs_eval: Example and Test
1.4.2.4.1.3.2 abs_eval Source Code
1.4.2.4.1.4 abs_normal: Solve a Linear Program Using Simplex Method
1.4.2.4.1.4.1 abs_normal simplex_method: Example and Test
1.4.2.4.1.4.2 simplex_method Source Code
1.4.2.4.1.5 abs_normal: Solve a Linear Program With Box Constraints
1.4.2.4.1.5.1 abs_normal lp_box: Example and Test
1.4.2.4.1.5.2 lp_box Source Code
1.4.2.4.1.6 abs_normal: Minimize a Linear Abs-normal Approximation
1.4.2.4.1.6.1 abs_min_linear: Example and Test
1.4.2.4.1.6.2 abs_min_linear Source Code
1.4.2.4.1.7 Non-Smooth Optimization Using Abs-normal Linear Approximations
1.4.2.4.1.7.1 abs_normal min_nso_linear: Example and Test
1.4.2.4.1.7.2 min_nso_linear Source Code
1.4.2.4.1.8 Solve a Quadratic Program Using Interior Point Method
1.4.2.4.1.8.1 abs_normal qp_interior: Example and Test
1.4.2.4.1.8.2 qp_interior Source Code
1.4.2.4.1.9 abs_normal: Solve a Quadratic Program With Box Constraints
1.4.2.4.1.9.1 abs_normal qp_box: Example and Test
1.4.2.4.1.9.2 qp_box Source Code
1.4.2.4.1.10 abs_normal: Minimize a Linear Abs-normal Approximation
1.4.2.4.1.10.1 abs_min_quad: Example and Test
1.4.2.4.1.10.2 abs_min_quad Source Code
1.4.2.4.1.11 Non-Smooth Optimization Using Abs-normal Quadratic Approximations
1.4.2.4.1.11.1 abs_normal min_nso_quad: Example and Test
1.4.2.4.1.11.2 min_nso_quad Source Code
1.4.3 First and Second Order Derivatives: Easy Drivers
1.4.3.1 Jacobian: Driver Routine
1.4.3.1.1 Jacobian: Example and Test
1.4.3.2 Hessian: Easy Driver
1.4.3.2.1 Hessian: Example and Test
1.4.3.2.2 Hessian of Lagrangian and ADFun Default Constructor: Example and Test
1.4.3.3 First Order Partial Derivative: Driver Routine
1.4.3.3.1 First Order Partial Driver: Example and Test
1.4.3.4 First Order Derivative: Driver Routine
1.4.3.4.1 First Order Derivative Driver: Example and Test
1.4.3.5 Forward Mode Second Partial Derivative Driver
1.4.3.5.1 Subset of Second Order Partials: Example and Test
1.4.3.6 Reverse Mode Second Partial Derivative Driver
1.4.3.6.1 Second Partials Reverse Driver: Example and Test
1.4.4 Forward Mode
1.4.4.1 Change the Dynamic Parameters
1.4.4.1.1 Dynamic Parameters: Example and Test
1.4.4.2 Zero Order Forward Mode: Function Values
1.4.4.3 First Order Forward Mode: Derivative Values
1.4.4.4 Second Order Forward Mode: Derivative Values
1.4.4.5 Multiple Order Forward Mode
1.4.4.5.1 Forward Mode: Example and Test
1.4.4.5.2 Forward Mode: Example and Test of Multiple Orders
1.4.4.6 Multiple Directions Forward Mode
1.4.4.6.1 Forward Mode: Example and Test of Multiple Directions
1.4.4.7 Number Taylor Coefficient Orders Currently Stored
1.4.4.8 Comparison Changes Between Taping and Zero Order Forward
1.4.4.8.1 CompareChange and Re-Tape: Example and Test
1.4.4.9 Controlling Taylor Coefficients Memory Allocation
1.4.4.9.1 Controlling Taylor Coefficient Memory Allocation: Example and Test
1.4.4.10 Number of Variables that Can be Skipped
1.4.4.10.1 Number of Variables That Can be Skipped: Example and Test
1.4.5 Reverse Mode
1.4.5.1 First Order Reverse Mode
1.4.5.1.1 First Order Reverse Mode: Example and Test
1.4.5.2 Second Order Reverse Mode
1.4.5.2.1 Second Order Reverse ModeExample and Test
1.4.5.2.2 Hessian Times Direction: Example and Test
1.4.5.3 Any Order Reverse Mode
1.4.5.3.1 Third Order Reverse Mode: Example and Test
1.4.5.3.2 Reverse Mode General Case (Checkpointing): Example and Test
1.4.5.4 Reverse Mode Using Subgraphs
1.4.5.4.1 Computing Reverse Mode on Subgraphs: Example and Test
1.4.6 Calculating Sparsity Patterns
1.4.6.1 Forward Mode Jacobian Sparsity Patterns
1.4.6.1.1 Forward Mode Jacobian Sparsity: Example and Test
1.4.6.2 Reverse Mode Jacobian Sparsity Patterns
1.4.6.2.1 Reverse Mode Jacobian Sparsity: Example and Test
1.4.6.3 Forward Mode Hessian Sparsity Patterns
1.4.6.3.1 Forward Mode Hessian Sparsity: Example and Test
1.4.6.4 Reverse Mode Hessian Sparsity Patterns
1.4.6.4.1 Reverse Mode Hessian Sparsity: Example and Test
1.4.6.5 Subgraph Dependency Sparsity Patterns
1.4.6.5.1 Subgraph Dependency Sparsity Patterns: Example and Test
1.4.6.6 Computing Dependency: Example and Test
1.4.6.7 Preferred Sparsity Patterns: Row and Column Indices: Example and Test
1.4.6.8 Jacobian Sparsity Pattern: Forward Mode
1.4.6.8.1 Forward Mode Jacobian Sparsity: Example and Test
1.4.6.9 Jacobian Sparsity Pattern: Reverse Mode
1.4.6.9.1 Reverse Mode Jacobian Sparsity: Example and Test
1.4.6.10 Hessian Sparsity Pattern: Reverse Mode
1.4.6.10.1 Reverse Mode Hessian Sparsity: Example and Test
1.4.6.10.2 Sparsity Patterns For a Subset of Variables: Example and Test
1.4.6.11 Hessian Sparsity Pattern: Forward Mode
1.4.6.11.1 Forward Mode Hessian Sparsity: Example and Test
1.4.7 Calculating Sparse Derivatives
1.4.7.1 Computing Sparse Jacobians
1.4.7.1.1 Computing Sparse Jacobian Using Forward Mode: Example and Test
1.4.7.1.2 Computing Sparse Jacobian Using Reverse Mode: Example and Test
1.4.7.2 Sparse Jacobian
1.4.7.2.1 Sparse Jacobian: Example and Test
1.4.7.3 Computing Sparse Hessians
1.4.7.3.1 Computing Sparse Hessian: Example and Test
1.4.7.4 Sparse Hessian
1.4.7.4.1 Sparse Hessian: Example and Test
1.4.7.4.2 Computing Sparse Hessian for a Subset of Variables
1.4.7.4.3 Subset of a Sparse Hessian: Example and Test
1.4.7.5 Compute Sparse Jacobians Using Subgraphs
1.4.7.5.1 Computing Sparse Jacobian Using Reverse Mode: Example and Test
1.4.7.5.2 Sparse Hessian Using Subgraphs and Jacobian: Example and Test
1.4.8 Optimize an ADFun Object Tape
1.4.8.1 Optimizing Twice: Example and Test
1.4.8.2 Optimize Forward Activity Analysis: Example and Test
1.4.8.3 Optimize Reverse Activity Analysis: Example and Test
1.4.8.4 Optimize Comparison Operators: Example and Test
1.4.8.5 Optimize Print Forward Operators: Example and Test
1.4.8.6 Optimize Conditional Expressions: Example and Test
1.4.8.7 Optimize Nested Conditional Expressions: Example and Test
1.4.8.8 Optimize Cumulative Sum Operations: Example and Test
1.4.9 Check an ADFun Sequence of Operations
1.4.9.1 ADFun Check and Re-Tape: Example and Test
1.4.10 Check an ADFun Object For Nan Results
1.4.10.1 ADFun Checking For Nan: Example and Test
1.4.11 C Source Code Corresponding to an ADFun Object
1.4.11.1 JIT Creation, Compilation, and Linking of C Source Code
1.4.11.1.1 JIT Computation of Derivatives: Example and Test
1.4.11.1.2 The JIT compare_change Argument: Example and Test
1.4.11.1.3 JIT Compiler Options: Example and Test
1.4.11.1.4 Atomic Callbacks in JIT Function: Example and Test
1.4.11.1.5 JIT With Dynamic Parameters: Example and Test
1.5 CppAD API Preprocessor Symbols
1.6 Using CppAD in a Multi-Threading Environment
1.6.1 Enable AD Calculations During Parallel Mode
1.6.2 Run Multi-Threading Examples and Speed Tests
1.6.2.1 A Simple OpenMP Example and Test
1.6.2.2 A Simple Boost Thread Example and Test
1.6.2.3 A Simple Parallel Pthread Example and Test
1.6.2.4 Getting Started Using OpenMP Threads With CppAD
1.6.2.5 Getting Started Using Boost Threads With CppAD
1.6.2.6 Getting Started Using Posix Threads With CppAD
1.6.2.7 Using a Team of AD Threads: Example and Test
1.6.2.8 Multi-Threading Harmonic Summation Example / Test
1.6.2.8.1 Common Variables Used by Multi-threading Sum of 1/i
1.6.2.8.2 Set Up Multi-threading Sum of 1/i
1.6.2.8.3 Do One Thread’s Work for Sum of 1/i
1.6.2.8.4 Take Down Multi-threading Sum of 1/i
1.6.2.8.5 Multi-Threaded Implementation of Summation of 1/i
1.6.2.8.6 Timing Test of Multi-Threaded Summation of 1/i
1.6.2.9 Multi-Threading atomic_three Example / Test
1.6.2.9.1 Defines a atomic_three Operation that Computes Square Root
1.6.2.9.2 Multi-Threaded atomic_three Common Information
1.6.2.9.3 Multi-Threaded atomic_three Set Up
1.6.2.9.4 Multi-Threaded atomic_three Worker
1.6.2.9.5 Multi-Threaded atomic_three Take Down
1.6.2.9.6 Run Multi-Threaded atomic_three Calculation
1.6.2.9.7 Timing Test for Multi-Threaded atomic_three Calculation
1.6.2.10 Multi-Threading chkpoint_two Example / Test
1.6.2.10.1 chkpoint_two Algorithm that Computes Square Root
1.6.2.10.2 Multi-Threaded chkpoint_two Common Information
1.6.2.10.3 Multi-Threaded chkpoint_two Set Up
1.6.2.10.4 Multi-Threaded chkpoint_two Worker
1.6.2.10.5 Multi-Threaded chkpoint_two Take Down
1.6.2.10.6 Run Multi-Threaded chkpoint_two Calculation
1.6.2.10.7 Timing Test for Multi-Threaded chkpoint_two Calculation
1.6.2.11 Multi-Threaded Newton Method Example / Test
1.6.2.11.1 Common Variables use by Multi-Threaded Newton Method
1.6.2.11.2 Set Up Multi-Threaded Newton Method
1.6.2.11.3 Do One Thread’s Work for Multi-Threaded Newton Method
1.6.2.11.4 Take Down Multi-threaded Newton Method
1.6.2.11.5 A Multi-Threaded Newton’s Method
1.6.2.11.6 Timing Test of Multi-Threaded Newton Method
1.6.2.12 Specifications for A Team of AD Threads
1.6.2.12.1 OpenMP Implementation of a Team of AD Threads
1.6.2.12.2 Boost Thread Implementation of a Team of AD Threads
1.6.2.12.3 Pthread Implementation of a Team of AD Threads
1.7 Some General Purpose Utilities
1.7.1 Check NumericType Class Concept
1.7.1.1 The CheckNumericType Function: Example and Test
1.7.2 Check Simple Vector Concept
1.7.2.1 The CheckSimpleVector Function: Example and Test
1.7.3 Create a Dynamic Link Library
1.7.4 Replacing the CppAD Error Handler
1.7.4.1 Replacing The CppAD Error Handler: Example and Test
1.7.4.2 CppAD Assertions During Execution
1.7.5 Returns Indices that Sort a Vector
1.7.5.1 Index Sort: Example and Test
1.7.6 Link a Dynamic Link Library
1.7.6.1 dll_lib: Example and Test
1.7.7 Obtain Nan or Determine if a Value is Nan
1.7.7.1 nan: Example and Test
1.7.8 Determine if Two Values Are Nearly Equal
1.7.8.1 NearEqual Function: Example and Test
1.7.9 An Error Controller for ODE Solvers
1.7.9.1 OdeErrControl: Example and Test
1.7.9.2 OdeErrControl: Example and Test Using Maxabs Argument
1.7.10 An Arbitrary Order Gear Method
1.7.10.1 OdeGear: Example and Test
1.7.11 An Error Controller for Gear’s Ode Solvers
1.7.11.1 OdeGearControl: Example and Test
1.7.12 Evaluate a Polynomial or its Derivative
1.7.12.1 Polynomial Evaluation: Example and Test
1.7.12.2 Source: Poly
1.7.13 The Integer Power Function
1.7.13.1 The Pow Integer Exponent: Example and Test
1.7.14 Multi-dimensional Romberg Integration
1.7.14.1 Multi-Dimensional Romberg Integration: Example and Test
1.7.15 One DimensionalRomberg Integration
1.7.15.1 One Dimensional Romberg Integration: Example and Test
1.7.16 A 3rd and 4th Order Rosenbrock ODE Solver
1.7.16.1 rosen_34: Example and Test
1.7.17 An Embedded 4th and 5th Order Runge-Kutta ODE Solver
1.7.17.1 Runge45: Example and Test
1.7.17.2 Runge45: Example and Test
1.7.18 Union of Standard Sets
1.7.18.1 Set Union: Example and Test
1.7.19 Convert A CppAD Sparse Matrix to an Eigen Sparse Matrix
1.7.19.1 Converting CppAD Sparse Matrix to Eigen Format: Example and Test
1.7.20 Row and Column Index Sparsity Patterns
1.7.20.1 sparse_rc: Example and Test
1.7.21 Sparse Matrix Row, Column, Value Representation
1.7.21.1 sparse_rcv: Example and Test
1.7.22 Run One Speed Test and Return Results
1.7.22.1 speed_test: Example and test
1.7.23 Run One Speed Test and Print Results
1.7.23.1 Example Use of SpeedTest
1.7.24 Object that Runs a Group of Tests
1.7.25 Determine Amount of Time to Execute a Test
1.7.25.1 Returns Elapsed Number of Seconds
1.7.25.1.1 Elapsed Seconds: Example and Test
1.7.25.2 time_test: Example and test
1.7.26 Convert Certain Types to a String
1.7.26.1 to_string: Example and Test
1.7.27 The CppAD::vector Template Class
1.7.27.1 CppAD::vector Template Class: Example and Test
1.7.27.2 CppAD::vectorBool Class: Example and Test
1.7.28 Compute Determinants and Solve Equations by LU Factorization
1.7.28.1 Compute Determinant and Solve Linear Equations
1.7.28.1.1 LuSolve With Complex Arguments: Example and Test
1.7.28.1.2 Source: LuSolve
1.7.28.2 LU Factorization of A Square Matrix
1.7.28.2.1 LuFactor: Example and Test
1.7.28.2.2 Source: LuFactor
1.7.28.3 Invert an LU Factored Equation
1.7.28.3.1 LuInvert: Example and Test
1.7.28.3.2 Source: LuInvert
1.7.29 Definition of a Numeric Type
1.7.29.1 The NumericType: Example and Test
1.7.30 C++ Concept: A Simple Vector
1.7.30.1 Simple Vector Template Class: Example and Test
1.7.31 A Fast Multi-Threading Memory Allocator
1.7.31.1 Fast Multi-Threading Memory Allocator: Example and Test
1.7.31.2 Setup thread_alloc For Use in Multi-Threading Environment
1.7.31.3 Get Number of Threads
1.7.31.4 Is The Current Execution in Parallel Mode
1.7.31.5 Get the Current Thread Number
1.7.31.6 Get At Least A Specified Amount of Memory
1.7.31.7 Return Memory to thread_alloc
1.7.31.8 Free Memory Currently Available for Quick Use by a Thread
1.7.31.9 Control When Thread Alloc Retains Memory For Future Use
1.7.31.10 Amount of Memory a Thread is Currently Using
1.7.31.11 Amount of Memory Available for Quick Use by a Thread
1.7.31.12 Allocate An Array and Call Default Constructor for its Elements
1.7.31.13 Deallocate An Array and Call Destructor for its Elements
1.7.31.14 Free All Memory That Was Allocated for Use by thread_alloc
1.8 Use Ipopt to Solve a Nonlinear Programming Problem
1.8.1 Nonlinear Programming Using CppAD and Ipopt: Example and Test
1.8.2 Nonlinear Programming Retaping: Example and Test
1.8.3 ODE Inverse Problem Definitions: Source Code
1.9 Examples
1.9.1 Getting Started Using CppAD to Compute Derivatives
1.9.2 List All (Except Deprecated) CppAD Examples
1.9.3 General Examples
1.9.3.1 Creating Your Own Interface to an ADFun Object
1.9.3.2 Example and Test Linking CppAD to Languages Other than C++
1.9.3.3 Differentiate Conjugate Gradient Algorithm: Example and Test
1.9.3.4 Enable Use of Eigen Linear Algebra Package with CppAD
1.9.3.4.1 Source Code for eigen_plugin.hpp
1.9.3.4.2 Using Eigen Arrays: Example and Test
1.9.3.4.3 Using Eigen To Compute Determinant: Example and Test
1.9.3.5 Gradient of Determinant Using Expansion by Minors: Example and Test
1.9.3.6 Gradient of Determinant Using LU Factorization: Example and Test
1.9.3.7 Interfacing to C: Example and Test
1.9.3.8 Gradient of Determinant Using Expansion by Minors: Example and Test
1.9.3.9 Gradient of Determinant Using Lu Factorization: Example and Test
1.9.3.10 Using Multiple Levels of AD
1.9.3.10.1 Multiple Level of AD: Example and Test
1.9.3.10.2 Computing a Jacobian With Constants that Change
1.9.3.11 A Stiff Ode: Example and Test
1.9.3.12 Taylor’s Ode Solver: A Multi-Level AD Example and Test
1.9.3.13 Taylor’s Ode Solver: A Multi-Level Adolc Example and Test
1.9.3.14 Example Differentiating a Stack Machine Interpreter
1.9.3.15 Generate Source Code and Compile an AD Function
1.9.3.15.1 Evaluate a Code Gen Function: Example and Test
1.9.3.15.2 File Store and Retrieve a Code Gen Function: Example and Test
1.9.3.15.3 Evaluate Jacobian of a Code Gen Function: Example and Test
1.9.3.15.4 Pass Jacobian as Code Gen Function: Example and Test
1.9.3.15.5 Evaluate Sparse Jacobian of a Code Gen Function: Example and Test
1.9.3.15.6 Pass Sparse Jacobian as Code Gen Function: Example and Test
1.9.3.16 code_gen_fun Class Include File
1.9.3.17 code_gen_fun Class Member Implementation
1.9.4 Utility Routines used by CppAD Examples
1.9.4.1 Abs-Normal Form Examples and Tests Driver
1.9.4.2 atomic_four Examples and Tests Driver
1.9.4.3 atomic_three Examples and Tests Driver
1.9.4.4 atomic_two Examples and Tests Driver
1.9.4.5 chkpoint_two Examples and Tests Driver
1.9.4.6 CppADCodeGen Examples and Tests Driver
1.9.4.7 General Examples and Tests Driver
1.9.4.8 Lu Factor and Solve with Recorded Pivoting
1.9.4.8.1 Lu Factor and Solve With Recorded Pivoting: Example and Test
1.9.4.9 graph Examples and Tests Driver
1.9.4.10 ipopt_solve Examples and Tests Driver
1.9.4.11 jit Examples and Tests Driver
1.9.4.12 json Examples and Tests Driver
1.9.4.13 optimize Examples and Tests Driver
1.9.4.14 Sparse AD Examples and Tests Driver
1.9.4.15 CppAD Utilities Examples and Tests Driver
1.9.4.16 valvector Examples and Tests Driver
1.9.4.17 Speed Examples and Tests Driver
1.9.5 Using The CppAD Test Vector Template Class
1.9.6 Suppress Suspect Implicit Conversion Warnings
1.10 Speed Test an Operator Overloading AD Package
1.10.1 Running the Speed Test Program
1.10.1.1 Package Specific Speed Test Linking Routines
1.10.1.1.1 Speed Testing Gradient of Determinant Using Lu Factorization
1.10.1.1.2 Speed Testing Gradient of Determinant by Minor Expansion
1.10.1.1.3 Speed Testing Derivative of Matrix Multiply
1.10.1.1.4 Speed Testing the Jacobian of Ode Solution
1.10.1.1.5 Speed Testing Second Derivative of a Polynomial
1.10.1.1.6 Link to Speed Test Sparse Hessian
1.10.1.1.7 Speed Testing Sparse Jacobians
1.10.2 Speed Testing Utilities
1.10.2.1 Determinant Using Expansion by Lu Factorization
1.10.2.1.1 Determinant Using Lu Factorization: Example and Test
1.10.2.1.2 Source: det_by_lu
1.10.2.2 Determinant of a Minor
1.10.2.2.1 Determinant of a Minor: Example and Test
1.10.2.2.2 Source: det_of_minor
1.10.2.3 Determinant Using Expansion by Minors
1.10.2.3.1 Determinant Using Expansion by Minors: Example and Test
1.10.2.3.2 Source: det_by_minor
1.10.2.4 Check Determinant of 3 by 3 matrix
1.10.2.4.1 Source: det_33
1.10.2.5 Check Gradient of Determinant of 3 by 3 matrix
1.10.2.5.1 Source: det_grad_33
1.10.2.6 Sum Elements of a Matrix Times Itself
1.10.2.6.1 Sum of the Elements of the Square of a Matrix: Example and Test
1.10.2.6.2 Source: mat_sum_sq
1.10.2.7 Evaluate a Function Defined in Terms of an ODE
1.10.2.7.1 ode_evaluate: Example and test
1.10.2.7.2 Source: ode_evaluate
1.10.2.8 Evaluate a Function That Has a Sparse Jacobian
1.10.2.8.1 sparse_jac_fun: Example and test
1.10.2.8.2 Source: sparse_jac_fun
1.10.2.9 Evaluate a Function That Has a Sparse Hessian
1.10.2.9.1 sparse_hes_fun: Example and test
1.10.2.9.2 Source: sparse_hes_fun
1.10.2.10 Simulate a [0,1] Uniform Random Variate
1.10.2.10.1 Source: uniform_01
1.10.3 Speed Test of Functions in Double
1.10.3.1 Double Speed: Determinant by Minor Expansion
1.10.3.2 Double Speed: Determinant Using Lu Factorization
1.10.3.3 Double Speed: Matrix Multiplication
1.10.3.4 Double Speed: Ode Solution
1.10.3.5 Double Speed: Evaluate a Polynomial
1.10.3.6 Double Speed: Sparse Hessian
1.10.3.7 Double Speed: Sparse Jacobian
1.10.4 Speed Test of Derivatives Using Adolc
1.10.4.1 Adolc Speed: Gradient of Determinant by Minor Expansion
1.10.4.2 Adolc Speed: Gradient of Determinant Using Lu Factorization
1.10.4.3 Adolc Speed: Matrix Multiplication
1.10.4.4 Adolc Speed: Ode
1.10.4.5 Adolc Speed: Second Derivative of a Polynomial
1.10.4.6 Adolc Speed: Sparse Hessian
1.10.4.7 Adolc Speed: Sparse Jacobian
1.10.4.8 Adolc Test Utility: Allocate and Free Memory For a Matrix
1.10.5 Speed Test Derivatives Using CppAD
1.10.5.1 Cppad Speed: Gradient of Determinant by Minor Expansion
1.10.5.2 Cppad Speed: Gradient of Determinant Using Lu Factorization
1.10.5.3 CppAD Speed, Matrix Multiplication
1.10.5.4 Cppad Speed: Gradient of Ode Solution
1.10.5.5 Cppad Speed: Second Derivative of a Polynomial
1.10.5.6 Cppad Speed: Sparse Hessian
1.10.5.7 Cppad Speed: Sparse Jacobian
1.10.6 Speed Test Derivatives Using Fadbad
1.10.6.1 Fadbad Speed: Gradient of Determinant by Minor Expansion
1.10.6.2 Fadbad Speed: Gradient of Determinant Using Lu Factorization
1.10.6.3 Fadbad Speed: Matrix Multiplication
1.10.6.4 Fadbad Speed: Ode
1.10.6.5 Fadbad Speed: Second Derivative of a Polynomial
1.10.6.6 Fadbad Speed: Sparse Hessian
1.10.6.7 Fadbad Speed: sparse_jacobian
1.10.7 Speed Test Derivatives Using cppad_jit
1.10.7.1 cppad_jit Speed: Gradient of Determinant by Minor Expansion
1.10.7.2 cppad_jit Speed: Gradient of Determinant Using Lu Factorization
1.10.7.3 cppad_jit Speed: Matrix Multiplication
1.10.7.4 cppad_jit Speed: Ode
1.10.7.5 cppad_jit Speed: Second Derivative of a Polynomial
1.10.7.6 cppad_jit Speed: Sparse Hessian
1.10.7.7 cppad_jit Speed: sparse_jacobian
1.10.8 Speed Test Derivatives Using Cppadcg
1.10.8.1 cppadcg Speed: Gradient of Determinant by Minor Expansion
1.10.8.2 Cppadcg Speed: Gradient of Determinant Using Lu Factorization
1.10.8.3 Cppadcg Speed: Matrix Multiplication
1.10.8.4 Cppadcg Speed: Ode
1.10.8.5 Cppadcg Speed: Second Derivative of a Polynomial
1.10.8.6 Cppadcg Speed: Sparse Hessian
1.10.8.7 Cppadcg Speed: Sparse Jacobian
1.10.9 Speed Test Derivatives Using Sacado
1.10.9.1 Sacado Speed: Gradient of Determinant by Minor Expansion
1.10.9.2 Sacado Speed: Gradient of Determinant Using Lu Factorization
1.10.9.3 Sacado Speed: Matrix Multiplication
1.10.9.4 Sacado Speed: Gradient of Ode Solution
1.10.9.5 Sacado Speed: Second Derivative of a Polynomial
1.10.9.6 Sacado Speed: Sparse Hessian
1.10.9.7 Sacado Speed: sparse_jacobian
1.10.10 Speed Test Example and Template for a New Package
1.10.10.1 Xpackage Speed: Gradient of Determinant by Minor Expansion
1.10.10.2 Xpackage Speed: Gradient of Determinant Using Lu Factorization
1.10.10.3 Xpackage Speed: Matrix Multiplication
1.10.10.4 Xpackage Speed: Ode
1.10.10.5 Xpackage Speed: Second Derivative of a Polynomial
1.10.10.6 Xpackage Speed: Sparse Hessian
1.10.10.7 Xpackage Speed: sparse_jacobian
2 Appendix
2.1 Frequently Asked Questions and Answers
2.2 Directory Structure
2.3 Glossary
2.4 Bibliography
2.5 The CppAD Wish List
2.6 CppAD Release Notes
2.6.1 Release Notes for 2024
2.6.2 Release Notes for 2023
2.6.3 Release Notes for 2022
2.6.4 Release Notes for 2021
2.6.5 Release Notes for 2020
2.6.6 Release Notes for 2019
2.6.7 Release Notes for 2018
2.6.8 Release Notes for 2017
2.6.9 Release Notes for 2016
2.6.10 Release Notes for 2015
2.6.11 Release Notes for 2014
2.6.12 Release Notes for 2013
2.6.13 Release Notes for 2012
2.6.14 Release Notes for 2011
2.6.15 Release Notes for 2010
2.6.16 Release Notes for 2009
2.6.17 Release Notes for 2008
2.6.18 Release Notes for 2007
2.6.19 Release Notes for 2006
2.6.20 Release Notes for 2005
2.6.21 Release Notes for 2004
2.6.22 Release Notes for 2003
2.7 CppAD Deprecated API Features
2.7.1 Deprecated Include Files
2.7.2 ADFun Object Deprecated Member Functions
2.7.3 Comparison Changes During Zero Order Forward Mode
2.7.4 OpenMP Parallel Setup
2.7.5 Routines That Track Use of New and Delete
2.7.6 A Quick OpenMP Memory Allocator Used by CppAD
2.7.6.1 Set and Get Maximum Number of Threads for omp_alloc Allocator
2.7.6.2 Is The Current Execution in OpenMP Parallel Mode
2.7.6.3 Get the Current OpenMP Thread Number
2.7.6.4 Get At Least A Specified Amount of Memory
2.7.6.5 Return Memory to omp_alloc
2.7.6.6 Free Memory Currently Available for Quick Use by a Thread
2.7.6.7 Amount of Memory a Thread is Currently Using
2.7.6.8 Amount of Memory Available for Quick Use by a Thread
2.7.6.9 Allocate Memory and Create A Raw Array
2.7.6.10 Return A Raw Array to The Available Memory for a Thread
2.7.6.11 Check If A Memory Allocation is Efficient for Another Use
2.7.6.12 Set Maximum Number of Threads for omp_alloc Allocator
2.7.7 Memory Leak Detection
2.7.8 Machine Epsilon For AD Types
2.7.9 Nonlinear Programming Using the CppAD Interface to Ipopt
2.7.10 Defining Atomic Functions: First Generation
2.7.11 Defining Atomic Functions: Second Generation
2.7.11.1 Atomic Function Constructor
2.7.11.2 Set Atomic Function Options
2.7.11.3 Using AD Version of Atomic Function
2.7.11.4 Atomic Forward Mode
2.7.11.5 Atomic Reverse Mode
2.7.11.6 Atomic Forward Jacobian Sparsity Patterns
2.7.11.7 Atomic Reverse Jacobian Sparsity Patterns
2.7.11.8 Atomic Forward Hessian Sparsity Patterns
2.7.11.9 Atomic Reverse Hessian Sparsity Patterns
2.7.11.10 Free Static Variables
2.7.12 Example Defining Atomic Functions: Second Generation
2.7.12.1 Atomic Eigen Matrix Multiply: Example and Test
2.7.12.1.1 atomic_two Eigen Matrix Multiply Class
2.7.12.2 Atomic Eigen Matrix Inverse: Example and Test
2.7.12.2.1 atomic_two Eigen Matrix Inversion Class
2.7.12.3 Atomic Eigen Cholesky Factorization: Example and Test
2.7.12.3.1 AD Theory for Cholesky Factorization
2.7.12.3.2 atomic_two Eigen Cholesky Factorization Class
2.7.13 Multi-Threading atomic_two Example / Test
2.7.13.1 Defines a atomic_two Operation that Computes Square Root
2.7.13.2 Multi-Threaded atomic_two Common Information
2.7.13.3 Multi-Threaded atomic_two Set Up
2.7.13.4 Multi-Threaded atomic_two Worker
2.7.13.5 Multi-Threaded atomic_two Take Down
2.7.13.6 Run Multi-Threaded atomic_two Calculation
2.7.13.7 Timing Test for Multi-Threaded atomic_two Calculation
2.7.14 Checkpoint Functions: First Generation
2.7.15 Multi-Threading chkpoint_one Example / Test
2.7.15.1 chkpoint_one Algorithm that Computes Square Root
2.7.15.2 Multi-Threaded chkpoint_one Common Information
2.7.15.3 Multi-Threaded chkpoint_one Set Up
2.7.15.4 Multi-Threaded chkpoint_one Worker
2.7.15.5 Multi-Threaded chkpoint_one Take Down
2.7.15.6 Run Multi-Threaded chkpoint_one Calculation
2.7.15.7 Timing Test for Multi-Threaded chkpoint_one Calculation
2.7.16 zdouble: An AD Base Type With Absolute Zero
2.7.17 Configure Test and Installation Script
2.8 Compare Speed of C and C++
2.8.1 Determinant of a Minor
2.8.2 Compute Determinant using Expansion by Minors
2.8.3 Simulate a [0,1] Uniform Random Variate
2.8.4 Correctness Test of det_by_minor Routine
2.8.5 Repeat det_by_minor Routine A Specified Number of Times
2.8.6 Returns Elapsed Number of Seconds
2.8.7 Determine Amount of Time to Execute det_by_minor
2.8.8 Main Program For Comparing C and C++ Speed
2.9 Some Numerical AD Utilities
2.9.1 Computing Jacobian and Hessian of Bender’s Reduced Objective
2.9.1.1 BenderQuad: Example and Test
2.9.2 Jacobian and Hessian of Optimal Values
2.9.2.1 opt_val_hes: Example and Test
2.9.3 LU Factorization of A Square Matrix and Stability Calculation
2.9.3.1 LuRatio: Example and Test
2.10 CppAD Addons
2.11 Your License for the CppAD Software