This commit is contained in:
2025-05-07 12:31:08 +03:00
parent cfe1fc8fab
commit b610a38682
4 changed files with 22 additions and 8 deletions

View File

@@ -9,8 +9,8 @@
int main()
{
// size_t nt = 3, np = 5, N = nt * np, i = 1;
size_t nt = 10, np = 20, N = nt * np, i = 1;
size_t nt = 30, np = 60, N = nt * np, i = 1;
// size_t nt = 10, np = 20, N = nt * np, i = 1;
double ts = std::numbers::pi / (nt + 1);
double ps = 2.0 * std::numbers::pi / (np + 1);
@@ -46,7 +46,8 @@ int main()
k = 1;
}
std::uniform_real_distribution<double> distr{-0.1, 0.1};
// std::uniform_real_distribution<double> distr{-0.1, 0.1};
std::normal_distribution<double> distr{0.0, 1.0};
std::random_device device;
std::mt19937 engine{device()};
@@ -57,7 +58,8 @@ int main()
});
size_t ntk = 3, npk = 6, nf = (ntk + 4) * (npk + 4);
int ntk = 24, npk = 29, nf = (ntk + 4) * (npk + 4);
// int ntk = 3, npk = 6, nf = (ntk + 4) * (npk + 4);
std::vector<double> tk(ntk + 8), pk(npk + 8), coeffs(nf);
ts = std::numbers::pi / (ntk + 1);
ps = 2.0 * std::numbers::pi / (npk + 1);
@@ -74,11 +76,23 @@ int main()
std::cout << "FIT EC = " << ec << "\n";
std::cout << "FIT RESI = " << rs << "\n";
ntk += 8;
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);
std::cout << "FIT EC = " << ec << "\n";
std::cout << "FIT RESI = " << rs << "\n";
std::cout << "NKNOTS: " << ntk << ", " << npk << "\n";
print_func(coeffs, "coeffs");
// print_func(tetha, "tetha");
// print_func(phi, "phi");
print_func(tk, "tetha_knots");
print_func(pk, "phi_knots");
print_func(func, "func");
std::cout << "\n\n";