Loading...
Searching...
No Matches
field_eigen.h
Go to the documentation of this file.
#ifndef _RHEOLEF_FIELD_EIGEN_H
#define _RHEOLEF_FIELD_EIGEN_H
//
// customize the eigen library for accepting
// Array<field>
// Array<field,3>
//
// author: Pierre.Saramito@imag.fr
//
// date: 23 feb 2018
//
#include "rheolef/field.h"
#include "rheolef/compiler_eigen.h"
namespace Eigen {
template<class T, class M>
struct NumTraits <rheolef::field_basic<T,M> >
: NumTraits <typename rheolef::float_traits<T>::type> {
using NonInteger = T;
using Nested = T;
using Real = typename rheolef::float_traits<T>::type;
enum {
RequireInitialization = 1,
IsSigned = 1,
IsInteger = 0,
IsComplex = 0, // TODO: check it with some is_complex<T> traits
ReadCost = 1,
AddCost = 3,
MulCost = 3
};
};
template<class BinOp, class T, class M>
struct ScalarBinaryOpTraits <T, rheolef::field_basic<T,M>, BinOp> {
using ReturnType = rheolef::field_basic<T,M>;
};
template<class BinOp, class T, class M>
struct ScalarBinaryOpTraits <rheolef::field_basic<T,M>, T, BinOp> {
using ReturnType = rheolef::field_basic<T,M>;
};
} // namespace Eigen
#endif // _RHEOLEF_FIELD_EIGEN_H
rheolef::field_basic< T, M >
T
Expr1::float_type T
Definition field_expr.h:230
Eigen
Definition field_eigen.h:35
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
Eigen::NumTraits< rheolef::field_basic< T, M > >::Real
typename rheolef::float_traits< T >::type Real
Definition field_eigen.h:41
Eigen::NumTraits< rheolef::field_basic< T, M > >::NonInteger
T NonInteger
Definition field_eigen.h:39
Eigen::NumTraits< rheolef::field_basic< T, M > >::Nested
T Nested
Definition field_eigen.h:40
rheolef::float_traits::type
T type
Definition Float.h:94