我在编译代码时遇到了一些问题。由于错误 C2719,有几个函数无法编译 - 带有 __declspec(align('16')) 的形式参数不会对齐。
VisualStudio 无法编译的函数是这样的
Eigen::Matrix2d AlgorithmBase::ReverseTransform(Eigen::Vector2d point, Eigen::Vector2d *translation, Eigen::Matrix2d *scaling, double phi, Eigen::Matrix2d *share)
{
Eigen::Matrix2d reversedScaling;
reversedScaling(0,0) = 1/(*scaling)(0,0);
reversedScaling(0,1) = reversedScaling(1,0) = 0;
reversedScaling(1,1) = 1/(*scaling)(1,1);
Eigen::MatrixXd newTranslation = -1**translation;
return MatrixHelper::CreateRotationMatrix(-phi)* *scaling*point + newTranslation;
}
void TemplateClusterBase::SetScalingMatrix( Eigen::Matrix2d matrix )
{
if(matrix.rows() == 1 || matrix.cols()==1)
{
this->scalingMatrix = MatrixHelper::CreateScalingMatrix(matrix(0,0));
}
else
{
this->scalingMatrix = matrix;
}
}
这很奇怪,因为之前我使用的是 MatrixXd 而不是 Vector2d 和 Matrix2d 并且一切都很好。更重要的是,这是使用 stl:vector 时的常见问题 - 但是正如您所看到的,此函数不会将 stl:vector 作为参数。
我能做些什么来解决这个问题?