CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
base_float.hpp
1#ifndef CPPAD_CG_BASE_FLOAT_INCLUDED
2#define CPPAD_CG_BASE_FLOAT_INCLUDED
3/* --------------------------------------------------------------------------
4 * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5 * Copyright (C) 2015 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
23template <>
24class numeric_limits<cg::CG<float> > {
25public:
26
27 static cg::CG<float> epsilon() {
28 return std::numeric_limits<float>::epsilon();
29 }
30
31 static cg::CG<float> min() {
32 return std::numeric_limits<float>::min();
33 }
34
35 static cg::CG<float> max() {
36 return std::numeric_limits<float>::max();
37 }
38
39 static cg::CG<float> quiet_NaN() {
40 return std::numeric_limits<float>::quiet_NaN();
41 }
42
43 static const int digits10
44 = std::numeric_limits<float>::digits10;
45};
46
50template <>
51inline cg::CG<float> epsilon<cg::CG<float> >() {
52 return std::numeric_limits<float>::epsilon();
53}
54
59 const cg::CG<float>& right) {
60 cg::CG<float> zero(0.0);
61 if (left == zero)
62 return zero;
63 return left * right;
64}
65// CPPAD_AZMUL(cg::CG<float>)
66
67} // END CppAD namespace
68
69#endif
70
cg::CG< double > azmul(const cg::CG< double > &x, const cg::CG< double > &y)