Commit 140c9555 authored by Quentin Khan's avatar Quentin Khan

FAdaptiveSequential: hack to compute indices between different levels

This add a check at the beginning of `compute_box_offset_index`. If the
nodes are not on the same level, the lowest one ancestor which is at the
highest's level is used to compute the offset index.

This allows two nodes to have the same index (when they share the
ancestor found).

The case when two node are not on the same level is only seen during
direct computation. Fortunately, in this case the node indices are only
used for symetric kernels which discriminate which nodes to compute
against based on the index order.
parent 03c429c9
......@@ -283,6 +283,13 @@ public:
* terms of boxes on an axis
int compute_box_offset_index(node_t* node, node_t* other_node, const std::size_t n) {
while(node->getDepth() > other_node->getDepth()) {
node = node->getParent();
while(node->getDepth() < other_node->getDepth()) {
other_node = other_node->getParent();
typename node_t::FReal box_width = (node->getBox().c2 - node->getBox().c1)[0];
auto center_offset = other_node->getBox().center() - node->getBox().center();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment