本文整理汇总了C++中matrix::Get_Dimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ matrix::Get_Dimensions方法的具体用法?C++ matrix::Get_Dimensions怎么用?C++ matrix::Get_Dimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matrix
的用法示例。
在下文中一共展示了matrix::Get_Dimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isfinite
/*
* You can use GPU for that
* */
void
Transform_Cloud ( matrix <Point_XYZI> & In_Cloud,
matrix <Point_XYZI> & Out_Cloud,
Eigen::Affine3f & Transform )
{
if ( & In_Cloud != & Out_Cloud )
Out_Cloud.Set_Dimensions ( In_Cloud.Get_Dimensions() );
// Dataset might contain NaNs and Infs, so check for them first,
// otherwise we get errors during the multiplication (?)
for (size_t i = 0; i < In_Cloud.Get_Num_Of_Elem (); ++i) {
XYZI cur_point = In_Cloud.data[i];
if ( ! isfinite (cur_point.x) ||
! isfinite (cur_point.y) ||
! isfinite (cur_point.z) )
continue;
// FIXME - rewrite -
// too complex
// use SSE ???
Eigen::Matrix<float, 3, 1> pt ( cur_point.x, cur_point.y, cur_point.z );
XYZI result;
result.x = static_cast<float> (Transform (0, 0) * pt.coeffRef (0) + Transform (0, 1) * pt.coeffRef (1) + Transform (0, 2) * pt.coeffRef (2) + Transform (0, 3));
result.y = static_cast<float> (Transform (1, 0) * pt.coeffRef (0) + Transform (1, 1) * pt.coeffRef (1) + Transform (1, 2) * pt.coeffRef (2) + Transform (1, 3));
result.z = static_cast<float> (Transform (2, 0) * pt.coeffRef (0) + Transform (2, 1) * pt.coeffRef (1) + Transform (2, 2) * pt.coeffRef (2) + Transform (2, 3));
result.w = cur_point.w;
Out_Cloud.data[i] = result;
}
}