New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1351 - Matrix::setRandom() error: no matching function for call to 'Eigen::internal::scalar_random_op<double>::operator()(int, int) const'
Matrix::setRandom() error: no matching function for call to 'Eigen::internal:...
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Core - general
3.3 (current stable)
x86 - general All
: Normal Compilation Problem
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-30 10:05 UTC by Angelos Mantzaflaris
Modified: 2016-11-30 16:39 UTC (History)
3 users (show)



Attachments

Description Angelos Mantzaflaris 2016-11-30 10:05:15 UTC
On Suse Linux Enterprise, using GNU 4.3.4, using the code:

Eigen::Matrix A(2,2);
A.setRandom() // or even A.setRandom(2,2)

with Eigen 3.3 release, the compilation fails with:

Eigen/src/Core/util/Meta.h:410: error: no matching function for call to 'Eigen::internal::scalar_random_op<double>::operator()(int, int) const'
Eigen/src/Core/Random.h:19: note: candidates are: const Scalar Eigen::internal::scalar_random_op<Scalar>::operator()() const [with Scalar = double]
Eigen/src/Core/util/Meta.h: In instantiation of 'Eigen::internal::has_unary_operator<Eigen::internal::scalar_random_op<double>, int>':
Eigen/src/Core/CoreEvaluators.h:510:   instantiated from 'Eigen::internal::evaluator<Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> > >'
Eigen/src/Core/AssignEvaluator.h:705:   instantiated from 'void Eigen::internal::call_dense_assignment_loop(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, SrcXprType = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >, Functor = Eigen::internal::assign_op<double, double>]'
Eigen/src/Core/AssignEvaluator.h:857:   instantiated from 'static void Eigen::internal::Assignment<DstXprType, SrcXprType, Functor, Eigen::internal::Dense2Dense, Weak>::run(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, SrcXprType = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >, Functor = Eigen::internal::assign_op<double, double>, Weak = void]'
Eigen/src/Core/AssignEvaluator.h:814:   instantiated from 'void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, Src = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >, Func = Eigen::internal::assign_op<double, double>]'
Eigen/src/Core/AssignEvaluator.h:782:   instantiated from 'void Eigen::internal::call_assignment(Dst&, const Src&, const Func&, typename Eigen::internal::enable_if<(! Eigen::internal::evaluator_assume_aliasing::value), void*>::type) [with Dst = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, Src = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >, Func = Eigen::internal::assign_op<double, double>]'
Eigen/src/Core/AssignEvaluator.h:760:   instantiated from 'void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, Src = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >]'
Eigen/src/Core/Assign.h:41:   instantiated from 'Derived& Eigen::DenseBase<Derived>::operator=(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::internal::scalar_random_op<double>, Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >, Derived = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>]'
Eigen/src/Core/Random.h:133:   instantiated from 'Derived& Eigen::DenseBase<Derived>::setRandom() [with Derived = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>]'
Eigen/src/Core/Random.h:177:   instantiated from 'Derived& Eigen::PlainObjectBase<Derived>::setRandom(Eigen::Index, Eigen::Index) [with Derived = Eigen::Matrix<double, -0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>]'
Eigen/src/Core/util/Meta.h:401: error: no matching function for call to 'Eigen::internal::scalar_random_op<double>::operator()(int) const'
Eigen/src/Core/Random.h:19: note: candidates are: const Scalar Eigen::internal::scalar_random_op<Scalar>::operator()() const [with Scalar = double]

I do not have direct access to this machine, the error appears when compiling my project in the OpenSuse build service, full log:
https://build.opensuse.org/public/build/home:filiatra/SLE_11_SP4/i586/gismo/_log
Comment 1 Gael Guennebaud 2016-11-30 16:39:21 UTC
https://bitbucket.org/eigen/eigen/commits/dbd04c842b99/
Summary:     Bug 1351: fix compilation of random with old compilers

3.3: https://bitbucket.org/eigen/eigen/commits/4bef46200ab9/

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