本文整理汇总了C++中PointType::norm方法的典型用法代码示例。如果您正苦于以下问题:C++ PointType::norm方法的具体用法?C++ PointType::norm怎么用?C++ PointType::norm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointType
的用法示例。
在下文中一共展示了PointType::norm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testNorms
bool testNorms()
{
typedef PointVector<3, int> PointType;
PointType aPoint;
aPoint.at ( 2 ) = 2;
aPoint.at ( 1 ) = -1;
aPoint.at ( 0 ) = 3;
trace.beginBlock ( "Test of Norms" );
trace.info() << "aPoint l_2 norm="<<aPoint.norm() <<endl;
trace.info() << "aPoint l_1 norm="<<aPoint.norm ( PointType::L_1 ) <<endl;
trace.info() << "aPoint l_infty norm="<<aPoint.norm ( PointType::L_infty ) <<endl;
trace.endBlock();
return ( ( aPoint.norm ( PointType::L_1 ) == 6 ) &&
( aPoint.norm ( PointType::L_infty ) == 3 ) );
}
示例2: calculateNeigDis
void GraphNodeCtr::calculateNeigDis(Matrix3X & neigCoor,VecX& resDis)
{
IndexType vtx_num = neigCoor.cols();
PointType ori = neigCoor.col(0);
PointType diff;
diff.setZero();
for (IndexType vtx_iter = 1; vtx_iter < vtx_num;vtx_iter ++)
{
diff = neigCoor.col(vtx_iter) - ori;
resDis(vtx_iter,0) = diff.norm();
}
}