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