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