CppADCodeGen
2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
declare_cg.hpp
1
#ifndef CPPAD_CG_DECLARE_CG_INCLUDED
2
#define CPPAD_CG_DECLARE_CG_INCLUDED
3
/* --------------------------------------------------------------------------
4
* CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5
* Copyright (C) 2012 Ciengis
6
*
7
* CppADCodeGen is distributed under multiple licenses:
8
*
9
* - Eclipse Public License Version 1.0 (EPL1), and
10
* - GNU General Public License Version 3 (GPL3).
11
*
12
* EPL1 terms and conditions can be found in the file "epl-v10.txt", while
13
* terms and conditions for the GPL3 can be found in the file "gpl3.txt".
14
* ----------------------------------------------------------------------------
15
* Author: Joao Leal
16
*/
17
18
// forward declarations
19
namespace
CppAD
{
20
21
template
<
class
Base>
22
class
vector
;
23
24
template
<
class
Base>
25
class
AD
;
26
27
template
<
class
Base,
class
RecBase>
28
class
ADFun
;
29
30
namespace
cg {
31
32
/***************************************************************************
33
* Atomics
34
**************************************************************************/
35
template
<
class
Base>
36
class
BaseAbstractAtomicFun;
37
38
template
<
class
Base>
39
class
CGAbstractAtomicFun;
40
41
template
<
class
Base>
42
class
CGAtomicFun;
43
44
template
<
class
Base>
45
class
AtomicUseInfo;
46
47
/***************************************************************************
48
* Core
49
**************************************************************************/
50
template
<
class
Base>
51
class
CodeHandler;
52
53
template
<
class
Base>
54
class
CodeHandlerVectorSync;
55
56
template
<
class
Base,
class
T>
57
class
CodeHandlerVector;
58
59
template
<
class
Base>
60
class
CG;
61
62
template
<
class
Base>
63
struct
OperationPathNode
;
64
65
template
<
class
Base>
66
class
PathNodeEdges
;
67
68
template
<
class
Base>
69
class
BidirGraph
;
70
71
template
<
class
Base>
72
class
ScopePathElement
;
73
74
/***************************************************************************
75
* Nodes
76
**************************************************************************/
77
template
<
class
Base>
78
class
OperationNode
;
79
80
template
<
class
Base>
81
class
IndexOperationNode
;
82
83
template
<
class
Base>
84
class
IndexAssignOperationNode
;
85
86
template
<
class
Base>
87
class
LoopStartOperationNode
;
88
89
template
<
class
Base>
90
class
LoopEndOperationNode
;
91
92
/***************************************************************************
93
* Loops
94
**************************************************************************/
95
template
<
class
Base>
96
class
EquationPattern
;
97
98
template
<
class
Base>
99
class
DependentPatternMatcher
;
100
101
template
<
class
Base>
102
class
Loop
;
103
104
template
<
class
Base>
105
class
LoopFreeModel
;
106
107
template
<
class
Base>
108
class
LoopModel
;
109
110
template
<
class
Base>
111
class
IndexedDependentLoopInfo
;
112
113
class
IndexPattern
;
114
class
LinearIndexPattern
;
115
class
Plane2DIndexPattern
;
116
class
RandomIndexPattern
;
117
class
SectionedIndexPattern
;
118
119
/***************************************************************************
120
* Languages
121
**************************************************************************/
122
template
<
class
Base>
123
class
LangStreamOperation
;
124
125
template
<
class
Base>
126
class
LanguageC
;
127
128
template
<
class
Base>
129
class
VariableNameGenerator
;
130
131
template
<
class
Base>
132
class
LangCDefaultVariableNameGenerator
;
133
134
template
<
class
Base>
135
class
LangCCustomVariableNameGenerator
;
136
137
/***************************************************************************
138
* Models
139
**************************************************************************/
140
template
<
class
Base>
141
class
GenericModel
;
142
143
template
<
class
Base>
144
class
ModelLibraryProcessor
;
145
146
template
<
class
Base>
147
class
FunctorGenericModel
;
148
149
/***************************************************************************
150
* Dynamic model compilation
151
**************************************************************************/
152
153
template
<
class
Base>
154
class
CCompiler
;
155
156
template
<
class
Base>
157
class
DynamicLib
;
158
159
template
<
class
Base>
160
class
ModelCSourceGen
;
161
162
template
<
class
Base>
163
class
ModelLibraryCSourceGen
;
164
165
#if CPPAD_CG_SYSTEM_LINUX
166
template
<
class
Base>
167
class
LinuxDynamicLibModel;
168
169
template
<
class
Base>
170
class
LinuxDynamicLib;
171
#endif
172
173
/***************************************************************************
174
* Index reduction classes
175
**************************************************************************/
176
template
<
class
Base>
177
class
Enode
;
178
179
template
<
class
Base>
180
class
Vnode
;
181
182
template
<
class
ScalarIn,
class
ScalarOut,
class
ActiveOut>
183
class
Evaluator
;
184
185
/***************************************************************************
186
* Utilities
187
**************************************************************************/
188
189
template
<
class
Base>
190
class
SmartVectorPointer
;
191
192
template
<
class
Base>
193
class
SmartListPointer
;
194
195
template
<
class
Key,
class
Value>
196
class
SmartMapValuePointer
;
197
198
template
<
class
Type>
199
class
ArrayView
;
200
201
template
<
class
Base>
202
inline
void
print(
const
Base& v);
203
204
template
<
class
Key,
class
Value>
205
inline
void
print(
const
std::map<Key, Value>& m);
206
207
template
<
class
Base>
208
inline
void
print(
const
std::set<Base>& s);
209
210
template
<
class
Base>
211
inline
void
print(
const
std::set<Base*>& s);
212
213
template
<
class
Base>
214
inline
void
print(
const
std::vector<Base>& v);
215
219
template
<
class
Base>
220
CG<Base>
operator+(
const
CG<Base>
& left,
const
CG<Base>
& right);
221
222
template
<
class
Base>
223
CG<Base>
operator-(
const
CG<Base>
& left,
const
CG<Base>
& right);
224
225
template
<
class
Base>
226
CG<Base>
operator*(
const
CG<Base>
& left,
const
CG<Base>
& right);
227
228
template
<
class
Base>
229
CG<Base>
operator/(
const
CG<Base>
& left,
const
CG<Base>
& right);
230
234
template
<
class
Base>
235
bool
operator==(
const
CG<Base>
& left,
const
CG<Base>
& right);
236
237
template
<
class
Base>
238
bool
operator!=(
const
CG<Base>
& left,
const
CG<Base>
& right);
239
240
template
<
class
Base>
241
bool
operator<(
const
CG<Base>
& left,
const
CG<Base>
& right);
242
243
template
<
class
Base>
244
bool
operator<=(
const
CG<Base>
& left,
const
CG<Base>
& right);
245
246
template
<
class
Base>
247
bool
operator>(
const
CG<Base>
& left,
const
CG<Base>
& right);
248
249
template
<
class
Base>
250
bool
operator>=(
const
CG<Base>
& left,
const
CG<Base>
& right);
251
252
template
<
class
Base>
253
bool
operator!=(
const
CG<Base>
& left,
double
right);
254
255
template
<
class
Base>
256
bool
operator==(
const
CG<Base>
& left,
const
Base& right);
257
258
template
<
class
Base>
259
bool
operator==(
const
Base& left,
const
CG<Base>
& right);
260
261
template
<
class
Base>
262
bool
operator!=(
const
CG<Base>
& left, Base right);
263
264
template
<
class
Base>
265
bool
operator!=(
const
Base& left,
const
CG<Base>
& right);
266
267
/***************************************************************************
268
* Index reduction functions
269
**************************************************************************/
270
271
template
<
class
Base>
272
inline
std::ostream& operator<<(std::ostream& os,
const
Enode<Base>
& i);
273
274
template
<
class
Base>
275
inline
std::ostream& operator<<(std::ostream& os,
const
Vnode<Base>
& j);
276
277
/***************************************************************************
278
* Enums
279
**************************************************************************/
280
284
enum class
Verbosity {
285
None, Low, High
286
};
287
291
enum class
JacobianADMode {
292
Forward, Reverse, Automatic
293
};
294
298
enum class
IndexPatternType {
299
Linear,
// y = (x / dx) * dy + b
300
Sectioned,
// several index patterns
301
Random1D,
302
Random2D,
303
Plane2D
// y = f(x) + f(z)
304
};
305
306
}
// END cg namespace
307
308
/***************************************************************************
309
*
310
**************************************************************************/
311
// order determining functions, see ordered.hpp
312
template
<
class
Base>
313
bool
GreaterThanZero
(
const
cg::CG<Base>& x);
314
315
template
<
class
Base>
316
bool
GreaterThanOrZero(
const
cg::CG<Base>& x);
317
318
template
<
class
Base>
319
bool
LessThanZero(
const
cg::CG<Base>& x);
320
321
template
<
class
Base>
322
bool
LessThanOrZero(
const
cg::CG<Base>& x);
323
324
template
<
class
Base>
325
bool
abs_geq(
const
cg::CG<Base>& x,
const
cg::CG<Base>& y);
326
327
// The identical property functions, see identical.hpp
331
template
<
class
Base>
332
inline
bool
IdenticalPar
(
const
cg::CG<Base>& x);
333
337
template
<
class
Base>
338
bool
IdenticalZero
(
const
cg::CG<Base>& x);
339
343
template
<
class
Base>
344
bool
IdenticalOne
(
const
cg::CG<Base>& x);
345
346
template
<
class
Base>
347
bool
IdenticalEqualPar(
const
cg::CG<Base>& x,
const
cg::CG<Base>& y);
348
349
// EqualOpSeq function
350
template
<
class
Base>
351
bool
EqualOpSeq(
const
cg::CG<Base>& u,
const
cg::CG<Base>& v);
352
353
// NearEqual function
354
template
<
class
Base>
355
bool
NearEqual(
const
cg::CG<Base>& x,
const
cg::CG<Base>& y,
const
Base& r,
const
Base& a);
356
357
template
<
class
Base>
358
bool
NearEqual(
const
Base& x,
const
cg::CG<Base>& y,
const
Base& r,
const
Base& a);
359
360
template
<
class
Base>
361
bool
NearEqual(
const
cg::CG<Base>& x,
const
Base& y,
const
Base& r,
const
Base& a);
362
363
template
<
class
Base>
364
inline
bool
isnan(
const
cg::CG<Base>& s);
365
366
template
<
class
Base>
367
int
Integer(
const
cg::CG<Base>& x);
368
369
template
<
class
Base>
370
cg::CG<Base>
CondExp
(cg::CGOpCode op,
371
const
cg::CG<Base>& left,
const
cg::CG<Base>& right,
372
const
cg::CG<Base>& trueCase,
const
cg::CG<Base>& falseCase,
373
bool
(*compare)(
const
Base&,
const
Base&));
374
378
template
<
class
Base>
379
inline
cg::CG<Base>
sign
(
const
cg::CG<Base>& x);
380
381
// power function
382
template
<
class
Base>
383
inline
cg::CG<Base>
pow
(
const
cg::CG<Base>& x,
const
cg::CG<Base>& y);
384
template
<
class
Base>
385
inline
cg::CG<Base>
pow
(
const
Base& x,
const
cg::CG<Base>& y);
386
template
<
class
Base>
387
inline
cg::CG<Base>
pow
(
const
cg::CG<Base>& x,
const
Base& y);
388
389
// absolute value
390
template
<
class
Base>
391
inline
cg::CG<Base> abs(
const
cg::CG<Base>& x);
392
393
template
<
class
Base>
394
inline
cg::CG<Base> fabs(
const
cg::CG<Base>& x);
395
396
// inverse cosine
397
template
<
class
Base>
398
inline
cg::CG<Base> acos(
const
cg::CG<Base>& x);
399
400
// inverse sine
401
template
<
class
Base>
402
inline
cg::CG<Base> asin(
const
cg::CG<Base>& x);
403
404
// inverse tangent
405
template
<
class
Base>
406
inline
cg::CG<Base> atan(
const
cg::CG<Base>& x);
407
408
// cosine
409
template
<
class
Base>
410
inline
cg::CG<Base> cos(
const
cg::CG<Base>& x);
411
412
// hyperbolic cosine
413
template
<
class
Base>
414
inline
cg::CG<Base> cosh(
const
cg::CG<Base>& x);
415
416
// exponential
417
template
<
class
Base>
418
inline
cg::CG<Base> exp(
const
cg::CG<Base>& x);
419
420
// natural logarithm
421
template
<
class
Base>
422
inline
cg::CG<Base> log(
const
cg::CG<Base>& x);
423
424
// sine
425
template
<
class
Base>
426
inline
cg::CG<Base> sin(
const
cg::CG<Base>& x);
427
428
// hyperbolic sine
429
template
<
class
Base>
430
inline
cg::CG<Base> sinh(
const
cg::CG<Base>& x);
431
432
// square root
433
template
<
class
Base>
434
inline
cg::CG<Base> sqrt(
const
cg::CG<Base>& x);
435
436
// tangent
437
template
<
class
Base>
438
inline
cg::CG<Base> tan(
const
cg::CG<Base>& x);
439
440
// hyperbolic tangent
441
template
<
class
Base>
442
inline
cg::CG<Base> tanh(
const
cg::CG<Base>& x);
443
444
#if CPPAD_USE_CPLUSPLUS_2011
445
448
// error function
449
template
<
class
Base>
450
inline
cg::CG<Base> erf(
const
cg::CG<Base>& x);
451
452
// complementary error function
453
template
<
class
Base>
454
inline
cg::CG<Base> erfc(
const
cg::CG<Base>& var);
455
456
// inverse hyperbolic sin
457
template
<
class
Base>
458
inline
cg::CG<Base> asinh(
const
cg::CG<Base>& x);
459
460
// inverse hyperbolic cosine
461
template
<
class
Base>
462
inline
cg::CG<Base> acosh(
const
cg::CG<Base>& x);
463
464
// inverse hyperbolic tangent
465
template
<
class
Base>
466
inline
cg::CG<Base> atanh(
const
cg::CG<Base>& x);
467
468
// exponential of x minus one
469
template
<
class
Base>
470
inline
cg::CG<Base> expm1(
const
cg::CG<Base>& x);
471
472
// logarithm of one plus x
473
template
<
class
Base>
474
inline
cg::CG<Base> log1p(
const
cg::CG<Base>& x);
475
#endif
476
477
}
// END CppAD namespace
478
482
#include <cppad/cg/declare_cg_loops.hpp>
483
484
#endif
485
CppAD::cg::FunctorGenericModel
Definition:
declare_cg.hpp:147
CppAD::sign
cg::CG< Base > sign(const cg::CG< Base > &x)
Definition:
math_other.hpp:74
CppAD::AD
Definition:
declare_cg.hpp:25
CppAD::cg::LangStreamOperation
Definition:
declare_cg.hpp:123
CppAD::cg::IndexPattern
Definition:
index_pattern.hpp:24
CppAD::cg::SmartMapValuePointer
Definition:
declare_cg.hpp:196
CppAD::cg::LoopEndOperationNode
Definition:
declare_cg.hpp:90
CppAD::cg::LoopStartOperationNode
Definition:
declare_cg.hpp:87
CppAD::vector
Definition:
declare_cg.hpp:22
CppAD::IdenticalPar
bool IdenticalPar(const cg::CG< Base > &x)
Definition:
identical.hpp:21
CppAD::cg::Enode
Definition:
bipartite_nodes.hpp:81
CppAD::cg::BidirGraph
Definition:
bidir_graph.hpp:35
CppAD::cg::VariableNameGenerator
Definition:
declare_cg.hpp:129
CppAD::cg::IndexOperationNode
Definition:
declare_cg.hpp:81
CppAD::cg::LinearIndexPattern
Definition:
linear_index_pattern.hpp:25
CppAD::cg::LanguageC
Definition:
declare_cg.hpp:126
CppAD::cg::SectionedIndexPattern
Definition:
sectioned_index_pattern.hpp:25
CppAD::GreaterThanZero
bool GreaterThanZero(const cg::CG< Base > &x)
Definition:
ordered.hpp:21
CppAD
Definition:
abstract_atomic_fun.hpp:19
CppAD::cg::SmartListPointer
Definition:
declare_cg.hpp:193
CppAD::IdenticalOne
bool IdenticalOne(const cg::CG< Base > &x)
Definition:
identical.hpp:45
CppAD::cg::GenericModel
Definition:
declare_cg.hpp:141
CppAD::cg::LangCDefaultVariableNameGenerator
Definition:
declare_cg.hpp:132
CppAD::cg::CG
Definition:
cg.hpp:29
CppAD::cg::ScopePathElement
Definition:
declare_cg.hpp:72
CppAD::cg::Evaluator
Definition:
declare_cg.hpp:183
CppAD::cg::ModelLibraryCSourceGen
Definition:
declare_cg.hpp:163
CppAD::cg::Loop
Definition:
declare_cg.hpp:102
CppAD::cg::ModelCSourceGen
Definition:
declare_cg.hpp:160
CppAD::cg::Vnode
Definition:
bipartite_nodes.hpp:75
CppAD::cg::ArrayView
Definition:
array_view.hpp:30
CppAD::IdenticalZero
bool IdenticalZero(const cg::CG< Base > &x)
Definition:
identical.hpp:37
CppAD::cg::ModelLibraryProcessor
Definition:
declare_cg.hpp:144
CppAD::CondExp
cg::CG< Base > CondExp(cg::CGOpCode op, const cg::CG< Base > &left, const cg::CG< Base > &right, const cg::CG< Base > &trueCase, const cg::CG< Base > &falseCase, bool(*compare)(const Base &, const Base &))
Definition:
cond_exp_op.hpp:80
CppAD::cg::DependentPatternMatcher
Definition:
declare_cg.hpp:99
CppAD::cg::IndexedDependentLoopInfo
Definition:
declare_cg.hpp:111
CppAD::cg::SmartVectorPointer
Definition:
declare_cg.hpp:190
CppAD::cg::LoopModel
Definition:
declare_cg.hpp:108
CppAD::cg::RandomIndexPattern
Definition:
random_index_pattern.hpp:25
CppAD::cg::IndexAssignOperationNode
Definition:
declare_cg.hpp:84
CppAD::cg::CCompiler
Definition:
declare_cg.hpp:154
CppAD::cg::OperationNode
Definition:
argument.hpp:22
CppAD::cg::EquationPattern
Definition:
declare_cg.hpp:96
CppAD::cg::LangCCustomVariableNameGenerator
Definition:
declare_cg.hpp:135
CppAD::cg::DynamicLib
Definition:
declare_cg.hpp:157
CppAD::cg::Plane2DIndexPattern
Definition:
plane_2d_index_pattern.hpp:28
CppAD::ADFun
Definition:
declare_cg.hpp:28
CppAD::cg::LoopFreeModel
Definition:
declare_cg.hpp:105
CppAD::cg::OperationPathNode
Definition:
declare_cg.hpp:63
CppAD::pow
cg::CG< Base > pow(const cg::CG< Base > &x, const cg::CG< Base > &y)
Definition:
math_other.hpp:21
CppAD::cg::PathNodeEdges
Definition:
bidir_graph.hpp:22
include
cppad
cg
declare_cg.hpp
Generated on Tue Jan 23 2024 13:46:33 for CppADCodeGen by
1.8.17