From 00cf1834e9cf5faef2fab0d5a9084742eea18e15 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Tue, 13 May 2025 17:45:19 +0300 Subject: [PATCH] ... --- cxx/fitpack/fitpack.h | 12 ++++++------ cxx/mount.h | 1 + cxx/mount_state.h | 11 +++++++++++ cxx/tests/fitpack_test.cpp | 8 +++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/cxx/fitpack/fitpack.h b/cxx/fitpack/fitpack.h index 6c9b09c..369a25a 100644 --- a/cxx/fitpack/fitpack.h +++ b/cxx/fitpack/fitpack.h @@ -176,8 +176,8 @@ int fitpack_sphere_smooth(const TethaT& tetha, return 10; } - const auto nt = std::ranges::size(tetha_knots); - const auto np = std::ranges::size(phi_knots); + int nt = std::ranges::size(tetha_knots); + int np = std::ranges::size(phi_knots); if (nt < ntest) { std::ranges::fill_n(std::back_inserter(tetha_knots), ntest - nt, 0.0); @@ -217,9 +217,9 @@ int fitpack_sphere_smooth(const TethaT& tetha, if constexpr (std::ranges::contiguous_range) { auto weight_ptr = const_cast(std::ranges::data(weight)); - sphere(&iopt, &m, tetha_ptr, phi_ptr, func_ptr, weight_ptr, &s_par, &ntest, &npest, &eps, &ntest, - tetha_knots_ptr, &npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1, - wrk2.data(), &lwrk2, iwrk.data(), &kwrk, &res); + sphere(&iopt, &m, tetha_ptr, phi_ptr, func_ptr, weight_ptr, &s_par, &nt, &np, &eps, &ntest, tetha_knots_ptr, + &npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1, wrk2.data(), &lwrk2, + iwrk.data(), &kwrk, &res); // sphere(&iopt, &m, std::ranges::data(tetha), std::ranges::data(phi), std::ranges::data(func), // std::ranges::data(weight), &s_par, &ntest, &npest, &eps, &ntest, std::ranges::data(tetha_knots), // &npest, std::ranges::data(phi_knots), std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1, @@ -227,7 +227,7 @@ int fitpack_sphere_smooth(const TethaT& tetha, } else { std::vector weight_vec(m, weight); - sphere(&iopt, &m, tetha_ptr, phi_ptr, func_ptr, weight_vec.data(), &s_par, &ntest, &npest, &eps, &ntest, + sphere(&iopt, &m, tetha_ptr, phi_ptr, func_ptr, weight_vec.data(), &s_par, &nt, &np, &eps, &ntest, tetha_knots_ptr, &npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1, wrk2.data(), &lwrk2, iwrk.data(), &kwrk, &res); // res = sphere(&iopt, &m, std::ranges::data(tetha), std::ranges::data(phi), std::ranges::data(func), diff --git a/cxx/mount.h b/cxx/mount.h index 98717fa..4fbdc4d 100644 --- a/cxx/mount.h +++ b/cxx/mount.h @@ -41,6 +41,7 @@ concept mcc_mount_state_c = requires(T t, const T t_const) { { t.enter() } -> std::same_as; { t.exit() } -> std::same_as; + { t.stop() } -> std::same_as; }; } // namespace traits diff --git a/cxx/mount_state.h b/cxx/mount_state.h index 3c356b8..63c8661 100644 --- a/cxx/mount_state.h +++ b/cxx/mount_state.h @@ -63,4 +63,15 @@ protected: error_callback_t _errorCallback{[](const mount_state_error_t&) {}}; }; + +/* */ +class MccMountStateIDLE +{ +public: + std::string_view ident() const + { + return "MCC-MOUNT-STATE-IDLE"; + } +}; + } // namespace mcc diff --git a/cxx/tests/fitpack_test.cpp b/cxx/tests/fitpack_test.cpp index 0e5c13f..eda57dd 100644 --- a/cxx/tests/fitpack_test.cpp +++ b/cxx/tests/fitpack_test.cpp @@ -80,7 +80,7 @@ int main() npk += 8; std::ranges::fill(tk, -1); std::ranges::fill(pk, -1); - ec = mcc::fitpack::fitpack_sphere_smooth(tetha, phi, func, 1.0, 56000.0, ntk, npk, tk, pk, coeffs, rs); + ec = mcc::fitpack::fitpack_sphere_smooth(tetha, phi, func, 1.0, 1800.0, ntk, npk, tk, pk, coeffs, rs); std::cout << "FIT EC = " << ec << "\n"; std::cout << "FIT RESI = " << rs << "\n"; @@ -105,6 +105,12 @@ int main() tetha.resize(nt); phi.resize(np); + tk.resize(ntk); + pk.resize(npk); + + print_func(tetha, "TETHA:"); + print_func(phi, "PHI:"); + ec = mcc::fitpack::fitpack_eval_spl2d(tk, pk, coeffs, tetha, phi, f_func); // ec = mcc::fitpack::fitpack_eval_spl2d(pk, tk, coeffs, phi, tetha, f_func); std::cout << "EVAL EC = " << ec << "\n";