summaryrefslogtreecommitdiff
path: root/match/test.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-03-20 14:18:16 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-03-21 14:56:15 +0100
commite9dcbeaba956e84d1e591e9b520f3b7bb4fa6354 (patch)
tree19b4d548127766862a79f5521f75a590b90090b1 /match/test.c
parentea6cfa421b7cef91eba85c5144eec14288c41c4c (diff)
Matcher: convert distance matrix to integer
In order to reduce the requirements on the cpu environment running the matcher, the floating-point operations are converted to integer. Care is taken as to not overflow the distance matrix. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'match/test.c')
-rw-r--r--match/test.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/match/test.c b/match/test.c
index 192f969..f9f2a27 100644
--- a/match/test.c
+++ b/match/test.c
@@ -27,23 +27,23 @@
27 27
28static void test1() 28static void test1()
29{ 29{
30 float A[] = { 30 int A[] = {
31 1013.000000, 31 1013,
32 3030660.000000, 32 3030660,
33 3559354.000000, 33 3559354,
34 12505925.000000, 34 12505925,
35 19008450.000000, 35 19008450,
36 6946421.000000, 36 6946421,
37 6118613.000000, 37 6118613,
38 698020.000000, 38 698020,
39 3021800.000000, 39 3021800,
40 1017.000000, 40 1017,
41 37573.000000, 41 37573,
42 3242018.000000, 42 3242018,
43 8152794.000000, 43 8152794,
44 1266053.000000, 44 1266053,
45 942941.000000, 45 942941,
46 462820.000000, 46 462820,
47 }; 47 };
48 int index[DIM_FINGER], i; 48 int index[DIM_FINGER], i;
49 match_fingers(index, A, 4, 4); 49 match_fingers(index, A, 4, 4);
@@ -53,32 +53,32 @@ static void test1()
53 53
54static void test2() 54static void test2()
55{ 55{
56 float A[] = { 56 int A[] = {
57 0.000000, 57 0,
58 4534330.000000, 58 4534330,
59 22653552.000000, 59 22653552,
60 12252500.000000, 60 12252500,
61 685352.000000, 61 685352,
62 4534330.000000, 62 4534330,
63 0.000000, 63 0,
64 9619317.000000, 64 9619317,
65 28409530.000000, 65 28409530,
66 6710170.000000, 66 6710170,
67 22653552.000000, 67 22653552,
68 9619317.000000, 68 9619317,
69 0.000000, 69 0,
70 47015292.000000, 70 47015292,
71 29788572.000000, 71 29788572,
72 2809040.000000, 72 2809040,
73 10428866.000000, 73 10428866,
74 38615920.000000, 74 38615920,
75 17732500.000000, 75 17732500,
76 719528.000000, 76 719528,
77 12113945.000000, 77 12113945,
78 28196220.000000, 78 28196220,
79 46778656.000000, 79 46778656,
80 405.000000, 80 405,
81 14175493.000000, 81 14175493,
82 }; 82 };
83 int index[DIM_FINGER], i; 83 int index[DIM_FINGER], i;
84 match_fingers(index, A, 5, 5); 84 match_fingers(index, A, 5, 5);
@@ -89,11 +89,11 @@ static void test2()
89static void speed1() 89static void speed1()
90{ 90{
91 /* column-by-column matrix */ 91 /* column-by-column matrix */
92 float A[DIM2_FINGER]; 92 int A[DIM2_FINGER];
93 float x1[DIM_FINGER] = { 1, 5, 2, 3, 4, 5, 6, 7, 8 }; 93 int x1[DIM_FINGER] = { 1, 5, 2, 3, 4, 5, 6, 7, 8 };
94 float y1[DIM_FINGER] = { 1, 5, 2, 3, 4, 5.1, 6, 7, 8 }; 94 int y1[DIM_FINGER] = { 1, 5, 2, 3, 4, 6, 6, 7, 8 };
95 float x2[DIM_FINGER] = { 1.1, 3, 2, 4, 5, 6, 7, 8 }; 95 int x2[DIM_FINGER] = { 1.1, 3, 2, 4, 5, 6, 7, 8 };
96 float y2[DIM_FINGER] = { 1, 3, 2, 4, 5, 6, 7, 8 }; 96 int y2[DIM_FINGER] = { 1, 3, 2, 4, 5, 6, 7, 8 };
97 int index[DIM_FINGER]; 97 int index[DIM_FINGER];
98 int n1 = 4; 98 int n1 = 4;
99 int n2 = 7; 99 int n2 = 7;