本文整理汇总了C++中SparseMat::rowdim方法的典型用法代码示例。如果您正苦于以下问题:C++ SparseMat::rowdim方法的具体用法?C++ SparseMat::rowdim怎么用?C++ SparseMat::rowdim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparseMat
的用法示例。
在下文中一共展示了SparseMat::rowdim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testMatrixUtils
void testMatrixUtils(const Ring& R, const SparseMat& A)
{
Context<Ring> ctx (R);
std::ostream &report = commentator.report(Commentator::LEVEL_NORMAL, INTERNAL_DESCRIPTION);
typedef SparseBlocMatrix<ContiguousBloc<typename Ring::Element, uint16> > Matrix;
commentator.start("TESTING ArrangementTopDown_LeftRight", "ArrangementTopDown_LeftRight");
{
Matrix M0(A.rowdim(), A.coldim(), Matrix::ArrangementTopDown_LeftRight);
SparseMatrix<typename Ring::Element> C(A.rowdim(), A.coldim());
report << " BLOC HEIGHT" << M0.bloc_height () << endl;
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(A, M0);
commentator.stop(MSG_DONE);
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(M0, C);
commentator.stop(MSG_DONE);
//MatrixUtil::dumpMatrixAsPbmImage(A, "A.pbm");
//MatrixUtil::dumpMatrixAsPbmImage(C, "C.pbm");
report << endl;
if(BLAS3::equal(ctx, A, C))
report << "<<<<<<<<<<<<<<<<<<<<<<<<<<<RESULT OK>>>>>>>>>>>>>>>>>>>>>>>>";
else
report << ">>>>>>>>>>>>>>>>>>>>>>>>>>>RESULT WRONG<<<<<<<<<<<<<<<<<<<<<";
report << endl;
MatrixUtils::show_mem_usage("ArrangementTopDown_LeftRight");
}
commentator.stop("ArrangementTopDown_LeftRight");
commentator.start("TESTING ArrangementDownTop_LeftRight", "ArrangementDownTop_LeftRight");
{
Matrix M0(A.rowdim(), A.coldim(), Matrix::ArrangementDownTop_LeftRight);
SparseMatrix<typename Ring::Element> C(A.rowdim(), A.coldim());
report << " BLOC HEIGHT" << M0.bloc_height () << endl;
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(A, M0);
commentator.stop(MSG_DONE);
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(M0, C);
commentator.stop(MSG_DONE);
//MatrixUtil::dumpMatrixAsPbmImage(A, "A.pbm");
//MatrixUtil::dumpMatrixAsPbmImage(C, "C.pbm");
report << endl;
if(BLAS3::equal(ctx, A, C))
report << "<<<<<<<<<<<<<<<<<<<<<<<<<<<RESULT OK>>>>>>>>>>>>>>>>>>>>>>>>";
else
report << ">>>>>>>>>>>>>>>>>>>>>>>>>>>RESULT WRONG<<<<<<<<<<<<<<<<<<<<<";
report << endl;
MatrixUtils::show_mem_usage("ArrangementDownTop_LeftRight");
}
commentator.stop("ArrangementDownTop_LeftRight");
commentator.start("TESTING ArrangementDownTop_RightLeft", "ArrangementDownTop_RightLeft");
{
Matrix M0(A.rowdim(), A.coldim(), Matrix::ArrangementDownTop_RightLeft);
SparseMatrix<typename Ring::Element> C(A.rowdim(), A.coldim());
report << " BLOC HEIGHT" << M0.bloc_height () << endl;
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(A, M0);
commentator.stop(MSG_DONE);
commentator.start("Copy SparseMatrix => SparseBlocMatrix");
MatrixUtils::copy(M0, C);
commentator.stop(MSG_DONE);
//MatrixUtil::dumpMatrixAsPbmImage(A, "A.pbm");
//MatrixUtil::dumpMatrixAsPbmImage(C, "C.pbm");
report << endl;
if(BLAS3::equal(ctx, A, C))
report << "<<<<<<<<<<<<<<<<<<<<<<<<<<<RESULT OK>>>>>>>>>>>>>>>>>>>>>>>>";
else
report << ">>>>>>>>>>>>>>>>>>>>>>>>>>>RESULT WRONG<<<<<<<<<<<<<<<<<<<<<";
report << endl;
MatrixUtils::show_mem_usage("ArrangementDownTop_RightLeft");
}
commentator.stop("ArrangementDownTop_RightLeft");
}