mcc_bsplines.h: fixes (use right macro names for the Fortran subroutines)

This commit is contained in:
2026-05-23 11:17:51 +03:00
parent 445a029a2f
commit e9c329d88f
2 changed files with 143 additions and 143 deletions

View File

@@ -21,7 +21,7 @@ include(FortranCInterface)
FortranCInterface_HEADER(
FortranCInterface.h
MACRO_NAMESPACE "FC_"
SYMBOL_NAMESPACE "FC_"
SYMBOL_NAMESPACE "fitpack_"
#SYMBOL_NAMESPACE ""
# SYMBOLS ${func_str}
SYMBOLS ${func_name}

View File

@@ -8,10 +8,10 @@
extern "C" {
void FC_GLOBAL(insert, INSERT)(int*, double*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
/* fitting on XY-grid */
void FC_GLOBAL(surfit, SURFIT)(int* iopt,
void fitpack_surfit(int* iopt,
// void surfit(int* iopt,
int* m,
double* x,
@@ -44,7 +44,7 @@ void FC_GLOBAL(surfit, SURFIT)(int* iopt,
int* ier);
/* XY-grid */
void FC_GLOBAL(bispev, BISPEV)(double* tx,
void fitpack_bispev(double* tx,
// void bispev(double* tx,
int* nx,
double* ty,
@@ -64,7 +64,7 @@ void FC_GLOBAL(bispev, BISPEV)(double* tx,
int* ier);
/* XY-grid */
void FC_GLOBAL(parder, PARDER)(double* tx,
void fitpack_parder(double* tx,
// void parder(double* tx,
int* nx,
double* ty,
@@ -86,7 +86,7 @@ void FC_GLOBAL(parder, PARDER)(double* tx,
int* ier);
/* fitting on sphere */
void FC_GLOBAL(sphere, SPHERE)(int* iopt,
void fitpack_sphere(int* iopt,
// void sphere(int* iopt,
int* m,
double* teta,
@@ -112,7 +112,7 @@ void FC_GLOBAL(sphere, SPHERE)(int* iopt,
int* ier);
/* calculation for set of points (not grid) */
void FC_GLOBAL(bispeu, BISPEU)(double* tx,
void fitpack_bispeu(double* tx,
// void bispeu(double* tx,
int* nx,
double* ty,
@@ -130,7 +130,7 @@ void FC_GLOBAL(bispeu, BISPEU)(double* tx,
/* calculation for set of points (not grid) */
void FC_GLOBAL(pardeu, PARDEU)(double* tx,
void fitpack_pardeu(double* tx,
// void pardeu(double* tx,
int* nx,
double* ty,
@@ -265,15 +265,15 @@ int fitpack_sphere_smooth(const TethaT& tetha,
if constexpr (std::ranges::contiguous_range<WeightT>) {
auto weight_ptr = const_cast<double*>(std::ranges::data(weight));
FC_GLOBAL(sphere, 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);
fitpack_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);
} else {
std::vector<double> weight_vec(m, weight);
FC_GLOBAL(sphere, 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);
fitpack_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);
}
@@ -367,8 +367,8 @@ int fitpack_eval_spl2d_grid(const TXT& tx,
auto x_ptr = const_cast<double*>(std::ranges::data(x));
auto y_ptr = const_cast<double*>(std::ranges::data(y));
FC_GLOBAL(bispev, BISPEV)(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, x_ptr, &mx, y_ptr, &my,
std::ranges::data(func), wrk.data(), &lwrk, iwrk.data(), &kwrk, &ier);
fitpack_bispev(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, x_ptr, &mx, y_ptr, &my, std::ranges::data(func),
wrk.data(), &lwrk, iwrk.data(), &kwrk, &ier);
return ier;
}
@@ -431,8 +431,8 @@ int fitpack_eval_spl2d(const TXT& tx,
int lwrk = kx + ky + 2;
std::vector<double> wrk(lwrk);
FC_GLOBAL(bispeu, BISPEU)(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, x_ptr, y_ptr, std::ranges::data(func),
&m, wrk.data(), &lwrk, &ier);
fitpack_bispeu(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, x_ptr, y_ptr, std::ranges::data(func), &m,
wrk.data(), &lwrk, &ier);
// bispeu(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, x_ptr, y_ptr, std::ranges::data(func), &m, wrk.data(),
// &lwrk, &ier);
@@ -538,7 +538,7 @@ int fitpack_parder_spl2d_grid(const TXT& tx,
int ier = 0;
FC_GLOBAL(parder, PARDER)(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, &dx, &dy, x_ptr, &mx, y_ptr, &my,
fitpack_parder(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, &dx, &dy, x_ptr, &mx, y_ptr, &my,
std::ranges::data(pder), wrk.data(), &lwrk, iwrk.data(), &kwrk, &ier);
return ier;
@@ -606,8 +606,8 @@ int fitpack_parder_spl2d(const TXT& tx,
int kwrk = 2 * m;
std::vector<int> iwrk(kwrk);
FC_GLOBAL(pardeu, PARDEU)(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, &dx, &dy, x_ptr, y_ptr,
std::ranges::data(pder), &m, wrk.data(), &lwrk, iwrk.data(), &kwrk, &ier);
fitpack_pardeu(tx_ptr, &ntx, ty_ptr, &nty, coeffs_ptr, &kx, &ky, &dx, &dy, x_ptr, y_ptr, std::ranges::data(pder),
&m, wrk.data(), &lwrk, iwrk.data(), &kwrk, &ier);
return ier;
}