You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,7 +15,7 @@ Arduino library to store a symmetrical distance table in less memory.
13
15
14
16
The DistanceTable library is a class that stores a symmetrical distance table
15
17
which is typically N x N entries in less memory space.
16
-
It uses (N x (N-1))/2 ("in a triangle") as an eucledian distance table is
18
+
It uses (N x (N-1))/2 ("in a triangle") as an euclidean distance table is
17
19
symmetrical around its main diagonal.
18
20
Furthermore as the main diagonal are all zero it does not need to be stored either.
19
21
@@ -25,15 +27,15 @@ Within the 2K RAM of an Arduino one could store normally a 21 x 21 matrix (1764
25
27
26
28
## Interface
27
29
28
-
-**DistanceTable(uint8_t size)** Constructor, allocates memory and clears them.
30
+
-**DistanceTable(uint8_t size, float value = 0.0)** Constructor, allocates memory and sets initial value to all elements.
29
31
-**~DistanceTable();** Destructor, frees memory
30
32
-**void clear()** sets all entries to 0.0.
31
-
-**void setAll(value)** sets all entries to value;
33
+
-**void setAll(float value)** sets all entries to value;
32
34
-**void set(uint8_t x, uint8_t y, float value )** sets a value for (x,y) and automatically for (y, x)
33
35
-**float get(uint8_t x, uint8_t y)** gets a value from (x,y). If x == y it will return 0.
34
-
-**float minimum(uint8_t &x, uint8_t &y)** Returns minimum and first occurence in x and y. It does skip x == y pairs as these are 0.
35
-
-**float maximum(uint8_t &x, uint8_t &y)** Returns maximum and first occurence in x and y. It does skip x == y pairs as these are 0.
36
-
-**uint16_t count(value, epsilon)** counts the number of occurences of value. As we are comparing floats the epsilon can set a margin for 'almost equal'.
36
+
-**float minimum(uint8_t &x, uint8_t &y)** Returns minimum and first occurrence in x and y. It does skip x == y pairs as these are 0.
37
+
-**float maximum(uint8_t &x, uint8_t &y)** Returns maximum and first occurrence in x and y. It does skip x == y pairs as these are 0.
38
+
-**uint16_t count(value, epsilon)** counts the number of occurrences of value. As we are comparing floats the epsilon can set a margin for 'almost equal'.
37
39
38
40
39
41
@@ -47,13 +49,12 @@ Within the 2K RAM of an Arduino one could store normally a 21 x 21 matrix (1764
47
49
48
50
## Future
49
51
50
-
-**count()** could get an epsilon to count also nearly hits (default 0.0);
51
-
-**clear()** could set all to NAN? is that better as it iindicates unknown?
52
+
-**clear()** could set all to NAN? is that better as it indicates unknown?
52
53
setAll() let the user decide.
53
54
54
55
55
-
Note: table can be used for other symmetrical 2D tables. And therefor include
56
-
negative values.
56
+
Note: table can be used for other symmetrical 2D tables.
0 commit comments