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: b4b87f039fef
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 28845df7baf2
Choose a head ref
  • 13 commits
  • 8 files changed
  • 1 contributor

Commits on Jun 10, 2019

  1. Copy the full SHA
    eda8cda View commit details
  2. Translate two more functions.

    pleroy committed Jun 10, 2019
    Copy the full SHA
    94de226 View commit details

Commits on Jun 11, 2019

  1. Copy the full SHA
    05a2dc9 View commit details
  2. Copy the full SHA
    3fb93e5 View commit details
  3. Copy the full SHA
    31193dd View commit details
  4. A test that seems to pass.

    pleroy committed Jun 11, 2019
    Copy the full SHA
    e7fbc6d View commit details
  5. Some reformating.

    pleroy committed Jun 11, 2019
    Copy the full SHA
    ac9f0dc View commit details

Commits on Jun 12, 2019

  1. Renaming.

    pleroy committed Jun 12, 2019
    Copy the full SHA
    0379665 View commit details
  2. A unit test with assertions.

    pleroy committed Jun 12, 2019
    Copy the full SHA
    2d37a8c View commit details
  3. A benchmark.

    pleroy committed Jun 12, 2019
    Copy the full SHA
    bcef8b0 View commit details
  4. Copy the full SHA
    fbcd627 View commit details
  5. Try to appease the linter.

    pleroy committed Jun 12, 2019
    Copy the full SHA
    88abecd View commit details

Commits on Jun 14, 2019

  1. Merge pull request #2200 from pleroy/Elliptic

    A straightforward translation of Fukushima's code for elliptic integrals
    pleroy authored Jun 14, 2019
    Copy the full SHA
    28845df View commit details
2 changes: 2 additions & 0 deletions benchmarks/benchmarks.vcxproj
Original file line number Diff line number Diff line change
@@ -9,8 +9,10 @@
<ClCompile Include="..\base\status.cpp" />
<ClCompile Include="..\ksp_plugin\planetarium.cpp" />
<ClCompile Include="..\numerics\cbrt.cpp" />
<ClCompile Include="..\numerics\elliptic_integrals.cpp" />
<ClCompile Include="..\numerics\fast_sin_cos_2π.cpp" />
<ClCompile Include="dynamic_frame.cpp" />
<ClCompile Include="elliptic_integrals_benchmark.cpp" />
<ClCompile Include="embedded_explicit_runge_kutta_nyström_integrator.cpp" />
<ClCompile Include="encoder.cpp" />
<ClCompile Include="ephemeris.cpp" />
6 changes: 6 additions & 0 deletions benchmarks/benchmarks.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -68,6 +68,12 @@
<ClCompile Include="encoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\numerics\elliptic_integrals.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="elliptic_integrals_benchmark.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="quantities.hpp">
51 changes: 51 additions & 0 deletions benchmarks/elliptic_integrals_benchmark.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

// .\Release\x64\benchmarks.exe --benchmark_repetitions=10 --benchmark_min_time=2 --benchmark_filter=Elbdj // NOLINT(whitespace/line_length)

#include <random>
#include <vector>

#include "benchmark/benchmark.h"
#include "numerics/elliptic_integrals.hpp"
#include "quantities/numbers.hpp"

namespace principia {
namespace numerics {

void BM_Elbdj(benchmark::State& state) {
constexpr int size = 20;

std::mt19937_64 random(42);
std::uniform_real_distribution<> distribution_phi(-10.0, 10.0);
std::uniform_real_distribution<> distribution_n(-10.0, 10.0);
std::uniform_real_distribution<> distribution_mc(0.0, 1.0);
std::vector<double> phis;
std::vector<double> ns;
std::vector<double> mcs;
for (int i = 0; i < size; ++i) {
phis.push_back(distribution_phi(random));
ns.push_back(distribution_n(random));
mcs.push_back(distribution_mc(random));
}

while (state.KeepRunningBatch(size * size * size)) {
double b;
double d;
double j;
for (double const phi : phis) {
double const phic = π / 2 - phi;
for (double const n : ns) {
for (double const mc : mcs) {
Elbdj(phi, phic, n, mc, b, d, j);
}
}
}
benchmark::DoNotOptimize(b);
benchmark::DoNotOptimize(d);
benchmark::DoNotOptimize(j);
}
}

BENCHMARK(BM_Elbdj);

} // namespace numerics
} // namespace principia
Loading