Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Jul 17, 2024
1 parent 26fea03 commit bbbea9a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions functions/accurate_table_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ absl::StatusOr<cpp_rational> StehléZimmermannSimultaneousFullSearch(
cpp_rational const& starting_argument);

// Same as above, but performs searches in parallel using the corresponding
// |functions|, |polynomials|, |rests|, and |starting_arguments|. Returns the
// results in the same order as the parameters.
// |polynomials|, |rests|, and |starting_arguments|. Returns the results in the
// same order as the parameters.
template<std::int64_t zeroes>
std::vector<absl::StatusOr<cpp_rational>>
StehléZimmermannSimultaneousMultisearch(
Expand Down
40 changes: 21 additions & 19 deletions functions/accurate_table_generator_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <limits>
#include <memory>
#include <thread>
#include <utility>
#include <vector>

#include "base/bits.hpp"
Expand All @@ -19,7 +20,6 @@
#include "glog/logging.h"
#include "numerics/fixed_arrays.hpp"
#include "numerics/lattices.hpp"
#include "numerics/matrix_computations.hpp"
#include "numerics/matrix_views.hpp"
#include "quantities/elementary_functions.hpp"
#include "quantities/quantities.hpp"
Expand All @@ -36,7 +36,6 @@ using namespace principia::base::_thread_pool;
using namespace principia::geometry::_interval;
using namespace principia::numerics::_fixed_arrays;
using namespace principia::numerics::_lattices;
using namespace principia::numerics::_matrix_computations;
using namespace principia::numerics::_matrix_views;
using namespace principia::quantities::_elementary_functions;
using namespace principia::quantities::_quantities;
Expand Down Expand Up @@ -556,23 +555,26 @@ void StehléZimmermannSimultaneousStreamingMultisearch(

std::vector<std::future<void>> futures;
for (std::int64_t i = 0; i < starting_arguments.size(); ++i) {
futures.push_back(search_pool.Add(
[i, &callback, &functions, &polynomials, &rests, &starting_arguments]()
{
auto const& starting_argument = starting_arguments[i];
LOG(INFO) << "Starting search around " << starting_argument;
auto status_or_final_argument =
StehléZimmermannSimultaneousFullSearch<zeroes>(
functions, polynomials[i], rests[i], starting_argument);
if (status_or_final_argument.ok()) {
LOG(INFO) << "Finished search around " << starting_argument
<< ", found " << status_or_final_argument.value();
} else {
LOG(WARNING) << "Search around " << starting_argument
<< " failed with" << status_or_final_argument.status();
}
callback(i, std::move(status_or_final_argument));
}));
futures.push_back(search_pool.Add([i,
&callback,
&functions,
&polynomials,
&rests,
&starting_arguments]() {
auto const& starting_argument = starting_arguments[i];
LOG(INFO) << "Starting search around " << starting_argument;
auto status_or_final_argument =
StehléZimmermannSimultaneousFullSearch<zeroes>(
functions, polynomials[i], rests[i], starting_argument);
if (status_or_final_argument.ok()) {
LOG(INFO) << "Finished search around " << starting_argument
<< ", found " << status_or_final_argument.value();
} else {
LOG(WARNING) << "Search around " << starting_argument << " failed with"
<< status_or_final_argument.status();
}
callback(i, std::move(status_or_final_argument));
}));
}

for (auto& future : futures) {
Expand Down
2 changes: 1 addition & 1 deletion functions/accurate_table_generator_test.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "functions/accurate_table_generator.hpp"

#include <algorithm>
#include <cmath>
#include <string>
#include <string_view>
#include <tuple>
#include <vector>

#include "absl/strings/strip.h"
Expand Down

0 comments on commit bbbea9a

Please sign in to comment.