- Timestamp:
- May 6, 2014, 10:21:34 AM (12 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 2741c88
- Parents:
- a915a03
- Location:
- tol_tests/tol/LinearAlgebra/PolMatrix
- Files:
-
- 2 edited
-
test_0001/check.tol (modified) (1 diff)
-
test_0002/check.tol (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/LinearAlgebra/PolMatrix/test_0001/check.tol
ra915a03 r747dbd9 42 42 })); 43 43 44 Matrix x = GetNumeric([[X]]); 45 Matrix xP = GetNumeric([[XP]]); 44 46 47 Real quality.dif.xP = 1-MatMax(Abs(x-xP)); 48 49 Set X2 = DeepCopy([[X]],x*2); 50 Matrix x2 = GetNumeric([[X2]]); 51 Real quality.dif.x2 = 1-MatMax(Abs(x2-x*2)); 52 53 -
tol_tests/tol/LinearAlgebra/PolMatrix/test_0002/check.tol
ra915a03 r747dbd9 1 1 #Require VariableChange; 2 #Require AlgLib; 3 #Require MPM; 2 4 3 5 Real dim = 2; 4 Real deg = 3; 6 Real deg = 2; 7 Real T = 100; 5 8 6 Matrix x = VariableChange:: StableMatrixPolyn::9 Matrix x = VariableChange::@StableMatrixPolyn:: 7 10 SquareSetGen.Rand(dim, deg, -1, 1, 0.001); 8 11 9 Set PHI = VariableChange:: StableMatrixPolyn::12 Set PHI = VariableChange::@StableMatrixPolyn:: 10 13 DuffinSchurBinFact(dim, deg, (x)); 11 14 Polyn determinant = VecSer::PolynMatrixDeterminant(PHI); 12 13 15 14 16 PolMatrix P = TabPol2PolMat(PHI); 15 17 16 18 Polyn determinant_ = Determinant(P); 19 Set PHI.det.roots = MPM::@ModuleVAR::PolynRootsReport(determinant_); 20 Real root.abs.min = PHI.det.roots[1][3]; 21 Real P.isStationary = PolMatIsStationary(P); 22 23 Real inequality_constraint_ = -Log(StationaryValue(determinant)); 24 25 Matrix X = Rand(T,dim,-1,1); 26 27 Matrix Y = P:X; 28 29 30 VMatrix C = CompanionMatrix(P); 31 Matrix eigen = AlgLib::CppTools::rmatrixevd.eigen(VMat2Mat(C)); 32 Matrix eigen.module = Sqrt(eigen^2 * Col(1,1)); 33 Real eigen.module.max = MatMax(eigen.module); 34 Real eigen.module.max.inv = 1/eigen.module.max; 35 36 37 /* 38 Real m = VRows(C); 39 Real S=10000*m; 40 VMatrix U = Gaussian(m,S,0,1); 41 VMatrix V = C*U; 42 VMatrix u2 = (U^2)*Constant(S,1,1/S); 43 VMatrix v2 = (V^2)*Constant(S,1,1/S); 44 VMatrix r2 = v2 $/ u2; 45 //VMatrix R = MtMSqr(V) $/ MtMSqr(U); 46 //Real VMatMax(R) 47 /* */
Note: See TracChangeset
for help on using the changeset viewer.
