Changeset 151dc42 in tol
- Timestamp:
- Feb 3, 2009, 9:21:19 AM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- f84924c
- Parents:
- 1918f9c
- Location:
- tol_tests/tol/LinearAlgebra/vmatrix
- Files:
-
- 5 edited
-
test_0003/test.tol (modified) (2 diffs)
-
test_0004/test.tol (modified) (9 diffs)
-
test_0005/performance.tol (modified) (1 diff)
-
test_0005/test.tol (modified) (2 diffs)
-
test_0007/test.tol (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/LinearAlgebra/vmatrix/test_0003/test.tol
r1918f9c r151dc42 29 29 Matrix B_ = VMat2Mat(B); 30 30 31 VMatrix PB = CholeskiSolve(L.factor,B,"P ");31 VMatrix PB = CholeskiSolve(L.factor,B,"Pt"); 32 32 Matrix PB_ = VMat2Mat(PB); 33 33 34 VMatrix PtPB = CholeskiSolve(L.factor,PB,"P t");34 VMatrix PtPB = CholeskiSolve(L.factor,PB,"P"); 35 35 Matrix PtPB_ = VMat2Mat(PtPB); 36 36 … … 39 39 VMatrix L = Convert(L.factor,"Cholmod.R.Sparse"); 40 40 Matrix L_ = VMat2Mat(L); 41 VMatrix PtL = CholeskiSolve(L.factor,L,"P t");41 VMatrix PtL = CholeskiSolve(L.factor,L,"P"); 42 42 Matrix PtL_ = VMat2Mat(PtL); 43 43 VMatrix PtLLtP = MMtSqr(PtL); -
tol_tests/tol/LinearAlgebra/vmatrix/test_0004/test.tol
r1918f9c r151dc42 63 63 64 64 65 Real m = IntRand(1 50, 150);65 Real m = IntRand(10, 10); 66 66 67 67 Real p1 = IntRand(1,3); … … 70 70 Polyn ma1 = RandStationary(q1); 71 71 72 Real p7 = 1*IntRand(1,1);72 Real p7 = 0*IntRand(1,1); 73 73 Polyn ar7 = RandStationary(p7,7); 74 74 Real q7 = 0*IntRand(1,3); … … 122 122 WriteLn("quality.L_theta_m_ = "<<quality.L_theta_m_); 123 123 124 125 124 //Sparse Choleski of large length m 126 125 VMatrix cov_arma_m = Pol2VMat(ARMAGamma(ar,ma,m), m, m); … … 128 127 WriteLn("quality.cov_arma_m = "<<quality.cov_arma_m); 129 128 130 VMatrix L_arma_m.1 = CholeskiFactor(cov_arma_m,"X" );129 VMatrix L_arma_m.1 = CholeskiFactor(cov_arma_m,"X",False); 131 130 Real quality.L_arma_m.1 = 1-MatMax(Abs(VMat2Mat(L_arma_m.1)-L_arma_m_)); 132 131 WriteLn("quality.L_arma_m.1 = "<<quality.L_arma_m.1); 133 132 134 VMatrix Li_arma_m.1 = CholeskiSolve(L_arma_m.1,Eye(m)," L");133 VMatrix Li_arma_m.1 = CholeskiSolve(L_arma_m.1,Eye(m),"PtL"); 135 134 VMatrix Lis_arma_m.1 = Convert(Li_arma_m.1,"Cholmod.R.Sparse"); 136 135 Real quality.Li_arma_m.1 = 1-MatMax(Abs(VMat2Mat(Li_arma_m.1)-Li_arma_m_)); … … 141 140 WriteLn("quality.cov_ar_m = "<<quality.cov_ar_m); 142 141 143 VMatrix L_ar_m = CholeskiFactor(cov_ar_m,"X" );142 VMatrix L_ar_m = CholeskiFactor(cov_ar_m,"X",False); 144 143 Real quality.L_ar_m = 1-MatMax(Abs(VMat2Mat(L_ar_m)-L_ar_m_)); 145 144 WriteLn("quality.L_ar_m = "<<quality.L_ar_m); 146 145 147 VMatrix Li_ar_m.1 = CholeskiSolve(L_ar_m,Eye(m)," L");146 VMatrix Li_ar_m.1 = CholeskiSolve(L_ar_m,Eye(m),"PtL"); 148 147 Matrix VMat2Mat(Li_ar_m.1); 149 148 Real quality.Li_ar_m.1 = 1-MatMax(Abs(VMat2Mat(Li_ar_m.1)-Li_ar_m_)); … … 156 155 WriteLn("quality.cov_theta_m.1 = "<<quality.cov_theta_m.1); 157 156 158 VMatrix L_theta_m.1 = CholeskiFactor(cov_theta_m.1,"X" );157 VMatrix L_theta_m.1 = CholeskiFactor(cov_theta_m.1,"X",False); 159 158 160 159 //Sparse Choleski of short length n … … 167 166 WriteLn("quality.cov_ar_n = "<<quality.cov_ar_n); 168 167 169 VMatrix L_ar_n = CholeskiFactor(cov_ar_n,"X" );168 VMatrix L_ar_n = CholeskiFactor(cov_ar_n,"X",False); 170 169 Real quality.L_ar_n = 1-MatMax(Abs(VMat2Mat(L_ar_n)-L_ar_n_)); 171 170 WriteLn("quality.L_ar_n = "<<quality.L_ar_n); 172 171 173 VMatrix Li_ar_n = CholeskiSolve(L_ar_n,Eye(n)," L");172 VMatrix Li_ar_n = CholeskiSolve(L_ar_n,Eye(n),"PtL"); 174 173 Real quality.Li_ar_n = 1-MatMax(Abs(VMat2Mat(Li_ar_n)-Li_ar_n_)); 175 174 WriteLn("quality.Li_ar_n = "<<quality.Li_ar_n); … … 186 185 WriteLn("quality.Li_ar_m = "<<quality.Li_ar_m); 187 186 188 VMatrix L_theta_m = CholeskiFactor(cov_theta_m,"X" );187 VMatrix L_theta_m = CholeskiFactor(cov_theta_m,"X",True); 189 188 VMatrix Ls_theta_m = Convert(L_theta_m,"Cholmod.R.Sparse"); 190 189 Matrix VMat2Mat(Ls_theta_m); … … 192 191 WriteLn("quality.Ls_theta_m = "<<quality.Ls_theta_m); 193 192 194 VMatrix Li_arma_m = CholeskiSolve(L_theta_m,Li_ar_m," L");193 VMatrix Li_arma_m = CholeskiSolve(L_theta_m,Li_ar_m,"PtL"); 195 194 Matrix VMat2Mat(Li_arma_m); 196 195 Real quality.L_arma_m = 1-VMatMax(Abs(Li_arma_m-Lis_arma_m.1)); -
tol_tests/tol/LinearAlgebra/vmatrix/test_0005/performance.tol
r1918f9c r151dc42 94 94 { 95 95 Set For(2,repeatSolv,Real(Real k) 96 { VMatrix CholeskiSolve(L,Xty," LLt"); 1 });97 Drop(CholeskiSolve(L,Xty," LLt"),1.E-15)96 { VMatrix CholeskiSolve(L,Xty,"PtLLtP"); 1 }); 97 Drop(CholeskiSolve(L,Xty,"PtLLtP"),1.E-15) 98 98 }; 99 99 Real tSolv = (Copy(Time)-t0)/repeatSolv; -
tol_tests/tol/LinearAlgebra/vmatrix/test_0005/test.tol
r1918f9c r151dc42 63 63 64 64 WriteLn("TRACE 10 "+Time); 65 VMatrix b3.1 = CholeskiSolve(L2,Xty, "P ");65 VMatrix b3.1 = CholeskiSolve(L2,Xty, "Pt"); 66 66 VMatrix b3.2 = CholeskiSolve(L2,b3.1, "L"); 67 67 VMatrix b3.3 = CholeskiSolve(L2,b3.2, "Lt"); 68 VMatrix b3 = CholeskiSolve(L2,b3.3, "P t");68 VMatrix b3 = CholeskiSolve(L2,b3.3, "P"); 69 69 Matrix _b3 = VMat2Mat(b3); 70 70 Real b3.quality = 1-MatMax(Abs(_b-_b3)); … … 78 78 79 79 WriteLn("TRACE 12 "+Time); 80 VMatrix PXtX = CholeskiSolve(L2, XtX, "P");80 VMatrix PXtX = CholeskiSolve(L2, XtX, "Pt"); 81 81 VMatrix L_2t = CholeskiSolve(L2, PXtX, "L"); 82 82 VMatrix L_2 = Tra(L_2t); -
tol_tests/tol/LinearAlgebra/vmatrix/test_0007/test.tol
r1918f9c r151dc42 40 40 Matrix COV_ = VMat2Mat(COV); 41 41 WriteLn("TRACE 3"); 42 VMatrix factor = CholeskiFactor(COV,"X" );42 VMatrix factor = CholeskiFactor(COV,"X",False); 43 43 44 44 VMatrix B = Mat2VMat(DifEq(1/(1-B),Rand(m,1,1,1),Rand(0,0,0,0),Col(0))); … … 65 65 Matrix VMat2Mat(LLiB); 66 66 67 VMatrix PtL = CholeskiSolve(factor, Ls, "P t");67 VMatrix PtL = CholeskiSolve(factor, Ls, "P"); 68 68 VMatrix PtLLtP.1 = MMtSqr(PtL); 69 69 Matrix VMat2Mat(PtLLtP.1); … … 75 75 76 76 77 78 77 Matrix L_ = Choleski(COV_); 79 78 Matrix Li = LTInverse(L_); … … 82 81 WriteLn("TRACE 6 quality.3="<<quality.3); 83 82 84 VMatrix LLtP = CholeskiSolve(factor, COV, "Pt"); 85 Matrix VMat2Mat(LLtP); 86 VMatrix LtP = CholeskiSolve(factor, LLtP, "L"); 87 Matrix VMat2Mat(LtP); 88 VMatrix LtP_ = (CholeskiSolve(factor, COV, "PtL")+m)-m; 89 Matrix VMat2Mat(LtP_); 83 84 VMatrix LtP = CholeskiSolve(factor, COV, "PtL"); 90 85 VMatrix PtLLtP.2 = MtMSqr(LtP); 91 86 Matrix VMat2Mat(PtLLtP.2); … … 93 88 WriteLn("TRACE 7 quality.4="<<quality.4); 94 89 95 //VMatrix E = CholeskiSolve(factor,Z,"PtL"); 96 VMatrix E = CholeskiSolve(factor,CholeskiSolve(factor,Z,"Pt"),"L"); 90 VMatrix E = CholeskiSolve(factor,Z,"PtL"); 97 91 Matrix VMat2Mat(Z-PtL*E); 98 92 Real quality.5 = 1-VMatMax(Abs(Z-PtL*E));
Note: See TracChangeset
for help on using the changeset viewer.
