| 66 | |
| 67 | |
| 68 | bool SparseMatrix::set(uint8_t x, uint8_t y, float value) |
| 69 | { |
| 70 | int32_t pos = findPos(x, y); |
| 71 | // existing element |
| 72 | if (pos > -1) |
| 73 | { |
| 74 | _value[pos] = value; |
| 75 | if (_value[pos] == 0.0) removeElement(pos); |
| 76 | return true; |
| 77 | } |
| 78 | |
| 79 | // does not exist => new element ? |
| 80 | return newElement(x, y, value); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | bool SparseMatrix::add(uint8_t x, uint8_t y, float value) |