MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / set

Method set

libraries/SparseMatrix/SparseMatrix.cpp:68–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68bool 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
84bool SparseMatrix::add(uint8_t x, uint8_t y, float value)

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36