当前位置: 首页>>代码示例>>C++>>正文


C++ TMatrix::cols方法代码示例

本文整理汇总了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);
    }
开发者ID:chen0510566,项目名称:ApproxMVBB,代码行数:30,代码来源:ComputeApproxMVBBTests.hpp

示例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;

    }
开发者ID:Maghoumi,项目名称:ApproxMVBB,代码行数:39,代码来源:main_minAreaRectangleTests.cpp


注:本文中的TMatrix::cols方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。