CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
identical.hpp
1#ifndef CPPAD_CG_IDENTICAL_INCLUDED
2#define CPPAD_CG_IDENTICAL_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
18namespace CppAD {
19
20template<class Base>
21inline bool IdenticalPar(const CppAD::cg::CG<Base>& x) {
22 if (!x.isParameter()) {
23 return false; // its value may change after tapping
24 }
25 return CppAD::IdenticalPar(x.getValue());
26}
27
28template<class Base>
29inline bool IdenticalCon(const CppAD::cg::CG<Base>& x) {
30 if (!x.isParameter()) {
31 return false; // its value may change after tapping
32 }
33 return CppAD::IdenticalCon(x.getValue());
34}
35
36template<class Base>
37inline bool IdenticalZero(const CppAD::cg::CG<Base>& x) {
38 if (!x.isParameter()) {
39 return false; // its value may change after tapping
40 }
42}
43
44template<class Base>
45inline bool IdenticalOne(const CppAD::cg::CG<Base>& x) {
46 if (!x.isParameter()) {
47 return false; // its value may change after tapping
48 }
49 return CppAD::IdenticalOne(x.getValue());
50}
51
52template<class Base>
53inline bool IdenticalEqualPar(const CppAD::cg::CG<Base>& x,
54 const CppAD::cg::CG<Base>& y) {
55 return x.isParameter() && y.isParameter() && CppAD::IdenticalEqualPar(x.getValue(), y.getValue());
56}
57
58template<class Base>
59inline bool IdenticalEqualCon(const CppAD::cg::CG<Base>& x,
60 const CppAD::cg::CG<Base>& y) {
61 return x.isParameter() && y.isParameter() && CppAD::IdenticalEqualCon(x.getValue(), y.getValue());
62}
63
64} // END CppAD namespace
65
66#endif
const Base & getValue() const
Definition variable.hpp:45
bool isParameter() const
Definition variable.hpp:35
bool IdenticalOne(const cg::CG< Base > &x)
Definition identical.hpp:45
bool IdenticalZero(const cg::CG< Base > &x)
Definition identical.hpp:37
bool IdenticalPar(const cg::CG< Base > &x)
Definition identical.hpp:21