void RelativeEulerAnglePcaDecoder::Encode(array_view<const DirectX::Quaternion> rots, VectorType & x)
{
	RelativeEulerAngleDecoder::Encode(rots, x);
	RowVectorXd dx = x.transpose().cast<double>();
	dx -= meanY;
	dx *= pcaY;
	x = dx.transpose().cast<float>();
}
double mahadist(const vtkMeshModel* model, vtkPoint targetPt, vtkPoint meanPt) {
    MatrixType cov = model->GetCovarianceAtPoint(meanPt, meanPt);
    int pointDim =3;
    VectorType x = VectorType::Zero(pointDim);
    for (unsigned d = 0; d < pointDim; d++) {
      x(d) = targetPt[d] - meanPt[d];
    }
    return x.transpose() * cov.inverse() * x;
}
void RelativeEulerAnglePcaDecoder::Decode(array_view<DirectX::Quaternion> rots, const VectorType & x)
{
	VectorType dy = (x.transpose().cast<double>() * invPcaY + meanY).cast<float>().transpose();
	RelativeEulerAngleDecoder::Decode(rots, dy);
}
示例#4
0
文件: eigen.hpp 项目: canesin/umintl
 static void syr2(std::size_t /*N*/, ScalarType const & alpha, VectorType const & x, VectorType const & y, MatrixType & A)
 { A+=alpha*x*y.transpose() + alpha*y*x.transpose(); }