aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-11-06 11:23:18 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-11-06 11:23:18 +0100
commit771c0507fbeefaa6498eae58efd3835eae6c2dc9 (patch)
tree4488e1d6368e288716c881d069df7a67ffc87233 /Eigen
parent1470afda5bc70b0fccde57bb680e5aac4c227c18 (diff)
back out previous back out, and this time don't forget
to include the NumTraits.h file in the commit ;)
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/Functors.h6
-rw-r--r--Eigen/src/Core/NumTraits.h7
2 files changed, 10 insertions, 3 deletions
diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h
index cbaeb83e2..ef4485f5b 100644
--- a/Eigen/src/Core/Functors.h
+++ b/Eigen/src/Core/Functors.h
@@ -350,7 +350,7 @@ struct ei_scalar_multiple_op {
EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a * m_other; }
EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const
{ return ei_pmul(a, ei_pset1(m_other)); }
- const Scalar m_other;
+ const typename NumTraits<Scalar>::Nested m_other;
private:
ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&);
};
@@ -364,7 +364,7 @@ struct ei_scalar_multiple2_op {
EIGEN_STRONG_INLINE ei_scalar_multiple2_op(const ei_scalar_multiple2_op& other) : m_other(other.m_other) { }
EIGEN_STRONG_INLINE ei_scalar_multiple2_op(const Scalar2& other) : m_other(other) { }
EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; }
- const Scalar2 m_other;
+ const typename NumTraits<Scalar2>::Nested m_other;
};
template<typename Scalar1,typename Scalar2>
struct ei_functor_traits<ei_scalar_multiple2_op<Scalar1,Scalar2> >
@@ -393,7 +393,7 @@ struct ei_scalar_quotient1_impl<Scalar,false> {
EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const ei_scalar_quotient1_impl& other) : m_other(other.m_other) { }
EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {}
EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; }
- const Scalar m_other;
+ const typename NumTraits<Scalar>::Nested m_other;
};
template<typename Scalar>
struct ei_functor_traits<ei_scalar_quotient1_impl<Scalar,false> >
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h
index 24afe54c5..304e2c1d6 100644
--- a/Eigen/src/Core/NumTraits.h
+++ b/Eigen/src/Core/NumTraits.h
@@ -52,6 +52,7 @@ template<> struct NumTraits<int>
{
typedef int Real;
typedef double FloatingPoint;
+ typedef int Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 0,
@@ -65,6 +66,7 @@ template<> struct NumTraits<float>
{
typedef float Real;
typedef float FloatingPoint;
+ typedef float Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 1,
@@ -78,6 +80,7 @@ template<> struct NumTraits<double>
{
typedef double Real;
typedef double FloatingPoint;
+ typedef double Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 1,
@@ -91,6 +94,7 @@ template<typename _Real> struct NumTraits<std::complex<_Real> >
{
typedef _Real Real;
typedef std::complex<_Real> FloatingPoint;
+ typedef std::complex<_Real> Nested;
enum {
IsComplex = 1,
HasFloatingPoint = NumTraits<Real>::HasFloatingPoint,
@@ -104,6 +108,7 @@ template<> struct NumTraits<long long int>
{
typedef long long int Real;
typedef long double FloatingPoint;
+ typedef long long int Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 0,
@@ -117,6 +122,7 @@ template<> struct NumTraits<long double>
{
typedef long double Real;
typedef long double FloatingPoint;
+ typedef long double Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 1,
@@ -130,6 +136,7 @@ template<> struct NumTraits<bool>
{
typedef bool Real;
typedef float FloatingPoint;
+ typedef bool Nested;
enum {
IsComplex = 0,
HasFloatingPoint = 0,