本文整理汇总了C++中Matrix3f::ReturnSymmetric方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3f::ReturnSymmetric方法的具体用法?C++ Matrix3f::ReturnSymmetric怎么用?C++ Matrix3f::ReturnSymmetric使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3f
的用法示例。
在下文中一共展示了Matrix3f::ReturnSymmetric方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: powerMaxEigenVec
void rectify::powerMaxEigenVec(Matrix3f inputMat, vector3d& outputVec)
{
Matrix3f symmetricFund;
inputMat = inputMat * 1e-20;
symmetricFund = inputMat.ReturnSymmetric(); //returned AtA
vector3d dummyMaxEigenVec;
vector3d output = vector3d(1.0, 0.0, 0.0);
//symmetricFund = symmetricFund * 1e-15;
int _size = 3;
bool powerRepeat = true;
float diag = 0.0;
int totalCounter = 0;
bool thresReached = false;
vector3d diff;
int counter;
//dummy eigenVecs for value comparision during iteration
while(powerRepeat)
{
//save maxEigenVec to dummy
dummyMaxEigenVec = output;
//do matrix multiplication
output = symmetricFund * dummyMaxEigenVec;
//find maximum value in eigenVec and make it 1
diag = output.x;
if(fabs(output.y) > fabs(diag)) diag = output.y;
if(fabs(output.z) > fabs(diag)) diag = output.z;
output /= diag;
//comparision for repitition of iteration
diff = dummyMaxEigenVec - output;
if(fabs(diff.x) < 0.00005 && fabs(diff.y) < 0.00005 && fabs(diff.z) < 0.00005) thresReached = true;
totalCounter++;
if(thresReached == true || totalCounter > 20) powerRepeat = false;
if(!powerRepeat)
{
output.Display("op");
output.Normalize();
outputVec = output;
if(totalCounter > 200){std::cout<<std::endl<<" power not converging "<<std::endl;}
}
}
}