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

Commits on Jun 12, 2019

  1. Copy the full SHA
    0060f6c View commit details
  2. One more function.

    pleroy committed Jun 12, 2019

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    18308b4 View commit details
  3. Start converting Elk.

    pleroy committed Jun 12, 2019
    Copy the full SHA
    4f12642 View commit details

Commits on Jun 13, 2019

  1. Complete translation.

    pleroy committed Jun 13, 2019
    Copy the full SHA
    47780e4 View commit details
  2. Fix compilation errors.

    pleroy committed Jun 13, 2019
    Copy the full SHA
    fc9e414 View commit details
  3. Copy the full SHA
    3a039aa View commit details
  4. Protocol buffer and parsing.

    pleroy committed Jun 13, 2019
    Copy the full SHA
    b042987 View commit details
  5. The test passes.

    pleroy committed Jun 13, 2019
    Copy the full SHA
    a0d86b5 View commit details
  6. Copy the full SHA
    433ea9d View commit details
  7. A benchmark.

    pleroy committed Jun 13, 2019
    Copy the full SHA
    eef895b View commit details

Commits on Jun 14, 2019

  1. Lint and reference.

    pleroy committed Jun 14, 2019
    Copy the full SHA
    235b00c View commit details
  2. Merge.

    pleroy committed Jun 14, 2019
    Copy the full SHA
    bab12f0 View commit details
  3. A fix.

    pleroy committed Jun 14, 2019
    Copy the full SHA
    7e1b55c View commit details
  4. Project file.

    pleroy committed Jun 14, 2019
    Copy the full SHA
    4959efe View commit details
  5. More linting.

    pleroy committed Jun 14, 2019
    Copy the full SHA
    c88c4cc View commit details

Commits on Jun 15, 2019

  1. After egg's review.

    pleroy committed Jun 15, 2019
    Copy the full SHA
    974dc66 View commit details
  2. Merge pull request #2201 from pleroy/EllipticFunctions

    A straightforward translation of Fukushima's code for elliptic functions
    pleroy authored Jun 15, 2019
    Copy the full SHA
    a22abab View commit details
2 changes: 2 additions & 0 deletions benchmarks/benchmarks.vcxproj
Original file line number Diff line number Diff line change
@@ -10,9 +10,11 @@
<ClCompile Include="..\ksp_plugin\planetarium.cpp" />
<ClCompile Include="..\numerics\cbrt.cpp" />
<ClCompile Include="..\numerics\elliptic_integrals.cpp" />
<ClCompile Include="..\numerics\elliptic_functions.cpp" />
<ClCompile Include="..\numerics\fast_sin_cos_2π.cpp" />
<ClCompile Include="dynamic_frame.cpp" />
<ClCompile Include="elliptic_integrals_benchmark.cpp" />
<ClCompile Include="elliptic_functions_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
@@ -74,6 +74,12 @@
<ClCompile Include="elliptic_integrals_benchmark.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="elliptic_functions_benchmark.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\numerics\elliptic_functions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="quantities.hpp">
45 changes: 45 additions & 0 deletions benchmarks/elliptic_functions_benchmark.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

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

#include <random>
#include <vector>

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

namespace principia {
namespace numerics {

void BM_Gscd(benchmark::State& state) {
constexpr int size = 100;

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

while (state.KeepRunningBatch(size * size)) {
double s;
double c;
double d;
for (double const u : us) {
for (double const mc : mcs) {
Gscd(u, mc, s, c, d);
}
}
benchmark::DoNotOptimize(s);
benchmark::DoNotOptimize(c);
benchmark::DoNotOptimize(d);
}
}

BENCHMARK(BM_Gscd);

} // namespace numerics
} // namespace principia
Loading