1 | $Id: doc.omh 2907 2013-10-06 14:20:31Z bradbell $ |
---|
2 | /* -------------------------------------------------------------------------- |
---|
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell |
---|
4 | |
---|
5 | CppAD is distributed under multiple licenses. This distribution is under |
---|
6 | the terms of the |
---|
7 | Eclipse Public License Version 1.0. |
---|
8 | |
---|
9 | A copy of this license is included in the COPYING file of this distribution. |
---|
10 | Please visit http://www.coin-or.org/CppAD/ for information on other licenses. |
---|
11 | -------------------------------------------------------------------------- */ |
---|
12 | $begin CppAD$$ |
---|
13 | $comment default navigate command for all of CppAD documentation$$ |
---|
14 | $navigate% |
---|
15 | Prev%Prev% |
---|
16 | Next%Next% |
---|
17 | Across%Index% |
---|
18 | Up%Up% |
---|
19 | Down_up_3%_up_3% |
---|
20 | Down_up_2%_up_2% |
---|
21 | Down_up_1%_up_1% |
---|
22 | Down_up_0%_up_0% |
---|
23 | Current%Headings |
---|
24 | %$$ |
---|
25 | $spell |
---|
26 | cppad.hpp |
---|
27 | cppad |
---|
28 | namespaces |
---|
29 | std |
---|
30 | templated |
---|
31 | const |
---|
32 | CppADvector |
---|
33 | multiplicative |
---|
34 | Microsoft |
---|
35 | bool |
---|
36 | Det |
---|
37 | namespace |
---|
38 | Cpp |
---|
39 | Var |
---|
40 | Diff |
---|
41 | initializes |
---|
42 | $$ |
---|
43 | |
---|
44 | $index AD$$, |
---|
45 | $index algorithmic differentiation$$ |
---|
46 | $index automatic differentiation$$ |
---|
47 | $index C++, algorithm derivative$$ |
---|
48 | $index CppAD$$ |
---|
49 | $index version, CppAD$$ |
---|
50 | |
---|
51 | $section |
---|
52 | cppad-20130000.3: A Package for Differentiation of C++ Algorithms |
---|
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 | |
---|
76 | $head Syntax$$ |
---|
77 | $code # include <cppad/cppad.hpp>$$ |
---|
78 | |
---|
79 | $head Introduction$$ |
---|
80 | $index introduction$$ |
---|
81 | We refer to the |
---|
82 | step by step conversion from an algorithm that computes function values |
---|
83 | to an algorithm that computes derivative values |
---|
84 | as $italic Algorithmic Differentiation$$ |
---|
85 | (often referred to as $italic Automatic Differentiation$$.) |
---|
86 | Given a C++ algorithm that computes function values, |
---|
87 | CppAD generates an algorithm that computes its derivative values. |
---|
88 | A brief introduction to Algorithmic Differentiation can be found in |
---|
89 | $href%http://en.wikipedia.org/wiki/Automatic_differentiation%wikipedia%$$. |
---|
90 | The web site |
---|
91 | $href%http://www.autodiff.org%autodiff.org%$$ |
---|
92 | is dedicated to research about, and promoting the use of, AD. |
---|
93 | |
---|
94 | $list number$$ |
---|
95 | $href%http://www.coin-or.org/CppAD/%CppAD%$$ |
---|
96 | uses operator overloading to compute derivatives of algorithms defined in C++. |
---|
97 | It is distributed by the |
---|
98 | $href%http://www.coin-or.org/foundation.html%COIN-OR Foundation%$$ |
---|
99 | with the Eclipse Public License |
---|
100 | $href%http://www.opensource.org/licenses/EPL-1.0%EPL-1.0%$$ |
---|
101 | or the GNU General Public License |
---|
102 | $href%http://www.opensource.org/licenses/AGPL-3.0%GPL-3.0%$$. |
---|
103 | Testing and installation is supported for Unix, Microsoft, and Apple |
---|
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/mul_level_ode.cpp/$$ for a more realistic example. |
---|
132 | To this end, CppAD can also be used with other AD types; for example see |
---|
133 | $cref/mul_level_adolc_ode.cpp/$$. |
---|
134 | |
---|
135 | $lnext |
---|
136 | A set of programs for doing $cref/speed/$$ comparisons between |
---|
137 | $href%https://projects.coin-or.org/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/testvector/$$ |
---|
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 $cref preprocessor$$ symbols used by CppAD begin with eight |
---|
187 | $code CppAD$$ or $code CPPAD_$$. |
---|
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/install.omh% |
---|
216 | omh/introduction.omh% |
---|
217 | cppad/local/user_ad.hpp% |
---|
218 | cppad/local/ad_fun.hpp% |
---|
219 | omh/preprocessor.omh% |
---|
220 | omh/multi_thread.omh% |
---|
221 | omh/library.omh% |
---|
222 | cppad/ipopt/solve.hpp% |
---|
223 | omh/example.omh% |
---|
224 | omh/speed/speed.omh% |
---|
225 | omh/appendix.omh |
---|
226 | %$$ |
---|
227 | |
---|
228 | $latex |
---|
229 | % -------------------------------------------------------------------- |
---|
230 | % Latex macros defined here and used throughout the CppAD documentation |
---|
231 | \newcommand{\W}[1]{ \; #1 \; } |
---|
232 | \newcommand{\R}[1]{ {\rm #1} } |
---|
233 | \newcommand{\B}[1]{ {\bf #1} } |
---|
234 | \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } |
---|
235 | \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } |
---|
236 | \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } |
---|
237 | \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} } |
---|
238 | $$ |
---|
239 | $comment ------------------------------------------------------------- |
---|
240 | hilite commands used throughout the CppAD documentation |
---|
241 | $$ |
---|
242 | $hilitecmd% |
---|
243 | verbatim% |
---|
244 | codep |
---|
245 | %$$ |
---|
246 | $hiliteseq% |
---|
247 | |
---|
248 | CppAD::%AD%<% AD |
---|
249 | % %AD%<% AD |
---|
250 | |
---|
251 | %CppAD::%ADFun%<% FunConstruct |
---|
252 | % %ADFun%<% FunConstruct |
---|
253 | |
---|
254 | % %CPPAD_TESTVECTOR%(% testvector |
---|
255 | |
---|
256 | %.%Forward%(% Forward |
---|
257 | |
---|
258 | %CppAD::%Independent%(% Independent |
---|
259 | % %Independent%(% Independent |
---|
260 | |
---|
261 | %.%Jacobian%(% Jacobian |
---|
262 | |
---|
263 | %CppAD::%NearEqual%(% NearEqual |
---|
264 | % %NearEqual%(% NearEqual |
---|
265 | |
---|
266 | %.%Reverse%(% Reverse |
---|
267 | %$$ |
---|
268 | |
---|
269 | $end |
---|