示例#1
0
	def test1(self):
		'''
		Test transpose. 
		'''
		random.seed(13)
		m, n = 13, 123
		transA = True 
		sparsityA = 0.8
		protocolA = MatrixWrapper.RAW
		dfsDirA = None
		maxCoresA = 13
		maxTotalBlocks = 10
		# instantiate A
		A = randomSparseMatrix(n, m, sparsityA)
		Awrap = MatrixWrapper.wrapMatrix(A, protocolA, dfsDirA, maxCoresA)
		# norm 1
		val = dgemnrm1(disco, transA, m, n, Awrap, maxTotalBlocks)
		# validate
		self.validate(transA, A, val)
示例#2
0
	def test2(self):
		'''
		Test matrix with only zeros.
		'''
		random.seed(13)
		m, n = 12, 34
		transA = False
		sparsityA = 1.0
		protocolA = MatrixWrapper.RAW
		dfsDirA = None
		maxCoresA = 7 
		maxTotalBlocks = 5
		# instantiate A
		A = randomSparseMatrix(m, n, sparsityA)
		Awrap = MatrixWrapper.wrapMatrix(A, protocolA, dfsDirA, maxCoresA)
		# norm 1 
		val = dgemnrm1(disco, transA, m, n, Awrap, maxTotalBlocks)
		# validate
		self.validate(transA, A, val)
示例#3
0
	def test0(self):
		'''
		Test normal basic usage.
		'''
		random.seed(13)
		m, n = 12, 340
		transA = False
		sparsityA = 0.3
		protocolA = MatrixWrapper.RAW
		dfsDirA = None
		maxCoresA = 13
		maxTotalBlocks = 10
		# instantiate A
		A = randomSparseMatrix(m, n, sparsityA)
		Awrap = MatrixWrapper.wrapMatrix(A, protocolA, dfsDirA, maxCoresA)
		# norm 1 
		val = dgemnrm1(disco, transA, m, n, Awrap, maxTotalBlocks)
		# validate
		self.validate(transA, A, val)