示例#1
0
void stressTest (Blackbox & A)
{
	//Note that the rowdim/coldim of A must be 30000
	typedef typename Blackbox::MatrixDomain Dom;
	typedef typename Dom::Block Block;

	Dom MD = A.domain();
	size_t m = 30000;
	size_t n = 2000;

	LinBox::UserTimer timer;

	Block B(m,n), C(m,n);
	MD.random(B);

	cout << "Test: 30000x30000 matrix multiplied by 30000x2000 matrix\nblock size = 2048\n\n";

	timer.clear(); timer.start();
	A.unpackingApply(C,B,2048);
	timer.stop();
	cout << "unpacking apply time: " << timer << endl;

	Block D(m,m); MD.random(D);

	timer.clear(); timer.start();
	MD.mul(C,D,B);
	timer.stop();
	cout << "domain mul time: " << timer << endl;

	cout << endl;
}  //end stressTest()
示例#2
0
void blockSizeTimingTest(Blackbox & A, size_t size)
{
	typedef typename Blackbox::MatrixDomain Dom;
	typedef typename Dom::Block Block;

	Dom MD = A.domain();
	size_t m = A.rowdim();

	LinBox::UserTimer timer;

	Block B(m,m), C(m,m), D(m,m);
	MD.random(B); MD.random(D);

	cout << size << "         " << m << "       ";

	timer.clear(); timer.start();
	A.unpackingApply(C,B,size);
	timer.stop();
	cout << timer << "              ";

	timer.clear(); timer.start();
	A.unpackingApplyTranspose(C,B,size);
	timer.stop();
	cout << timer << "               ";

	timer.clear(); timer.start();
	MD.mul(C,D,B);
	timer.stop();
	cout << timer << "     ";

	cout << endl;

} //blockSizeTimingTest()
示例#3
0
void largeTest (Blackbox & A)
{
	//Use for large blackboxes
	typedef typename Blackbox::MatrixDomain Dom;
	typedef typename Dom::Block Block;

	Dom MD = A.domain();
	size_t m = A.coldim();
	size_t n = 2000;

	LinBox::UserTimer timer;

	Block B(m,n), C(m,n);
	MD.random(B);

	cout << "Test: " << A.rowdim() << "x" << m << "blackbox multiplied by " << m << "x" << n << "block\nblock size: 2048\n\n";

	timer.clear(); timer.start();
	A.unpackingApply(C,B,2048);
	timer.stop();
	cout << "unpacking apply time: " << timer << endl;
}  //end largeTest