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

Strange Compiler error in VS2008 using Matrix

Tags: None
(comma "," separated)
alexdowson
Registered Member
Posts
4
Karma
0
Hi

I am new to eigen and trying to use it using Visual Studio 2008. I have taken the VectorXd as member variable in one class but compiler gives this error .

Any idea why ?


error C2039: 'YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR' : is not a member of 'Eigen::internal::static_assertion<condition>'
6> with
6> [
6> condition=false
6> ]
6> d:\work\quantum-1.1\core\itk\utilites\eigen-3.1.3\eigen\src/Core/CwiseNullaryOp.h(218) : while compiling class template member function 'const Eigen::CwiseNullaryOp<NullaryOp,PlainObjectType> Eigen::DenseBase<Derived>::Constant(const double &)'
6> with
6> [
6> NullaryOp=Eigen::internal::scalar_constant_op<double>,
6> PlainObjectType=Eigen::Array<double,-1,1>,
6> Derived=Eigen::Array<double,-1,1>
6> ]
6> d:\work\quantum-1.1\core\itk\utilites\eigen-3.1.3\eigen\src/Core/CwiseNullaryOp.h(598) : while compiling class template member function 'const Eigen::CwiseNullaryOp<NullaryOp,PlainObjectType> Eigen::DenseBase<Derived>::Ones(void)'
6> with
6> [
6> NullaryOp=Eigen::internal::scalar_constant_op<double>,
6> PlainObjectType=Eigen::Array<double,-1,1>,
6> Derived=Eigen::Array<double,-1,1>
alexdowson
Registered Member
Posts
4
Karma
0
My code looks like this


Code: Select all
class A
{

private:
VectorXd  m_Paramters;  // This causing the compiler error
}
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Your error must come from another line of code.
alexdowson
Registered Member
Posts
4
Karma
0
Hi

Yes i fixed the problem but still it is strange.

In class i initialized function like that.

m_Paramters = VectorXd(numberOfParameters);
m_Paramters.fill(0);

When i changed it to
m_Parameters = VectorXd::Zero(numberOfParameters);

Error gone but it doesn't producing error in every time.
In some classes first code is working I donot know why.

Alex


Bookmarks



Who is online

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