...
This commit is contained in:
parent
b610a38682
commit
00cf1834e9
@ -176,8 +176,8 @@ int fitpack_sphere_smooth(const TethaT& tetha,
|
|||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto nt = std::ranges::size(tetha_knots);
|
int nt = std::ranges::size(tetha_knots);
|
||||||
const auto np = std::ranges::size(phi_knots);
|
int np = std::ranges::size(phi_knots);
|
||||||
|
|
||||||
if (nt < ntest) {
|
if (nt < ntest) {
|
||||||
std::ranges::fill_n(std::back_inserter(tetha_knots), ntest - nt, 0.0);
|
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>) {
|
if constexpr (std::ranges::contiguous_range<WeightT>) {
|
||||||
auto weight_ptr = const_cast<double*>(std::ranges::data(weight));
|
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,
|
sphere(&iopt, &m, tetha_ptr, phi_ptr, func_ptr, weight_ptr, &s_par, &nt, &np, &eps, &ntest, tetha_knots_ptr,
|
||||||
tetha_knots_ptr, &npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1,
|
&npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1, wrk2.data(), &lwrk2,
|
||||||
wrk2.data(), &lwrk2, iwrk.data(), &kwrk, &res);
|
iwrk.data(), &kwrk, &res);
|
||||||
// sphere(&iopt, &m, std::ranges::data(tetha), std::ranges::data(phi), std::ranges::data(func),
|
// 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),
|
// 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,
|
// &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 {
|
} else {
|
||||||
std::vector<double> weight_vec(m, weight);
|
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,
|
tetha_knots_ptr, &npest, phi_knots_ptr, std::ranges::data(coeffs), &resi2_sum, wrk1.data(), &lwrk1,
|
||||||
wrk2.data(), &lwrk2, iwrk.data(), &kwrk, &res);
|
wrk2.data(), &lwrk2, iwrk.data(), &kwrk, &res);
|
||||||
// res = sphere(&iopt, &m, std::ranges::data(tetha), std::ranges::data(phi), std::ranges::data(func),
|
// res = sphere(&iopt, &m, std::ranges::data(tetha), std::ranges::data(phi), std::ranges::data(func),
|
||||||
|
|||||||
@ -41,6 +41,7 @@ concept mcc_mount_state_c = requires(T t, const T t_const) {
|
|||||||
|
|
||||||
{ t.enter() } -> std::same_as<void>;
|
{ t.enter() } -> std::same_as<void>;
|
||||||
{ t.exit() } -> std::same_as<void>;
|
{ t.exit() } -> std::same_as<void>;
|
||||||
|
{ t.stop() } -> std::same_as<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace traits
|
} // namespace traits
|
||||||
|
|||||||
@ -63,4 +63,15 @@ protected:
|
|||||||
error_callback_t _errorCallback{[](const mount_state_error_t&) {}};
|
error_callback_t _errorCallback{[](const mount_state_error_t&) {}};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* */
|
||||||
|
class MccMountStateIDLE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::string_view ident() const
|
||||||
|
{
|
||||||
|
return "MCC-MOUNT-STATE-IDLE";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace mcc
|
} // namespace mcc
|
||||||
|
|||||||
@ -80,7 +80,7 @@ int main()
|
|||||||
npk += 8;
|
npk += 8;
|
||||||
std::ranges::fill(tk, -1);
|
std::ranges::fill(tk, -1);
|
||||||
std::ranges::fill(pk, -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 EC = " << ec << "\n";
|
||||||
std::cout << "FIT RESI = " << rs << "\n";
|
std::cout << "FIT RESI = " << rs << "\n";
|
||||||
@ -105,6 +105,12 @@ int main()
|
|||||||
tetha.resize(nt);
|
tetha.resize(nt);
|
||||||
phi.resize(np);
|
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(tk, pk, coeffs, tetha, phi, f_func);
|
||||||
// ec = mcc::fitpack::fitpack_eval_spl2d(pk, tk, coeffs, phi, tetha, f_func);
|
// ec = mcc::fitpack::fitpack_eval_spl2d(pk, tk, coeffs, phi, tetha, f_func);
|
||||||
std::cout << "EVAL EC = " << ec << "\n";
|
std::cout << "EVAL EC = " << ec << "\n";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user