本文整理汇总了C++中TMatrix::cols方法的典型用法代码示例。如果您正苦于以下问题:C++ TMatrix::cols方法的具体用法?C++ TMatrix::cols怎么用?C++ TMatrix::cols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMatrix
的用法示例。
在下文中一共展示了TMatrix::cols方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: minRectTest
void minRectTest(unsigned int N, const TMatrix & v) {
using namespace PointFunctions;
using namespace TestFunctions;
dumpPointsMatrixBinary("./MinAreaRectangleTest" + std::to_string(N) +".bin",v);
dumpPointsMatrix("./MinAreaRectangleTest"+ std::to_string(N) +".txt",v);
std::cout << "\n\nStart MinAreaRectangle Test "+ std::to_string(N) +"" << std::endl;
START_TIMER(start)
MinAreaRectangle c(v);
c.compute();
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " <<v.cols() << " points" << std::endl;
std::cout << "End MinAreaRectangle Test "+ std::to_string(N) +"" << std::endl;
auto rect = c.getMinRectangle();
Matrix2Dyn p(2,7);
p.col(0) = rect.m_p;
p.col(1) = rect.m_p + rect.m_u*rect.m_uL ;
p.col(2) = rect.m_p + rect.m_u*rect.m_uL + rect.m_v*rect.m_vL ;
p.col(3) = rect.m_p + rect.m_v*rect.m_vL ;
p.col(4) = rect.m_p;
p.col(5) = rect.m_u;
p.col(6) = rect.m_v;
dumpPointsMatrixBinary("./MinAreaRectangleTest"+ std::to_string(N) +"Out.bin",p);
dumpPointsMatrix("./MinAreaRectangleTest"+ std::to_string(N) +"Out.txt",p);
}
示例2: minRectTest
void minRectTest(std::string name, const TMatrix & v) {
using namespace PointFunctions;
using namespace TestFunctions;
dumpPointsMatrixBinary( getPointsDumpPath(name,".bin") ,v);
dumpPointsMatrix( getPointsDumpPath(name,".txt"),v);
std::cout << "\n\nStart MinAreaRectangle Test "+ name +"" << std::endl;
START_TIMER(start)
MinAreaRectangle c(v);
c.compute();
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " <<v.cols() << " points" << std::endl;
std::cout << "End MinAreaRectangle Test "+ name +"" << std::endl;
auto rect = c.getMinRectangle();
Matrix2Dyn p(2,6);
p.col(0) = rect.m_p;
p.col(1) = rect.m_p + rect.m_u*rect.m_uL ;
p.col(2) = rect.m_p + rect.m_u*rect.m_uL + rect.m_v*rect.m_vL ;
p.col(3) = rect.m_p + rect.m_v*rect.m_vL ;
p.col(4) = rect.m_u;
p.col(5) = rect.m_v;
dumpPointsMatrixBinary(getFileOutPath(name) ,p);
//dumpPointsMatrix(getFileOutPath(name,".txt"),p);
// Compare with validation file
TMatrix valid = p;
valid.setConstant(std::numeric_limits<PREC>::signaling_NaN());
readPointsMatrixBinary( getFileValidationPath(name) , valid);
// Assert all cols of p are in valid
EXPECT_TRUE( assertNearArrayColsRows<true>(p.leftCols(4),valid.leftCols(4)) ) << "Valid Points:" << std::endl << valid.transpose()
<< std::endl << " computed:" << std::endl << p.transpose() << std::endl;
}