CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
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 
18 namespace CppAD {
19 
23 CPPAD_NUMERIC_LIMITS(float, cg::CG<float>)
24 
25 
28 template <>
29 inline cg::CG<float> epsilon<cg::CG<float> >() {
30  return std::numeric_limits<float>::epsilon();
31 }
32 
36 inline cg::CG<float> azmul(const cg::CG<float>& left,
37  const cg::CG<float>& right) {
38  cg::CG<float> zero(0.0);
39  if (left == zero)
40  return zero;
41  return left * right;
42 }
43 // CPPAD_AZMUL(cg::CG<float>)
44 
45 } // END CppAD namespace
46 
47 #endif
48 
cg::CG< double > azmul(const cg::CG< double > &x, const cg::CG< double > &y)
Definition: base_double.hpp:36