Set the value for a node.
(&mut self, node_id: u32, value: f64)
| 138 | |
| 139 | /// Set the value for a node. |
| 140 | pub fn set(&mut self, node_id: u32, value: f64) { |
| 141 | let idx = node_id as usize; |
| 142 | if idx < self.values.len() { |
| 143 | self.values[idx] = value; |
| 144 | self.present[idx / 64] |= 1u64 << (idx % 64); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /// Get the value for a node. Returns None if missing. |
| 149 | pub fn get(&self, node_id: u32) -> Option<f64> { |