Skip to content

Commit

Permalink
BUG: corrected in benchmarks for gradient sign
Browse files Browse the repository at this point in the history
  • Loading branch information
darioizzo committed Oct 2, 2024
1 parent 57280c9 commit 95a5d28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions benchmark/leg_sims_flanagan_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void perform_test_speed(unsigned N, unsigned nseg, unsigned pop_size)
uda.set_ftol_abs(1e-8);
uda.set_maxeval(1000);
pagmo::algorithm algo{uda};
algo.set_verbosity(0u);
//algo.set_verbosity(0u);

// The initial positions
kep3::udpla::vsop2013 udpla_earth("earth_moon", 1e-2);
Expand All @@ -63,7 +63,7 @@ void perform_test_speed(unsigned N, unsigned nseg, unsigned pop_size)
kep3::planet jupiter{udpla_jupiter};
double count_a = 0;
double count_n = 0;
std::cout << std::endl;
std::cout << "\n";
for (auto i = 0u; i < N; ++i) {
// And some epochs / tofs.
const double tof_days = tof_d(rng_engine);
Expand Down Expand Up @@ -143,7 +143,7 @@ void perform_test_convergence(unsigned N, unsigned nseg)
kep3::planet jupiter{udpla_jupiter};
unsigned count_a = 0;
unsigned count_n = 0;
std::cout << std::endl;
std::cout << "\n";
for (auto i = 0u; i < N; ++i) {
// And some epochs / tofs.
const double tof_days = tof_d(rng_engine);
Expand Down
6 changes: 3 additions & 3 deletions benchmark/leg_sims_flanagan_udp_bench.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ struct sf_bench_udp {

// [1:4,-1] - fitness gradient, position mismatch w.r.t. mf
xt::view(xgradient, xt::range(1u, 4u), xt::range(m_nseg * 3u + 1u, m_nseg * 3u + 2u))
= -xt::view(xgrad_mc_xf, xt::range(0u, 3u), xt::range(6u, 7u)) / kep3::AU; // mf
= xt::view(xgrad_mc_xf, xt::range(0u, 3u), xt::range(6u, 7u)) / kep3::AU; // mf
// [4:7,-1] - fitness gradient - velocity mismatch w.r.t. mf
xt::view(xgradient, xt::range(4u, 7u), xt::range(m_nseg * 3u + 1u, m_nseg * 3u + 2u))
= -xt::view(xgrad_mc_xf, xt::range(3u, 6u), xt::range(6u, 7u)) / kep3::EARTH_VELOCITY; // mf
= xt::view(xgrad_mc_xf, xt::range(3u, 6u), xt::range(6u, 7u)) / kep3::EARTH_VELOCITY; // mf
// [7:8,-1] - fitness gradient - mass mismatch w.r.t. mf
xt::view(xgradient, xt::range(7u, 8u), xt::range(m_nseg * 3u + 1u, m_nseg * 3u + 2u))
= -xt::view(xgrad_mc_xf, xt::range(6u, 7u), xt::range(6u, 7u)) / 1e8; // mf
= xt::view(xgrad_mc_xf, xt::range(6u, 7u), xt::range(6u, 7u)) / 1e8; // mf

// Units for the tof
xt::view(xgradient, xt::all(), xt::range(m_nseg * 3u, m_nseg * 3u + 1u)) *= kep3::DAY2SEC;
Expand Down

0 comments on commit 95a5d28

Please sign in to comment.