示例#1
0
func __TestZeroQLSweep(t *testing.T) {

	N := 5
	D0 := cmat.NewMatrix(1, N)
	E0 := cmat.NewMatrix(1, N-1)
	D1 := cmat.NewMatrix(1, N)
	E1 := cmat.NewMatrix(1, N-1)

	for k := 0; k < N; k++ {
		D0.SetAt(N-k-1, float64(k+1))
		D1.SetAt(N-k-1, float64(k+1))
		if k < N-1 {
			E0.SetAt(k, 1.0)
			E1.SetAt(k, 1.0)
		}
	}

	f := D0.GetAt(4)
	g := E0.GetAt(3)
	lapackd.BDQLsweep(D0, E0, f, g)
	lapackd.BDQLzero(D1, E1)
	t.Logf("D0.std :%v\n", D0)
	t.Logf("D1.zero:%v\n", D1)
	t.Logf("E0.std :%v\n", E0)
	t.Logf("E1.zero:%v\n", E1)
}
示例#2
0
func __TestSweep(t *testing.T) {

	N := 5
	D0 := cmat.NewMatrix(1, N)
	E0 := cmat.NewMatrix(1, N-1)
	D1 := cmat.NewMatrix(1, N)
	E1 := cmat.NewMatrix(1, N-1)

	for k := 0; k < N; k++ {
		D0.SetAt(k, float64(k+1))
		D1.SetAt(N-1-k, float64(k+1))
		if k < N-1 {
			E0.SetAt(k, 1.0)
			E1.SetAt(k, 1.0)
		}
	}

	f := 0.5
	g := -0.45
	lapackd.BDQRsweep(D0, E0, f, g)
	lapackd.BDQLsweep(D1, E1, f, g)
	t.Logf("D0:%v\n", D0)
	t.Logf("D1:%v\n", D1)
	t.Logf("E0:%v\n", E0)
	t.Logf("E1:%v\n", E1)
}