This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1351

Summary: Matrix::setRandom() error: no matching function for call to 'Eigen::internal::scalar_random_op<double>::operator()(int, int) const'
Product: Eigen Reporter: Angelos Mantzaflaris <Angelos.Mantzaflaris>
Component: Core - generalAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Compilation Problem CC: chtz, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: x86 - general   
OS: All   
Whiteboard:

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/
Comment 2 Nobody 2019-12-04 16:32:53 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/1351.