Eigen
3.3.90 (git rev a8fdcae55d1f002966fc9b963597a404f30baa09)

Determines whether the given binary operation of two numeric types is allowed and what the scalar return type is.
This class permits to control the scalar return type of any binary operation performed on two different scalar types through (partial) template specializations.
For instance, let U1
, U2
and U3
be three user defined scalar types for which most operations between instances of U1
and U2
returns an U3
. You can let Eigen knows that by defining:
You can then explicitly disable some particular operations to get more explicit error messages:
Or customize the return type for individual operation:
By default, the following generic combinations are supported:
ScalarA  ScalarB  BinaryOp  ReturnType  Note 

T  T  *  T  
NumTraits<T>::Real  T  *  T  Only if NumTraits<T>::IsComplex 
T  NumTraits<T>::Real  *  T  Only if NumTraits<T>::IsComplex 