This forum has been archived. All content is frozen. Please use KDE Discuss instead.

normalize and coeffRef stopped working

Tags: None
(comma "," separated)
zoharl
Registered Member
Posts
55
Karma
0
OS
Hi,

I updated to the new version (3.2.1 => 3.3.1) and I get the following errors (VS2013) compiling the following code:

Code: Select all
Vector3d n;
n.normalize();
SparseMatrix<double> L;
L.coeffRef(0,0) = 0;


Code: Select all
1>------ Build started: Project: ArapDef, Configuration: Release x64 ------
1>Build started 14/12/16 9:17:59 a.m..
1>InitializeBuildStatus:
1>  Touching "x64\Release\ArapDef.tlog\unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>  param_proxy.cpp
1>  tri_def_lg.cpp
1>c:\prj-external-libs\eigen-eigen\eigen\src/Core/CoreEvaluators.h(347): error C2064: term does not evaluate to a function taking 2 arguments (..\param_proxy.cpp)
1>          class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/CoreEvaluators.h(484) : see reference to function template instantiation 'Scalar Eigen::internal::nullary_wrapper<Scalar,NullaryOp,true,true,true>::operator ()<IndexType>(const NullaryOp &,IndexType,IndexType) const' being compiled
1>          with
1>          [
1>              Scalar=double
1>  ,            NullaryOp=Eigen::internal::scalar_constant_op<double>
1>  ,            IndexType=Eigen::Index
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/CoreEvaluators.h(484) : see reference to function template instantiation 'Scalar Eigen::internal::nullary_wrapper<Scalar,NullaryOp,true,true,true>::operator ()<IndexType>(const NullaryOp &,IndexType,IndexType) const' being compiled
1>          with
1>          [
1>              Scalar=double
1>  ,            NullaryOp=Eigen::internal::scalar_constant_op<double>
1>  ,            IndexType=Eigen::Index
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(631) : see reference to function template instantiation 'double Eigen::internal::evaluator<SrcXprType>::coeff<Eigen::Index>(IndexType,IndexType) const' being compiled
1>          with
1>          [
1>              SrcXprType=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            IndexType=Eigen::Index
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(631) : see reference to function template instantiation 'double Eigen::internal::evaluator<SrcXprType>::coeff<Eigen::Index>(IndexType,IndexType) const' being compiled
1>          with
1>          [
1>              SrcXprType=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            IndexType=Eigen::Index
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(630) : while compiling class template member function 'void Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorType,SrcEvaluatorType,Functor,0>::assignCoeff(Eigen::Index,Eigen::Index)'
1>          with
1>          [
1>              Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(645) : see reference to function template instantiation 'void Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorType,SrcEvaluatorType,Functor,0>::assignCoeff(Eigen::Index,Eigen::Index)' being compiled
1>          with
1>          [
1>              Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(722) : see reference to class template instantiation 'Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorType,SrcEvaluatorType,Functor,0>' being compiled
1>          with
1>          [
1>              Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(862) : see reference to function template instantiation 'void Eigen::internal::call_dense_assignment_loop<DstXprType,SrcXprType,Functor>(DstXprType &,const SrcXprType &,const Functor &)' being compiled
1>          with
1>          [
1>              DstXprType=ActualDstTypeCleaned
1>  ,            SrcXprType=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(857) : while compiling class template member function 'void Eigen::internal::Assignment<ActualDstTypeCleaned,Src,Func,Eigen::internal::AssignmentKind<Eigen::DenseShape,Eigen::DenseShape>::Kind,void>::run(DstXprType &,const SrcXprType &,const Functor &)'
1>          with
1>          [
1>              Src=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Func=Eigen::internal::div_assign_op<double,double>
1>  ,            DstXprType=ActualDstTypeCleaned
1>  ,            SrcXprType=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(819) : see reference to function template instantiation 'void Eigen::internal::Assignment<ActualDstTypeCleaned,Src,Func,Eigen::internal::AssignmentKind<Eigen::DenseShape,Eigen::DenseShape>::Kind,void>::run(DstXprType &,const SrcXprType &,const Functor &)' being compiled
1>          with
1>          [
1>              Src=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Func=Eigen::internal::div_assign_op<double,double>
1>  ,            DstXprType=ActualDstTypeCleaned
1>  ,            SrcXprType=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Functor=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(819) : see reference to class template instantiation 'Eigen::internal::Assignment<ActualDstTypeCleaned,Src,Func,Eigen::internal::AssignmentKind<Eigen::DenseShape,Eigen::DenseShape>::Kind,void>' being compiled
1>          with
1>          [
1>              Src=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Func=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/AssignEvaluator.h(787) : see reference to function template instantiation 'void Eigen::internal::call_assignment_no_alias<Dst,Src,Func>(Dst &,const Src &,const Func &)' being compiled
1>          with
1>          [
1>              Dst=Eigen::Matrix<double,3,1,0,3,1>
1>  ,            Src=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Func=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/SelfCwiseBinaryOp.h(45) : see reference to function template instantiation 'void Eigen::internal::call_assignment<Derived,Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>,Eigen::internal::div_assign_op<double,double>>(Dst &,const Src &,const Func &,void *)' being compiled
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>  ,            Dst=Eigen::Matrix<double,3,1,0,3,1>
1>  ,            Src=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>,Eigen::Matrix<double,3,1,0,3,1>>
1>  ,            Func=Eigen::internal::div_assign_op<double,double>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/SelfCwiseBinaryOp.h(43) : while compiling class template member function 'Eigen::Matrix<double,3,1,0,3,1> &Eigen::DenseBase<Derived>::operator /=(const double &)'
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/Dot.h(146) : see reference to function template instantiation 'Eigen::Matrix<double,3,1,0,3,1> &Eigen::DenseBase<Derived>::operator /=(const double &)' being compiled
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/Dot.h(142) : while compiling class template member function 'void Eigen::MatrixBase<Derived>::normalize(void)'
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>          ]
1>          ..\param_proxy.cpp(97) : see reference to function template instantiation 'void Eigen::MatrixBase<Derived>::normalize(void)' being compiled
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/PlainObjectBase.h(94) : see reference to class template instantiation 'Eigen::MatrixBase<Derived>' being compiled
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,1,0,3,1>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/Matrix.h(180) : see reference to class template instantiation 'Eigen::PlainObjectBase<Eigen::Matrix<double,3,1,0,3,1>>' being compiled
1>          c:\prj\arap_deform\../shared/boost_utils.h(68) : see reference to class template instantiation 'Eigen::Matrix<double,3,1,0,3,1>' being compiled
1>c:\prj-external-libs\eigen-eigen\eigen\src/Core/DenseCoeffsBase.h(141): error C2338: THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS (..\tri_def_lg.cpp)
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/DenseCoeffsBase.h(140) : while compiling class template member function 'int Eigen::DenseCoeffsBase<Derived,0>::coeff(Eigen::EigenBase<Derived>::Index) const'
1>          with
1>          [
1>              Derived=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/DenseCoeffsBase.h(163) : see reference to function template instantiation 'int Eigen::DenseCoeffsBase<Derived,0>::coeff(Eigen::EigenBase<Derived>::Index) const' being compiled
1>          with
1>          [
1>              Derived=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/DenseBase.h(47) : see reference to class template instantiation 'Eigen::DenseCoeffsBase<Derived,0>' being compiled
1>          with
1>          [
1>              Derived=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/ArrayBase.h(41) : see reference to class template instantiation 'Eigen::DenseBase<Derived>' being compiled
1>          with
1>          [
1>              Derived=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/Core/CwiseNullaryOp.h(60) : see reference to class template instantiation 'Eigen::ArrayBase<Derived>' being compiled
1>          with
1>          [
1>              Derived=Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/SparseCore/SparseMatrix.h(1238) : see reference to class template instantiation 'Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<int>,Eigen::Array<int,-1,1,0,-1,1>>' being compiled
1>          c:\prj-external-libs\eigen-eigen\eigen\src/SparseCore/SparseMatrix.h(1126) : while compiling class template member function 'double &Eigen::SparseMatrix<double,0,int>::insert(Eigen::EigenBase<Derived>::Index,Eigen::EigenBase<Derived>::Index)'
1>          with
1>          [
1>              Derived=Eigen::SparseMatrix<double,0,int>
1>          ]
1>          c:\prj-external-libs\eigen-eigen\eigen\src/SparseCore/SparseMatrix.h(213) : see reference to function template instantiation 'double &Eigen::SparseMatrix<double,0,int>::insert(Eigen::EigenBase<Derived>::Index,Eigen::EigenBase<Derived>::Index)' being compiled
1>          with
1>          [
1>              Derived=Eigen::SparseMatrix<double,0,int>
1>          ]
1>          ..\tri_def_lg.cpp(282) : see reference to class template instantiation 'Eigen::SparseMatrix<double,0,int>' being compiled
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:07.08
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm, the errors must come from somewhere else. Please post a selfcontained example. The following one compiles just fine:

Code: Select all
#include <Eigen/Sparse>
using namespace Eigen;

int main()
{
  Vector3d n;
  n.normalize();
  SparseMatrix<double> L;
  L.coeffRef(0,0) = 0;
}
zoharl
Registered Member
Posts
55
Karma
0
OS
A small example to reproduce the errors:


// cl -IC:\prj-external-libs\eigen-eigen -Ic:\prj-external-libs\boost_1_57\ -Ic:\prj-external-libs\CGAL\include\ -Ic:\prj-external-libs\CGAL\build\include\ test.cpp /MD

Code: Select all
#include <Eigen/Sparse>
using namespace Eigen;
int main()
{
   Vector3d n;
   n.normalize();
   SparseMatrix<double> L;
   L.coeffRef(0, 0) = 0;
}

#include <boost/numeric/ublas/matrix.hpp>

#include <cgal/basic.h>

using namespace boost;
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You should never include headers after a using namespace.
zoharl
Registered Member
Posts
55
Karma
0
OS
Same error:

Code: Select all
// Build command: cl /MD -IC:\prj-external-libs\eigen-eigen -Ic:\prj-external-libs\boost_1_57\ -Ic:\prj-external-libs\CGAL\include\ -Ic:\prj-external-libs\CGAL\build\include\ test.cpp
// Libraries version: cgal4.9, boost1.57, eigen3.3.1

#include <boost/numeric/ublas/matrix.hpp>
#include <cgal/basic.h>
#include <Eigen/Sparse>

using namespace Eigen;
using namespace boost;

int main()
{
   Vector3d n;
   n.normalize();
   SparseMatrix<double> L;
   L.coeffRef(0, 0) = 0;
}
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Then it's really a MSVC bug, and there is nothing we can do on our side. You might try to upgrade to "MSVC2013 update 5" or removing the using namespaces if that does the trick.
zoharl
Registered Member
Posts
55
Karma
0
OS
Okay, I removed the using namespace boost for now.
Thanks


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]