This commit is contained in:
Timur A. Fatkhullin 2025-05-13 17:45:19 +03:00
parent b610a38682
commit 00cf1834e9
4 changed files with 25 additions and 7 deletions

View File

@ -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<WeightT>) {
auto weight_ptr = const_cast<double*>(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<double> 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),

View File

@ -41,6 +41,7 @@ concept mcc_mount_state_c = requires(T t, const T t_const) {
{ t.enter() } -> std::same_as<void>;
{ t.exit() } -> std::same_as<void>;
{ t.stop() } -> std::same_as<void>;
};
} // namespace traits

View File

@ -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

View File

@ -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";