Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb888617403f
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a96c08b5ff7d
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Dec 3, 2020

  1. Copy the full SHA
    dadc8f4 View commit details
  2. Comment.

    pleroy committed Dec 3, 2020
    Copy the full SHA
    cc21db1 View commit details
  3. Comment.

    pleroy committed Dec 3, 2020
    Copy the full SHA
    47541d6 View commit details

Commits on Dec 5, 2020

  1. Merge pull request #2809 from pleroy/Check

    Fix tolerances for Linux and remove a check
    pleroy authored Dec 5, 2020
    Copy the full SHA
    a96c08b View commit details
Showing with 9 additions and 5 deletions.
  1. +2 −2 numerics/frequency_analysis_test.cpp
  2. +4 −2 numerics/piecewise_poisson_series_body.hpp
  3. +1 −1 numerics/poisson_series_test.cpp
  4. +2 −0 numerics/quadrature_body.hpp
4 changes: 2 additions & 2 deletions numerics/frequency_analysis_test.cpp
Original file line number Diff line number Diff line change
@@ -441,7 +441,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionNoSecular) {
? AllOf(Gt(2.0e-10 * Metre), Lt(5.3e-7 * Metre))
: ω_index == 2
? AllOf(Gt(2.9e-13 * Metre), Lt(2.6e-9 * Metre))
: AllOf(Gt(-1.0e-100 * Metre), Lt(7.1e-13 * Metre)))
: AllOf(Gt(-1.0e-100 * Metre), Lt(7.9e-13 * Metre)))
<< ω_index;
}
if (ω_index == ωs.size()) {
@@ -534,7 +534,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionSecular) {
EXPECT_THAT(
projection4(t_min + i * (t_max - t_min) / 100),
RelativeErrorFrom(series(t_min + i * (t_max - t_min) / 100),
AllOf(Ge(0), Lt(5.2e-14))));
AllOf(Ge(0), Lt(6.1e-14))));
}
}

6 changes: 4 additions & 2 deletions numerics/piecewise_poisson_series_body.hpp
Original file line number Diff line number Diff line change
@@ -98,11 +98,13 @@ operator()(Instant const& t) const {
// If t is an element of bounds_, the returned iterator points to the next
// element. Otherwise it points to the upper bound of the interval to which
// t belongs.
// TODO(phl): There may be a faster search if we assume that the buckets are
// quasi-linear in t.
auto const it = std::upper_bound(bounds_.cbegin(), bounds_.cend(), t);
CHECK(it != bounds_.cbegin())
DCHECK(it != bounds_.cbegin())
<< "Unexpected result looking up " << t << " in "
<< bounds_.front() << " .. " << bounds_.back();
CHECK(it != bounds_.cend())
DCHECK(it != bounds_.cend())
<< t << " is outside of " << bounds_.front() << " .. " << bounds_.back();
return series_[it - bounds_.cbegin() - 1](t) + addend;
}
2 changes: 1 addition & 1 deletion numerics/poisson_series_test.cpp
Original file line number Diff line number Diff line change
@@ -271,7 +271,7 @@ TEST_F(PoissonSeriesTest, InnerProduct) {
apodization::Hann<HornerEvaluator>(t_min, t_max),
t_min,
t_max),
AlmostEquals(-381.25522770148542400, 3, 7));
AlmostEquals(-381.25522770148542400, 0, 7));
}

TEST_F(PoissonSeriesTest, PoorlyConditionedInnerProduct) {
2 changes: 2 additions & 0 deletions numerics/quadrature_body.hpp
Original file line number Diff line number Diff line change
@@ -227,6 +227,8 @@ ClenshawCurtisImplementation(
}
f_cos_N⁻¹π[N] = f_cos_N⁻¹π_bit_reversed[0];

// TODO(phl): We could save some time by implementing a proper cosine
// transform.
auto const fft = std::make_unique<FastFourierTransform<Value, Angle, 2 * N>>(
f_cos_N⁻¹π, N⁻¹π);
auto const& a = *fft;