1#ifndef CPPAD_CG_CPPADCG_EIGEN_INCLUDED
2#define CPPAD_CG_CPPADCG_EIGEN_INCLUDED
18# include <cppad/cg.hpp>
19# include <Eigen/Dense>
31template<
typename Base>
32struct NumTraits<
CppAD::cg::CG<Base> > {
50 RequireInitialization = 1 ,
62 return CppAD::numeric_limits<CppAD::cg::CG<Base> >
::epsilon();
70 return 100. * CppAD::numeric_limits<CppAD::cg::CG<Base> >
::epsilon();
77 return CppAD::numeric_limits<CppAD::cg::CG<Base> >::min();
84 return CppAD::numeric_limits<CppAD::cg::CG<Base> >::max();
91 return CppAD::numeric_limits<CppAD::cg::CG<Base> >
::digits10;
101template <
typename Base>
102struct NumTraits<
CppAD::AD<CppAD::cg::CG<Base> > > {
121 RequireInitialization = 1 ,
133 return CppAD::numeric_limits<CppAD::AD<CGBase> >
::epsilon();
141 return 100. * CppAD::numeric_limits<CppAD::AD<CGBase> >
::epsilon();
148 return CppAD::numeric_limits<CppAD::AD<CGBase> >::min();
155 return CppAD::numeric_limits<CppAD::AD<CGBase> >::max();
162 return CppAD::numeric_limits<CGBase>::digits10;
167#if EIGEN_VERSION_AT_LEAST(3,2,93)
173template<
typename Base,
typename BinOp>
174struct ScalarBinaryOpTraits<
CppAD::AD<CppAD::cg::CG<Base> >, Base, BinOp> {
178template<
typename Base,
typename BinOp>
179struct ScalarBinaryOpTraits<Base, CppAD::AD<CppAD::cg::CG<Base> >, BinOp> {
180 using ReturnType = CppAD::AD<CppAD::cg::CG<Base> >;
183template<
typename Base,
typename BinOp>
184struct ScalarBinaryOpTraits<CppAD::AD<CppAD::cg::CG<Base> >, CppAD::cg::CG<Base>, BinOp> {
185 using ReturnType = CppAD::AD<CppAD::cg::CG<Base> >;
188template<
typename Base,
typename BinOp>
189struct ScalarBinaryOpTraits<CppAD::cg::CG<Base>, CppAD::AD<CppAD::cg::CG<Base> >, BinOp> {
190 using ReturnType = CppAD::AD<CppAD::cg::CG<Base> >;
198template<
typename Base,
typename BinOp>
199struct ScalarBinaryOpTraits<CppAD::cg::CG<Base>, Base, BinOp> {
200 using ReturnType = CppAD::cg::CG<Base>;
203template<
typename Base,
typename BinOp>
204struct ScalarBinaryOpTraits<Base, CppAD::cg::CG<Base>, BinOp> {
205 using ReturnType = CppAD::cg::CG<Base>;
221const CppAD::AD<CppAD::cg::CG<Base> >& conj(
const CppAD::AD<CppAD::cg::CG<Base> >& x) {
226const CppAD::AD<CppAD::cg::CG<Base> >& real(
const CppAD::AD<CppAD::cg::CG<Base> >& x) {
232CppAD::AD<CppAD::cg::CG<Base> > imag(
const CppAD::AD<CppAD::cg::CG<Base> >& x) {
233 return CppAD::AD<CppAD::cg::CG<Base> >(0.);
237CppAD::AD<CppAD::cg::CG<Base> > abs2(
const CppAD::AD<CppAD::cg::CG<Base> >& x) {
247const CppAD::cg::CG<Base>& conj(
const CppAD::cg::CG<Base>& x) {
252const CppAD::cg::CG<Base>& real(
const CppAD::cg::CG<Base>& x) {
258CppAD::cg::CG<Base> imag(
const CppAD::cg::CG<Base>& x) {
259 return CppAD::cg::CG<Base>(0.);
263CppAD::cg::CG<Base> abs2(
const CppAD::cg::CG<Base>& x) {
static CppAD::AD< CGBase > dummy_precision()
static CppAD::AD< CGBase > highest()
static CppAD::AD< CGBase > epsilon()
static CppAD::AD< CGBase > lowest()
static CppAD::cg::CG< Base > highest()
static CppAD::cg::CG< Base > lowest()
static CppAD::cg::CG< Base > epsilon()
static CppAD::cg::CG< Base > dummy_precision()