source: tol/tol_pkg/MatQuery/test/test_0003/test.tol @ d937698

1941-docker-image-to-testdevel
Last change on this file since d937698 was d937698, checked in by Víctor de Buen <vdebuen@…>, 17 years ago

checking matrix row selection of unknown values

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1720 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/* -*- mode: C++ -*- */
2//////////////////////////////////////////////////////////////////////////////
3// FILE   : test.tol
4// PURPOSE: Package MatQuery test
5//////////////////////////////////////////////////////////////////////////////
6
7Text email_ = "vdebuen@tol-project.org";
8Text link_ = "";
9Text summary_ = "checking matrix row selection of unknown values";
10
11//Write here the initial test TOL code if needed
12Real numErr0 = Copy(NError);
13Real numWar0 = Copy(NWarning);
14
15#Require MatQuery;
16//#Embed "../../../_embed_all.tol";
17
18Real t1 = Copy(Time);
19Real rndSeed = 0;
20Real m = 300;
21
22VMatrix unk.match = LE(Rand(m,1,0,1),Rand(m,1,1,1)*.20);
23VMatrix M = IfVMat(unk.match, Rand(m,1,1,1)*?, Rand(m,1,-10,10));
24
25VMatrix unk.match_ = MatQuery::MatchRowsWithValue(M,?);
26Real ok.1 = VMatMax(Abs(unk.match-unk.match))==0;
27
28Set sel.known = MatQuery::SelectMatch(Not(unk.match_));
29
30VMatrix extract.known = SubRow(M, sel.known);
31
32Real ok.2 = VMatSum(IsUnknown(extract.known))==0;
33Real ok.3 = VRows(extract.known)==m-VMatSum(unk.match);
34
35
36Real numErr1 = Copy(NError);
37Real numWar1 = Copy(NWarning);
38
39Set partialResults_ = [[numErr0, numErr1,
40                        ok.1, ok.2, ok.3]];
41
42//This is a messure of the success of the test
43Real quality_ = And(numErr1 == numErr0,
44                    numWar1 <= numWar0,
45                    ok.1, ok.2, ok.3);
46
47//Return the results
48Set resultStr_ = @strTestStatus(summary_, link_, quality_,
49                  "Partial results = "<<partialResults_,
50                  "NO DBServerType", "NO DBServerHost", "NO DBAlias",
51                  email_);
52WriteLn(""<<resultStr_);
53resultStr_;
54
55/* */
56
Note: See TracBrowser for help on using the repository browser.