示例#1
0
	def test_eigen_3dim(self):
		'''
		test eigen function by 3 dimention
		'''
		v1 = lr.Vector([1,-1,0])
		v2 = lr.Vector([-2,1,-2])
		v3 = lr.Vector([0,-1,1])
		m1 = lr.Matrix([v1,v2,v3])
		
		res = lr.eigen(m1)
		
		chk = {-1,1,3}
示例#2
0
	def test_eigen_2dim(self):
		'''
		test eigen function by 2 dimention
		'''
		v1 = lr.Vector([4,5])
		v2 = lr.Vector([-1,-2])
		matA = lr.Matrix([v1,v2])
		
		res = lr.eigen(matA)
		
		chk = {
			-1 : lr.Vector([1,5]), 
			3 : lr.Vector([1,1])
		}
		
		self.assertEqual(res, chk)