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


C++ SparseMat::rowdim方法代码示例

本文整理汇总了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");
}
开发者ID:ederc,项目名称:LELA,代码行数:91,代码来源:test-FG-bloc.C


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