diff --git a/include/htool/hmatrix/tree_builder/tree_builder.hpp b/include/htool/hmatrix/tree_builder/tree_builder.hpp index 17f012eb..921c1119 100644 --- a/include/htool/hmatrix/tree_builder/tree_builder.hpp +++ b/include/htool/hmatrix/tree_builder/tree_builder.hpp @@ -163,7 +163,12 @@ class HMatrixTreeBuilder { void set_minimal_source_depth(int minimal_source_depth) { m_minsourcedepth = minimal_source_depth; } void set_minimal_target_depth(int minimal_target_depth) { m_mintargetdepth = minimal_target_depth; } void set_dense_blocks_generator(std::shared_ptr> dense_blocks_generator) { m_dense_blocks_generator = dense_blocks_generator; } - void set_block_tree_consistency(bool consistency) { m_is_block_tree_consistent = consistency; } + void set_block_tree_consistency(bool consistency) { + if (m_symmetry_type != 'N' && consistency == false) { + htool::Logger::get_instance().log(LogLevel::ERROR, "Block tree consistency cannot be set to false if symmetry is not N."); // LCOV_EXCL_LINE + } + m_is_block_tree_consistent = consistency; + } // Getters char get_symmetry() const { return m_symmetry_type; } diff --git a/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_complex_double.cpp b/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_complex_double.cpp index 7f14656d..25def883 100644 --- a/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_complex_double.cpp +++ b/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_complex_double.cpp @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { std::cout << nr << " " << nc << " " << use_local_cluster << " " << epsilon << " " << use_dense_block_generator << " " << block_tree_consistency << "\n"; is_error = is_error || test_hmatrix_build, GeneratorTestComplexSymmetric>(nr, nc, use_local_cluster, 'N', 'N', epsilon, use_dense_block_generator, block_tree_consistency); - if (nr == nc) { + if (nr == nc && block_tree_consistency) { for (auto UPLO : {'U', 'L'}) { is_error = is_error || test_hmatrix_build, GeneratorTestComplexSymmetric>(nr, nr, use_local_cluster, 'S', UPLO, epsilon, use_dense_block_generator, block_tree_consistency); diff --git a/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_double.cpp b/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_double.cpp index 142f7b4d..f479dbcd 100644 --- a/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_double.cpp +++ b/tests/functional_tests/hmatrix/hmatrix_build/test_hmatrix_build_double.cpp @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { is_error = is_error || test_hmatrix_build(nr, nc, use_local_cluster, 'N', 'N', epsilon, use_dense_block_generator, block_tree_consistency); - if (nr == nc) { + if (nr == nc && block_tree_consistency) { for (auto UPLO : {'U', 'L'}) { std::cout << UPLO << "\n"; is_error = is_error || test_hmatrix_build(nr, nc, use_local_cluster, 'S', UPLO, epsilon, use_dense_block_generator, block_tree_consistency);