SetValue sets value with pos, if pos out of bounds, return it
(pos int, value float64)
| 64 | |
| 65 | // SetValue sets value with pos, if pos out of bounds, return it |
| 66 | func (f *FloatArray) SetValue(pos int, value float64) { |
| 67 | if !f.checkPos(pos) { |
| 68 | return |
| 69 | } |
| 70 | f.values[pos] = value |
| 71 | |
| 72 | if !f.HasValue(pos) { |
| 73 | blockIdx := pos / blockSize |
| 74 | idx := pos - pos/blockSize*blockSize |
| 75 | mark := f.marks[blockIdx] |
| 76 | mark |= 1 << uint64(idx) |
| 77 | f.marks[blockIdx] = mark |
| 78 | |
| 79 | f.size++ |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // IsEmpty tests if array is empty |
| 84 | func (f *FloatArray) IsEmpty() bool { |