From 95a5d28e00e6687e5046eb91170ed923f2824bb7 Mon Sep 17 00:00:00 2001 From: Dario Izzo Date: Wed, 2 Oct 2024 09:25:53 +0200 Subject: [PATCH] BUG: corrected in benchmarks for gradient sign --- benchmark/leg_sims_flanagan_benchmark.cpp | 6 +++--- benchmark/leg_sims_flanagan_udp_bench.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmark/leg_sims_flanagan_benchmark.cpp b/benchmark/leg_sims_flanagan_benchmark.cpp index 428e0bcd..d2d26f95 100644 --- a/benchmark/leg_sims_flanagan_benchmark.cpp +++ b/benchmark/leg_sims_flanagan_benchmark.cpp @@ -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); @@ -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); @@ -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); diff --git a/benchmark/leg_sims_flanagan_udp_bench.hpp b/benchmark/leg_sims_flanagan_udp_bench.hpp index fd6e01d6..b6a9f7ca 100644 --- a/benchmark/leg_sims_flanagan_udp_bench.hpp +++ b/benchmark/leg_sims_flanagan_udp_bench.hpp @@ -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;