Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Sep 7, 2023
1 parent 560038e commit f10d16a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/htool/testing/generator_input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ void generate_random_scalar(std::complex<T> &coefficient) {
coefficient.imag(dist(mersenne_engine));
}

template <>
void generate_random_scalar(int &coefficient) {
int lower_bound = 0;
int upper_bound = 10000;
std::random_device rd;
std::mt19937 mersenne_engine(rd());
std::uniform_int_distribution<int> dist(lower_bound, upper_bound);
coefficient = dist(mersenne_engine);
}
// template <>
// void generate_random_scalar(int &coefficient) {
// int lower_bound = 0;
// int upper_bound = 10000;
// std::random_device rd;
// std::mt19937 mersenne_engine(rd());
// std::uniform_int_distribution<int> dist(lower_bound, upper_bound);
// coefficient = dist(mersenne_engine);
// }

} // namespace htool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplex>(number_of_rows, number_of_columns, number_of_right_hand_side, use_permutation, 'N', 'N', operation, offdiagonal_approximation, data_type, epsilon);
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplexSymmetric>(number_of_rows, number_of_columns, number_of_right_hand_side, use_permutation, 'S', 'L', operation, offdiagonal_approximation, data_type, epsilon);
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplexSymmetric>(number_of_rows, number_of_columns, number_of_right_hand_side, use_permutation, 'S', 'U', operation, offdiagonal_approximation, data_type, epsilon);
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplexHermitian>(number_of_rows, number_of_columns, number_of_right_hand_side, use_permutation, 'H', 'L', operation, offdiagonal_approximation, data_type, epsilon);
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplexHermitian>(number_of_rows, number_of_columns, number_of_right_hand_side, use_permutation, 'H', 'U', operation, offdiagonal_approximation, data_type, epsilon);

// Rectangular matrix
is_error = is_error || test_distributed_operator<std::complex<double>, GeneratorTestComplex>(number_of_rows_increased, number_of_columns, number_of_right_hand_side, use_permutation, 'N', 'N', operation, offdiagonal_approximation, data_type, epsilon);
Expand Down

0 comments on commit f10d16a

Please sign in to comment.