113 void Reset(
int num_events);
129 IntegerType energy_min, IntegerType energy_max);
134 IntegerType energy_min, IntegerType energy_max);
142 IntegerType energy_max);
147 IntegerType initial_envelope_opt,
148 IntegerType energy_max);
194 IntegerType target_envelope,
int* critical_event,
int* optional_event,
195 IntegerType* available_energy)
const;
199 return tree_[GetLeafFromEvent(event)].sum_of_energy_min;
204 IntegerType envelope;
205 IntegerType envelope_opt;
206 IntegerType sum_of_energy_min;
207 IntegerType max_of_energy_delta;
210 TreeNode ComposeTreeNodes(
const TreeNode& left,
const TreeNode& right);
212 int GetLeafFromEvent(
int event)
const;
213 int GetEventFromLeaf(
int leaf)
const;
216 void RefreshNode(
int node);
222 int GetMaxLeafWithEnvelopeGreaterThan(
int node, IntegerType target_envelope,
223 IntegerType* extra)
const;
226 int GetLeafWithMaxEnergyDelta(
int node)
const;
230 void GetLeavesWithOptionalEnvelopeGreaterThan(
231 IntegerType target_envelope,
int* critical_leaf,
int* optional_leaf,
232 IntegerType* available_energy)
const;
241 bool leaf_nodes_have_delayed_operations_ =
false;
244 std::vector<TreeNode> tree_;