1 | /* -------------------------------------------------------------------------- |
---|
2 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell |
---|
3 | |
---|
4 | CppAD is distributed under multiple licenses. This distribution is under |
---|
5 | the terms of the |
---|
6 | Eclipse Public License Version 1.0. |
---|
7 | |
---|
8 | A copy of this license is included in the COPYING file of this distribution. |
---|
9 | Please visit http://www.coin-or.org/CppAD/ for information on other licenses. |
---|
10 | -------------------------------------------------------------------------- */ |
---|
11 | $begin CppAD$$ |
---|
12 | $comment default navigate command for all of CppAD documentation$$ |
---|
13 | $navigate% |
---|
14 | Prev%Prev% |
---|
15 | Next%Next% |
---|
16 | Across%Index% |
---|
17 | Up%Up% |
---|
18 | Down_up_3%_up_3% |
---|
19 | Down_up_2%_up_2% |
---|
20 | Down_up_1%_up_1% |
---|
21 | Down_up_0%_up_0% |
---|
22 | Current%Headings |
---|
23 | %$$ |
---|
24 | $comment ------------------------------------------------------------- |
---|
25 | default automatic indexing command for all CppAD documentaiton |
---|
26 | $$ |
---|
27 | $aindex section head subhead$$ |
---|
28 | $comment ------------------------------------------------------------- |
---|
29 | Latex used throughout the CppAD documentation |
---|
30 | $$ |
---|
31 | $latex |
---|
32 | \newcommand{\W}[1]{ \; #1 \; } |
---|
33 | \newcommand{\R}[1]{ {\rm #1} } |
---|
34 | \newcommand{\B}[1]{ {\bf #1} } |
---|
35 | \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } |
---|
36 | \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } |
---|
37 | \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } |
---|
38 | \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} } |
---|
39 | $$ |
---|
40 | $comment ------------------------------------------------------------- |
---|
41 | hilite commands used throughout the CppAD documentation |
---|
42 | $$ |
---|
43 | $hilitecmd% |
---|
44 | verbatim% |
---|
45 | codep |
---|
46 | %$$ |
---|
47 | $hiliteseq% |
---|
48 | |
---|
49 | CppAD::%AD%<% AD |
---|
50 | % %AD%<% AD |
---|
51 | |
---|
52 | %CppAD::%ADFun%<% FunConstruct |
---|
53 | % %ADFun%<% FunConstruct |
---|
54 | |
---|
55 | % %CPPAD_TESTVECTOR%(% testvector |
---|
56 | |
---|
57 | %.%Forward%(% Forward |
---|
58 | |
---|
59 | %CppAD::%Independent%(% Independent |
---|
60 | % %Independent%(% Independent |
---|
61 | |
---|
62 | %.%Jacobian%(% Jacobian |
---|
63 | |
---|
64 | %CppAD::%NearEqual%(% NearEqual |
---|
65 | % %NearEqual%(% NearEqual |
---|
66 | |
---|
67 | %.%Reverse%(% Reverse |
---|
68 | %$$ |
---|
69 | $spell |
---|
70 | Jax |
---|
71 | cppad.hpp |
---|
72 | cppad |
---|
73 | namespaces |
---|
74 | std |
---|
75 | templated |
---|
76 | const |
---|
77 | CppADvector |
---|
78 | multiplicative |
---|
79 | Microsoft |
---|
80 | bool |
---|
81 | Det |
---|
82 | namespace |
---|
83 | Cpp |
---|
84 | Var |
---|
85 | Diff |
---|
86 | initializes |
---|
87 | $$ |
---|
88 | |
---|
89 | , |
---|
90 | |
---|
91 | $comment bin/version assumes that : follows cppad version number here$$ |
---|
92 | $section |
---|
93 | cppad-20170522: A Package for Differentiation of C++ Algorithms |
---|
94 | $$ |
---|
95 | $mindex AD algorithmic differentiation automatic C++ algorithm derivative CppAD version cppad.hpp$$ |
---|
96 | |
---|
97 | $comment This comment is used to remove the table below$$ |
---|
98 | $table |
---|
99 | $cnext |
---|
100 | One section per web page $pre $$ $cnext |
---|
101 | All sections in one web page |
---|
102 | $rnext |
---|
103 | $cnext |
---|
104 | (fast to load) $pre $$ $cnext |
---|
105 | (slow to load) |
---|
106 | $rnext |
---|
107 | Math displayed using MathJax $pre $$ $cnext |
---|
108 | $href%cppad.htm%$$ |
---|
109 | $pre $$ $cnext |
---|
110 | $href%_printable.htm%$$ |
---|
111 | $rnext |
---|
112 | Math displayed using MathML $pre $$ $cnext |
---|
113 | $href%cppad.xml%$$ $pre $$ $cnext |
---|
114 | $href%_printable.xml%$$ |
---|
115 | $tend |
---|
116 | |
---|
117 | |
---|
118 | $head Syntax$$ |
---|
119 | $code # include <cppad/cppad.hpp>$$ |
---|
120 | |
---|
121 | $head Introduction$$ |
---|
122 | We refer to the |
---|
123 | step by step conversion from an algorithm that computes function values |
---|
124 | to an algorithm that computes derivative values |
---|
125 | as $italic Algorithmic Differentiation$$ |
---|
126 | (often referred to as $italic Automatic Differentiation$$.) |
---|
127 | Given a C++ algorithm that computes function values, |
---|
128 | CppAD generates an algorithm that computes its derivative values. |
---|
129 | A brief introduction to Algorithmic Differentiation can be found in |
---|
130 | $href%http://en.wikipedia.org/wiki/Automatic_differentiation%wikipedia%$$. |
---|
131 | The web site |
---|
132 | $href%http://www.autodiff.org%autodiff.org%$$ |
---|
133 | is dedicated to research about, and promoting the use of, AD. |
---|
134 | |
---|
135 | $list number$$ |
---|
136 | $href%http://www.coin-or.org/CppAD/%CppAD%$$ |
---|
137 | uses operator overloading to compute derivatives of algorithms defined in C++. |
---|
138 | It is distributed by the |
---|
139 | $href%http://www.coin-or.org/foundation.html%COIN-OR Foundation%$$ |
---|
140 | with the Eclipse Public License |
---|
141 | $href%http://www.opensource.org/licenses/EPL-1.0%EPL-1.0%$$ |
---|
142 | or the GNU General Public License |
---|
143 | $href%http://www.opensource.org/licenses/AGPL-3.0%GPL-3.0%$$. |
---|
144 | Testing and installation is supported for Unix, Microsoft, and Apple |
---|
145 | operating systems. |
---|
146 | Extensive user and developer documentation is included. |
---|
147 | |
---|
148 | $lnext |
---|
149 | An AD of $italic Base$$ |
---|
150 | $xref/glossary/Operation/Sequence/operation sequence/1/$$ |
---|
151 | is stored as an |
---|
152 | $xref/ADFun//AD function object/$$ |
---|
153 | which can evaluate function values and derivatives. |
---|
154 | Arbitrary order |
---|
155 | $xref/Forward//forward/$$ and $xref/Reverse//reverse/$$ |
---|
156 | mode derivative calculations |
---|
157 | can be preformed on the operation sequence. |
---|
158 | Logical comparisons can be included in an operation sequence |
---|
159 | using AD $xref/CondExp//conditional expressions/$$. |
---|
160 | Evaluation of user defined unary |
---|
161 | $xref/Discrete//discrete functions/$$ can also be included |
---|
162 | in the sequence of operations; i.e., |
---|
163 | functions that depend on the |
---|
164 | $cref/independent variables/glossary/Tape/Independent Variable/$$ |
---|
165 | but which have identically zero derivatives |
---|
166 | (e.g., a step function). |
---|
167 | |
---|
168 | $lnext |
---|
169 | Derivatives of functions that are defined in terms of other derivatives |
---|
170 | can be computed using multiple levels of AD; |
---|
171 | see $cref/mul_level.cpp/$$ for a simple example |
---|
172 | and $cref/mul_level_ode.cpp/$$ for a more realistic example. |
---|
173 | To this end, CppAD can also be used with other AD types; for example see |
---|
174 | $cref/mul_level_adolc_ode.cpp/$$. |
---|
175 | |
---|
176 | $lnext |
---|
177 | A set of programs for doing $cref/speed/$$ comparisons between |
---|
178 | $href%https://projects.coin-or.org/ADOL-C%Adolc%$$, |
---|
179 | CppAD, |
---|
180 | $href%http://www.fadbad.com/%Fadbad%$$, |
---|
181 | and |
---|
182 | $href%http://trilinos.sandia.gov/packages/sacado/%Sacado%$$ |
---|
183 | are included. |
---|
184 | |
---|
185 | |
---|
186 | $lnext |
---|
187 | Includes a set of C++ $cref/utilities/utility/$$ that are useful |
---|
188 | for general operator overloaded numerical method. |
---|
189 | Allows for replacement of the |
---|
190 | $cref/testvector/$$ |
---|
191 | template vector class which is used for extensive testing; |
---|
192 | for example, you can do your testing with the |
---|
193 | $href%http://www.boost.org/libs/numeric/ublas/doc/index.htm%uBlas%$$ |
---|
194 | template vector class. |
---|
195 | |
---|
196 | $lnext |
---|
197 | See $xref/whats_new/$$ for a list of recent extensions and bug fixes. |
---|
198 | |
---|
199 | $lend |
---|
200 | |
---|
201 | You can find out about other algorithmic differentiation tools |
---|
202 | and about algorithmic differentiation in general at the following web sites: |
---|
203 | $href%http://en.wikipedia.org/wiki/Automatic_differentiation%wikipedia%$$, |
---|
204 | $href%http://www.autodiff.org%autodiff.org%$$. |
---|
205 | |
---|
206 | $head Example$$ |
---|
207 | The file |
---|
208 | $xref/get_started.cpp/$$ |
---|
209 | contains an example and test of using CppAD to compute |
---|
210 | the derivative of a polynomial. |
---|
211 | There are many other |
---|
212 | $xref/Example//examples/$$. |
---|
213 | |
---|
214 | $head Include File$$ |
---|
215 | The following include directive |
---|
216 | $syntax% |
---|
217 | # include <cppad/cppad.hpp> |
---|
218 | %$$ |
---|
219 | includes the CppAD package for the rest of the current compilation unit. |
---|
220 | |
---|
221 | $head Preprocessor Symbols$$ |
---|
222 | All the $cref preprocessor$$ symbols used by CppAD begin with eight |
---|
223 | $code CppAD$$ or $code CPPAD_$$. |
---|
224 | |
---|
225 | $head Namespace$$ |
---|
226 | All of the functions and objects defined by CppAD are in the |
---|
227 | $code CppAD$$ namespace; for example, you can access the $xref/AD/$$ types as |
---|
228 | $syntax% |
---|
229 | size_t n = 2; |
---|
230 | CppAD::vector< CppAD::AD<%Base%> > %x%(%n%) |
---|
231 | %$$ |
---|
232 | You can abbreviate access to one object or function a $code using$$ |
---|
233 | command of the form |
---|
234 | $syntax% |
---|
235 | using CppAD::AD |
---|
236 | CppAD::vector< AD<%Base%> > %x%(%n%) |
---|
237 | %$$ |
---|
238 | You can abbreviate access to all CppAD objects and functions |
---|
239 | with a command of the form |
---|
240 | $syntax% |
---|
241 | using namespace CppAD |
---|
242 | vector< AD<%Base%> > %x%(%n%) |
---|
243 | %$$ |
---|
244 | If you include other namespaces in a similar manner, |
---|
245 | this can cause naming conflicts. |
---|
246 | |
---|
247 | |
---|
248 | $childtable% |
---|
249 | omh/install/install.omh% |
---|
250 | omh/introduction.omh% |
---|
251 | cppad/core/user_ad.hpp% |
---|
252 | cppad/core/ad_fun.hpp% |
---|
253 | omh/preprocessor.omh% |
---|
254 | omh/multi_thread.omh% |
---|
255 | omh/utility.omh% |
---|
256 | cppad/ipopt/solve.hpp% |
---|
257 | omh/example.omh% |
---|
258 | omh/speed/speed.omh% |
---|
259 | omh/appendix.omh |
---|
260 | %$$ |
---|
261 | |
---|
262 | $end |
---|