This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1260 - partial specialization before instantiation error in AutoDiffScalar.h
Summary: partial specialization before instantiation error in AutoDiffScalar.h
Status: RESOLVED FIXED
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
URL:
Whiteboard:
Keywords:
: 1262 1263 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-07-26 17:34 UTC by philip.avery
Modified: 2019-12-04 16:01 UTC (History)
4 users (show)



Attachments

Description philip.avery 2016-07-26 17:34:27 UTC
Hello,
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:

https://bitbucket.org/eigen/eigen/commits/815734e048fd/
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. ***
Comment 6 Nobody 2019-12-04 16:01:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1260.

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