Example #1
0
	def test_dBdB(self):
		bs = BSpline(nknots=5)
		M = bs.deg + bs.nknots + 1
		BB = np.zeros((M,M))
		for i in xrange(-bs.deg, bs.nknots + 1):
			for j in xrange(i, bs.nknots + 1):
				BB[ix(i),ix(j)] = bs.dBdB(i, j) 
				BB[ix(j),ix(i)] = BB[ix(i),ix(j)] 
				print "matrix dBdB"
				print BB
		aI = 10e-6*np.eye(np.shape(BB)[0])
		L = np.linalg.cholesky(BB + aI)
		print "Cholesky factor of matrix dBdB"
		print L
		print "sucess, matrix is 'almost' semidefinite"
		pass