Changeset aa1e2cc in tol for tol_pkg/MatQuery
- Timestamp:
- Nov 27, 2009, 10:16:22 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 6cea4d2
- Parents:
- 345a4d7
- Location:
- tol_pkg/MatQuery/test
- Files:
-
- 3 edited
-
test_0001/test.tol (modified) (6 diffs)
-
test_0002/test.tol (modified) (1 diff)
-
test_0003/test.tol (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol_pkg/MatQuery/test/test_0001/test.tol
r345a4d7 raa1e2cc 9 9 Text summary_ = "checking matrix row selection"; 10 10 11 #Require MatQuery; 12 //#Embed "../../../_embed_all.tol"; 13 11 14 //Write here the initial test TOL code if needed 12 15 Real numErr0 = Copy(NError); … … 18 21 WriteLn("Current Random Seed = "<<rndSeed); 19 22 20 #Require MatQuery;21 //#Embed "../../../_embed_all.tol";22 23 23 24 //The order of magnitude required for number of geographic points … … 69 70 VMatrix points = Mat2VMat(BinGroup("<<",city.points)); 70 71 72 71 73 //Target point 72 74 VMatrix p0 = SubRow(points,[[IntRand(1,point.num)]])+ … … 79 81 points, p0, distance); 80 82 VMatrix p0.select.HC = SubRow(points,p0.select.idx.HC); 83 81 84 Real t1 = Copy(Time); 82 85 WriteLn("SelectRowsInHyperCube full "<<VRows(p0.select.HC)+" items " … … 88 91 points, p0, distance); 89 92 VMatrix p0.select.HE.1 = SubRow(points,p0.select.idx.HE.1); 93 90 94 Real t2 = Copy(Time); 91 95 WriteLn("SelectRowsInHyperSphere full "<<VRows(p0.select.HE.1)+" items " … … 106 110 Card(p0.select.idx.HE.1 * p0.select.idx.HC) == 107 111 Card(p0.select.idx.HE.1)); 112 108 113 Real ok.2 = VMatMax(Abs(p0.select.HE.2-p0.select.HE.1))==0; 109 114 -
tol_pkg/MatQuery/test/test_0002/test.tol
r345a4d7 raa1e2cc 9 9 Text summary_ = "checking matrix row selection"; 10 10 11 #Require MatQuery; 12 //#Embed "../../../_embed_all.tol"; 13 11 14 //Write here the initial test TOL code if needed 12 15 Real numErr0 = Copy(NError); 13 16 Real numWar0 = Copy(NWarning); 14 15 #Require MatQuery;16 //#Embed "../../../_embed_all.tol";17 17 18 18 Real t1 = Copy(Time); -
tol_pkg/MatQuery/test/test_0003/test.tol
r345a4d7 raa1e2cc 9 9 Text summary_ = "checking matrix row selection of unknown values"; 10 10 11 //#Require MatQuery; 12 //#Embed "../../../_embed_all.tol"; 13 11 14 //Write here the initial test TOL code if needed 12 15 Real numErr0 = Copy(NError); 13 16 Real numWar0 = Copy(NWarning); 14 17 15 #Require MatQuery;16 //#Embed "../../../_embed_all.tol";17 18 18 Real t1 = Copy(Time); 19 19 Real rndSeed = 0; 20 20 Real m = 300; 21 Real n = 10; 21 22 22 VMatrix unk.match = LE(Rand(m, 1,0,1),Rand(m,1,1,1)*.20);23 VMatrix M = IfVMat(unk.match, Rand(m, 1,1,1)*?, Rand(m,1,-10,10));23 VMatrix unk.match = LE(Rand(m,n,0,1),Rand(m,n,1,1)*.20); 24 VMatrix M = IfVMat(unk.match, Rand(m,n,1,1)*?, Rand(m,n,-10,10)); 24 25 25 VMatrix unk.match_ = MatQuery::MatchRowsWithValue(M,?); 26 Real ok.1 = VMatMax(Abs(unk.match-unk.match))==0; 26 VMatrix M.unk = Min(IsUnknown(M)*Rand(n,1,1,1), Rand(m,1,1,1)); 27 27 28 Set sel.known = MatQuery::SelectMatch(Not(unk.match_)); 28 VMatrix M.rows.known = Pack(Not(IsUnknown(M)*Rand(n,1,1,1))); 29 VMatrix M.rows.unknown = Pack(Not(M.rows.known)); 30 VMatrix M.rows.known_= MatQuery::MatchRowsFullKnown(M); 29 31 30 VMatrix extract.known = SubRow(M, sel.known); 32 VMatrix unk.match.1 = LE(Rand(m,1,0,1),Rand(m,1,1,1)*.20); 33 VMatrix M1 = IfVMat(unk.match.1, Rand(m,1,1,1)*?, Rand(m,1,-10,10)); 34 35 VMatrix unk.match.1_ = MatQuery::MatchRowsWithValue(M1,?); 36 Real ok.1 = VMatMax(Abs(unk.match.1-unk.match.1))==0; 37 38 Set sel.known = MatQuery::SelectMatch(Not(unk.match.1_)); 39 40 VMatrix extract.known = SubRow(M1, sel.known); 31 41 32 42 Real ok.2 = VMatSum(IsUnknown(extract.known))==0; 33 Real ok.3 = VRows(extract.known)==m-VMatSum(unk.match );43 Real ok.3 = VRows(extract.known)==m-VMatSum(unk.match.1); 34 44 35 45
Note: See TracChangeset
for help on using the changeset viewer.
