New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1260 - partial specialization before instantiation error in AutoDiffScalar.h
Summary: partial specialization before instantiation error in AutoDiffScalar.h
Alias: None
Product: Eigen
Classification: Unclassified
Component: Unsupported modules (show other bugs)
Version: 3.3 (current stable)
Hardware: x86 - 64-bit Linux
: Normal Compilation Problem
Assignee: Nobody
: 1262 1263 (view as bug list)
Depends on:
Reported: 2016-07-26 17:34 UTC by philip.avery
Modified: 2016-07-27 12:41 UTC (History)
4 users (show)


Description philip.avery 2016-07-26 17:34:27 UTC
With g++ 5.4 on ubuntu 16.04 I am having several errors compiling with the development branch, e.g.:
eigen/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h:382:8: error: partial specialization of ‘struct Eigen::ScalarBinaryOpTraits<Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, A_Scalar, BinOp>’ after instantiation of ‘struct Eigen::ScalarBinaryOpTraits<Eigen::Matrix<double, 3, 3>, double, Eigen::internal::scalar_product_op<Eigen::Matrix<double, 3, 3>, double> >’ [-fpermissive]
 struct ScalarBinaryOpTraits<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols>,A_Scalar,BinOp>

Removing the first two specializations of ScalarBinaryOpTraits in AutoDiffScalar.h eliminates the error but I'm not entirely sure if this is an appropriate solution or not.
Thank you!
Comment 1 Gael Guennebaud 2016-07-27 07:27:54 UTC
Could you post the line of code that triggers this issue? thanks.
Comment 2 Gael Guennebaud 2016-07-27 11:29:23 UTC
*** Bug 1262 has been marked as a duplicate of this bug. ***
Comment 3 Gael Guennebaud 2016-07-27 11:30:39 UTC
nevermind, bug 1263 provides a failing example:

#include "Eigen/Core"
#include "unsupported/Eigen/AutoDiff"

using namespace Eigen;

int main (int argc, char const *argv[])
  using Vec = Matrix<double, 5, 1>;
  using Mat = Matrix<double, 5, 5>;

  Mat leftEigenVectors, rightEigenVectors;
  Vec eigenValues, diffState, absAXDiff;

  absAXDiff = (rightEigenVectors * (eigenValues.asDiagonal() * (leftEigenVectors * diffState)));
Comment 4 Gael Guennebaud 2016-07-27 12:39:15 UTC
I cannot find any justifications for those two overloads, so let's remove them:
Summary:     Bug 1260: remove doubtful specializations of ScalarBinaryOpTraits
Comment 5 Gael Guennebaud 2016-07-27 12:41:15 UTC
*** Bug 1263 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.