diff --git a/include/htool/hmatrix/tree_builder/tree_builder.hpp b/include/htool/hmatrix/tree_builder/tree_builder.hpp index b666d872..3a8a796b 100644 --- a/include/htool/hmatrix/tree_builder/tree_builder.hpp +++ b/include/htool/hmatrix/tree_builder/tree_builder.hpp @@ -108,15 +108,15 @@ class HMatrixTreeBuilder { void set_symmetry_for_leaves(HMatrixType &hmatrix) const { if (m_symmetry_type != 'N') { - postorder_tree_traversal(hmatrix, [this](HMatrixType &hmatrix) { - if (hmatrix.is_leaf() and hmatrix.get_symmetry() != 'N') { - hmatrix.set_symmetry_for_leaves(m_symmetry_type); - hmatrix.set_UPLO_for_leaves(m_UPLO_type); - } else if (!hmatrix.is_leaf()) { - for (auto &child : hmatrix.get_children()) { + postorder_tree_traversal(hmatrix, [this](HMatrixType ¤t_hmatrix) { + if (current_hmatrix.is_leaf() and current_hmatrix.get_symmetry() != 'N') { + current_hmatrix.set_symmetry_for_leaves(m_symmetry_type); + current_hmatrix.set_UPLO_for_leaves(m_UPLO_type); + } else if (!current_hmatrix.is_leaf()) { + for (auto &child : current_hmatrix.get_children()) { if (child->get_symmetry() != 'N') { - hmatrix.set_symmetry_for_leaves(m_symmetry_type); - hmatrix.set_UPLO_for_leaves(m_UPLO_type); + current_hmatrix.set_symmetry_for_leaves(m_symmetry_type); + current_hmatrix.set_UPLO_for_leaves(m_UPLO_type); } } }