fitpack
Modern Fortran library for curve and surface fitting with splines
Loading...
Searching...
No Matches
fpPolar.hpp
Go to the documentation of this file.
1/***************************************************************************************************
2! ____________________ ___ ________ __
3! / ____/ _/_ __/ __ \/ | / ____/ //_/
4! / /_ / / / / / /_/ / /| |/ / / ,<
5! / __/ _/ / / / / ____/ ___ / /___/ /| |
6! /_/ /___/ /_/ /_/ /_/ |_\____/_/ |_|
7!
8! A Curve Fitting Package
9!
10! fpPolar.hpp (class fpPolar)
11!> @brief Standalone C++ wrapper for fitpack_polar (no fortran-arrays dependency)
12!
13! @author Federico Perini
14! @date 2026-08-27
15!
16! References :
17! - C. De Boor, "On calculating with b-splines", J Approx Theory 6 (1972) 50-62
18! - M. G. Cox, "The numerical evaluation of b-splines", J Inst Maths Applics 10 (1972) 134-149
19! - P. Dierckx, "Curve and surface fitting with splines", Monographs on numerical analysis,
20! Oxford university press, 1993.
21!
22! **************************************************************************************************/
23
24#ifndef FPPOLAR_HPP_INCLUDED
25#define FPPOLAR_HPP_INCLUDED
26
27#include "fitpack_config.h"
28
29#if HAVE_FXARRAY
30#include "fxArrays.hpp"
31#endif
32
33#include "fitpack_polar_c.h"
34#include "fpFitter.hpp"
35#include <string>
36#include <vector>
37#include <cstdint>
38#include <memory>
39#include <stdexcept>
40#include <variant>
41#include <optional>
42#include <array>
43
44static_assert(sizeof(fitpack_polar_c) == sizeof(fitpack_fitter_c),
45 "C descriptor layout mismatch: fitpack_polar_c vs fitpack_fitter_c");
46
55class fpPolar : public fpFitter {
56public:
57 // ===========================================================================================
58 // Constructors and Destructor
59 // ===========================================================================================
60
65 fitpack_polar_c_allocate(as<fitpack_polar_c>(), nullptr);
66 }
67
71 ~fpPolar() override {
72 fitpack_polar_c_destroy(as<fitpack_polar_c>(), nullptr);
73 }
74
78 fpPolar(const fpPolar& other) : fpFitter(NoAlloc{}) {
79 *as<fitpack_polar_c>() = fitpack_polar_c_null;
80 fitpack_polar_c_copy(as<fitpack_polar_c>(), other.as<fitpack_polar_c>(), false, nullptr);
81 }
82
86 fpPolar& operator=(const fpPolar& other) {
87 if (this != &other) {
88 fitpack_polar_c_destroy(as<fitpack_polar_c>(), nullptr);
89 fitpack_polar_c_copy(as<fitpack_polar_c>(), other.as<fitpack_polar_c>(), false, nullptr);
90 }
91 return *this;
92 }
93
97 fpPolar(fpPolar&& other) noexcept : fpFitter(NoAlloc{}) {
98 *as<fitpack_polar_c>() = fitpack_polar_c_null;
99 fitpack_polar_c_move_alloc(as<fitpack_polar_c>(), other.as<fitpack_polar_c>(), nullptr);
100 }
101
105 fpPolar& operator=(fpPolar&& other) noexcept {
106 if (this != &other) {
107 fitpack_polar_c_destroy(as<fitpack_polar_c>(), nullptr);
108 fitpack_polar_c_move_alloc(as<fitpack_polar_c>(), other.as<fitpack_polar_c>(), nullptr);
109 }
110 return *this;
111 }
112
116 explicit fpPolar(fitpack_polar_c& c_wrapper, bool move = false) : fpFitter(NoAlloc{}) {
117 if (move) {
118 fitpack_polar_c_move_alloc(as<fitpack_polar_c>(), &c_wrapper, nullptr);
119 } else {
120 *as<fitpack_polar_c>() = fitpack_polar_c_null;
121 fitpack_polar_c_copy(as<fitpack_polar_c>(), &c_wrapper, false, nullptr);
122 }
123 }
124
130 explicit fpPolar(fitpack_polar_c& c_wrapper, ViewTag) : fpFitter(NoAlloc{}) {
131 *as<fitpack_polar_c>() = c_wrapper;
132 as<fitpack_polar_c>()->is_pointer = true;
133 }
134
135 // ===========================================================================================
136 // Utility Methods
137 // ===========================================================================================
138
142 bool is_allocated() const override {
143 return as<fitpack_polar_c>()->cptr != nullptr;
144 }
145
149 bool is_pointer() const override {
150 return as<fitpack_polar_c>()->is_pointer;
151 }
152
156 const char* c_type_name() const override {
157 return fitpack_polar_c_c_type_name(*as<fitpack_polar_c>());
158 }
159
164 const char* cpp_type_name() const override {
165 return "fpPolar";
166 }
167
171 fitpack_polar_c& c_handle() {
172 return *as<fitpack_polar_c>();
173 }
174
178 const fitpack_polar_c& c_handle() const {
179 return *as<fitpack_polar_c>();
180 }
181
191 return fpPolar(NoAlloc{});
192 }
193
198 return static_cast<fpFitter&>(*this);
199 }
200 const fpFitter& as_parent() const {
201 return static_cast<const fpFitter&>(*this);
202 }
203
204 // ===========================================================================================
205 // Method Wrappers (standalone — no fxArray dependency)
206 // ===========================================================================================
207
211 virtual void new_points(std::vector<double>& x, std::vector<double>& y, std::vector<double>& z, fitpack_polar_boundary_fn boundary, double* w = nullptr, int32_t* boundary_bc = nullptr) {
212 int32_t n = static_cast<int32_t>(x.size());
213 fitpack_polar_c_new_points(as<fitpack_polar_c>(), n, x.data(), y.data(), z.data(), boundary, w, boundary_bc);
214 }
215
216
220 virtual int32_t new_fit(std::vector<double>& x, std::vector<double>& y, std::vector<double>& z, fitpack_polar_boundary_fn boundary, double* w = nullptr, int32_t* boundary_bc = nullptr, double* smoothing = nullptr) {
221 int32_t n = static_cast<int32_t>(x.size());
222 return fitpack_polar_c_new_fit(as<fitpack_polar_c>(), n, x.data(), y.data(), z.data(), boundary, w, boundary_bc, smoothing);
223 }
224
225
226 virtual int32_t fit(double* smoothing = nullptr, bool* keep_knots = nullptr) {
227 return fitpack_polar_c_fit(as<fitpack_polar_c>(), smoothing, keep_knots);
228 }
229
230 virtual int32_t least_squares(double* smoothing = nullptr, bool* reset_knots = nullptr) {
231 return fitpack_polar_c_least_squares(as<fitpack_polar_c>(), smoothing, reset_knots);
232 }
233
234 virtual int32_t interpolate(bool* reset_knots = nullptr) {
235 return fitpack_polar_c_interpolate(as<fitpack_polar_c>(), reset_knots);
236 }
237
238 virtual double eval(double x, double y, int32_t* ierr = nullptr) {
239 return fitpack_polar_c_polr_eval_one(as<fitpack_polar_c>(), x, y, ierr);
240 }
241
245 virtual std::vector<double> eval(std::vector<double>& x, std::vector<double>& y, int32_t* ierr = nullptr) {
246 int32_t n = static_cast<int32_t>(x.size());
247 std::vector<double> result(n);
248 int32_t n_result = 0;
249 fitpack_polar_c_polr_eval_many(as<fitpack_polar_c>(), n, x.data(), y.data(), ierr, result.data(), &n_result, n);
250 result.resize(n_result);
251 return result;
252 }
253
254
255 int32_t comm_size() const override {
256 return fitpack_polar_c_comm_size(as<fitpack_polar_c>());
257 }
258
262 void comm_pack(std::vector<double>& buffer) const override {
263 int32_t n = static_cast<int32_t>(buffer.size());
264 fitpack_polar_c_comm_pack(as<fitpack_polar_c>(), n, buffer.data());
265 }
266
267
271 void comm_expand(std::vector<double>& buffer) override {
272 int32_t n = static_cast<int32_t>(buffer.size());
273 fitpack_polar_c_comm_expand(as<fitpack_polar_c>(), n, buffer.data());
274 }
275
276
277 double mse() const override {
278 return fitpack_polar_c_mse(as<fitpack_polar_c>());
279 }
280
281 int32_t core_comm_size() const override {
282 return fitpack_polar_c_core_comm_size(as<fitpack_polar_c>());
283 }
284
288 void core_comm_pack(std::vector<double>& buffer) const override {
289 int32_t n = static_cast<int32_t>(buffer.size());
290 fitpack_polar_c_core_comm_pack(as<fitpack_polar_c>(), n, buffer.data());
291 }
292
293
297 void core_comm_expand(std::vector<double>& buffer) override {
298 int32_t n = static_cast<int32_t>(buffer.size());
299 fitpack_polar_c_core_comm_expand(as<fitpack_polar_c>(), n, buffer.data());
300 }
301
302
303 void destroy_base() override {
304 fitpack_polar_c_destroy_base(as<fitpack_polar_c>());
305 }
306
307 // ===========================================================================================
308 // Component Array Accessors
309 // ===========================================================================================
310
315 std::vector<double> x_vector() const {
316 double* raw = nullptr;
317 int64_t extents[1] = {0};
318 fitpack_polar_c_getcomp_x(as<fitpack_polar_c>(), &raw, extents);
319 const int64_t total = extents[0];
320 if (raw == nullptr || total <= 0) return {};
321 const double* first = reinterpret_cast<const double*>(raw);
322 return std::vector<double>(first, first + total);
323 }
324
325#if HAVE_FXARRAY
338 fxArray<double> x() const {
339 double* raw = nullptr;
340 int64_t extents[1] = {0};
341 fitpack_polar_c_getcomp_x(as<fitpack_polar_c>(), &raw, extents);
342 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
343 for (int k = 0; k < 1; ++k) {
344 bounds[2 * k] = 1;
345 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
346 }
347 array_c descr = array_c_null;
348 array_c_from_ptr(&descr, "x", static_cast<void*>(raw),
349 getCFITypeFlag<double>(),
350 static_cast<FX_SIZE>(sizeof(double)),
351 static_cast<FX_RANK>(1), bounds);
352 return fxArray<double>(descr);
353 }
354#endif // HAVE_FXARRAY
355
360 std::vector<double> y_vector() const {
361 double* raw = nullptr;
362 int64_t extents[1] = {0};
363 fitpack_polar_c_getcomp_y(as<fitpack_polar_c>(), &raw, extents);
364 const int64_t total = extents[0];
365 if (raw == nullptr || total <= 0) return {};
366 const double* first = reinterpret_cast<const double*>(raw);
367 return std::vector<double>(first, first + total);
368 }
369
370#if HAVE_FXARRAY
383 fxArray<double> y() const {
384 double* raw = nullptr;
385 int64_t extents[1] = {0};
386 fitpack_polar_c_getcomp_y(as<fitpack_polar_c>(), &raw, extents);
387 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
388 for (int k = 0; k < 1; ++k) {
389 bounds[2 * k] = 1;
390 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
391 }
392 array_c descr = array_c_null;
393 array_c_from_ptr(&descr, "y", static_cast<void*>(raw),
394 getCFITypeFlag<double>(),
395 static_cast<FX_SIZE>(sizeof(double)),
396 static_cast<FX_RANK>(1), bounds);
397 return fxArray<double>(descr);
398 }
399#endif // HAVE_FXARRAY
400
405 std::vector<double> z_vector() const {
406 double* raw = nullptr;
407 int64_t extents[1] = {0};
408 fitpack_polar_c_getcomp_z(as<fitpack_polar_c>(), &raw, extents);
409 const int64_t total = extents[0];
410 if (raw == nullptr || total <= 0) return {};
411 const double* first = reinterpret_cast<const double*>(raw);
412 return std::vector<double>(first, first + total);
413 }
414
415#if HAVE_FXARRAY
428 fxArray<double> z() const {
429 double* raw = nullptr;
430 int64_t extents[1] = {0};
431 fitpack_polar_c_getcomp_z(as<fitpack_polar_c>(), &raw, extents);
432 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
433 for (int k = 0; k < 1; ++k) {
434 bounds[2 * k] = 1;
435 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
436 }
437 array_c descr = array_c_null;
438 array_c_from_ptr(&descr, "z", static_cast<void*>(raw),
439 getCFITypeFlag<double>(),
440 static_cast<FX_SIZE>(sizeof(double)),
441 static_cast<FX_RANK>(1), bounds);
442 return fxArray<double>(descr);
443 }
444#endif // HAVE_FXARRAY
445
450 std::vector<double> u_vector() const {
451 double* raw = nullptr;
452 int64_t extents[1] = {0};
453 fitpack_polar_c_getcomp_u(as<fitpack_polar_c>(), &raw, extents);
454 const int64_t total = extents[0];
455 if (raw == nullptr || total <= 0) return {};
456 const double* first = reinterpret_cast<const double*>(raw);
457 return std::vector<double>(first, first + total);
458 }
459
460#if HAVE_FXARRAY
473 fxArray<double> u() const {
474 double* raw = nullptr;
475 int64_t extents[1] = {0};
476 fitpack_polar_c_getcomp_u(as<fitpack_polar_c>(), &raw, extents);
477 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
478 for (int k = 0; k < 1; ++k) {
479 bounds[2 * k] = 1;
480 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
481 }
482 array_c descr = array_c_null;
483 array_c_from_ptr(&descr, "u", static_cast<void*>(raw),
484 getCFITypeFlag<double>(),
485 static_cast<FX_SIZE>(sizeof(double)),
486 static_cast<FX_RANK>(1), bounds);
487 return fxArray<double>(descr);
488 }
489#endif // HAVE_FXARRAY
490
495 std::vector<double> v_vector() const {
496 double* raw = nullptr;
497 int64_t extents[1] = {0};
498 fitpack_polar_c_getcomp_v(as<fitpack_polar_c>(), &raw, extents);
499 const int64_t total = extents[0];
500 if (raw == nullptr || total <= 0) return {};
501 const double* first = reinterpret_cast<const double*>(raw);
502 return std::vector<double>(first, first + total);
503 }
504
505#if HAVE_FXARRAY
518 fxArray<double> v() const {
519 double* raw = nullptr;
520 int64_t extents[1] = {0};
521 fitpack_polar_c_getcomp_v(as<fitpack_polar_c>(), &raw, extents);
522 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
523 for (int k = 0; k < 1; ++k) {
524 bounds[2 * k] = 1;
525 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
526 }
527 array_c descr = array_c_null;
528 array_c_from_ptr(&descr, "v", static_cast<void*>(raw),
529 getCFITypeFlag<double>(),
530 static_cast<FX_SIZE>(sizeof(double)),
531 static_cast<FX_RANK>(1), bounds);
532 return fxArray<double>(descr);
533 }
534#endif // HAVE_FXARRAY
535
540 std::vector<double> w_vector() const {
541 double* raw = nullptr;
542 int64_t extents[1] = {0};
543 fitpack_polar_c_getcomp_w(as<fitpack_polar_c>(), &raw, extents);
544 const int64_t total = extents[0];
545 if (raw == nullptr || total <= 0) return {};
546 const double* first = reinterpret_cast<const double*>(raw);
547 return std::vector<double>(first, first + total);
548 }
549
550#if HAVE_FXARRAY
563 fxArray<double> w() const {
564 double* raw = nullptr;
565 int64_t extents[1] = {0};
566 fitpack_polar_c_getcomp_w(as<fitpack_polar_c>(), &raw, extents);
567 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
568 for (int k = 0; k < 1; ++k) {
569 bounds[2 * k] = 1;
570 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
571 }
572 array_c descr = array_c_null;
573 array_c_from_ptr(&descr, "w", static_cast<void*>(raw),
574 getCFITypeFlag<double>(),
575 static_cast<FX_SIZE>(sizeof(double)),
576 static_cast<FX_RANK>(1), bounds);
577 return fxArray<double>(descr);
578 }
579#endif // HAVE_FXARRAY
580
585 std::vector<double> wrk2_vector() const {
586 double* raw = nullptr;
587 int64_t extents[1] = {0};
588 fitpack_polar_c_getcomp_wrk2(as<fitpack_polar_c>(), &raw, extents);
589 const int64_t total = extents[0];
590 if (raw == nullptr || total <= 0) return {};
591 const double* first = reinterpret_cast<const double*>(raw);
592 return std::vector<double>(first, first + total);
593 }
594
595#if HAVE_FXARRAY
608 fxArray<double> wrk2() const {
609 double* raw = nullptr;
610 int64_t extents[1] = {0};
611 fitpack_polar_c_getcomp_wrk2(as<fitpack_polar_c>(), &raw, extents);
612 FX_SIZE bounds[2]; // (lower, upper) per dimension, Fortran lbound 1
613 for (int k = 0; k < 1; ++k) {
614 bounds[2 * k] = 1;
615 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
616 }
617 array_c descr = array_c_null;
618 array_c_from_ptr(&descr, "wrk2", static_cast<void*>(raw),
619 getCFITypeFlag<double>(),
620 static_cast<FX_SIZE>(sizeof(double)),
621 static_cast<FX_RANK>(1), bounds);
622 return fxArray<double>(descr);
623 }
624#endif // HAVE_FXARRAY
625
634 std::vector<double> t_vector() const {
635 double* raw = nullptr;
636 int64_t extents[2] = {0, 0};
637 fitpack_polar_c_getcomp_t(as<fitpack_polar_c>(), &raw, extents);
638 const int64_t total = extents[0] * extents[1];
639 if (raw == nullptr || total <= 0) return {};
640 const double* first = reinterpret_cast<const double*>(raw);
641 return std::vector<double>(first, first + total);
642 }
643
648 std::array<int64_t, 2> t_shape() const {
649 double* raw = nullptr;
650 int64_t extents[2] = {0, 0};
651 fitpack_polar_c_getcomp_t(as<fitpack_polar_c>(), &raw, extents);
652 return { extents[0], extents[1] };
653 }
654
655#if HAVE_FXARRAY
668 fxArray<double> t() const {
669 double* raw = nullptr;
670 int64_t extents[2] = {0, 0};
671 fitpack_polar_c_getcomp_t(as<fitpack_polar_c>(), &raw, extents);
672 FX_SIZE bounds[4]; // (lower, upper) per dimension, Fortran lbound 1
673 for (int k = 0; k < 2; ++k) {
674 bounds[2 * k] = 1;
675 bounds[2 * k + 1] = static_cast<FX_SIZE>(extents[k]);
676 }
677 array_c descr = array_c_null;
678 array_c_from_ptr(&descr, "t", static_cast<void*>(raw),
679 getCFITypeFlag<double>(),
680 static_cast<FX_SIZE>(sizeof(double)),
681 static_cast<FX_RANK>(2), bounds);
682 return fxArray<double>(descr);
683 }
684#endif // HAVE_FXARRAY
685
686 // ===========================================================================================
687 // Scalar Property Accessors
688 // ===========================================================================================
689
690 int32_t& m() {
691 return *fitpack_polar_c_ref_m(as<fitpack_polar_c>());
692 }
693 const int32_t& m() const {
694 return *fitpack_polar_c_ref_m(as<fitpack_polar_c>());
695 }
696
697 int32_t& lwrk2() {
698 return *fitpack_polar_c_ref_lwrk2(as<fitpack_polar_c>());
699 }
700 const int32_t& lwrk2() const {
701 return *fitpack_polar_c_ref_lwrk2(as<fitpack_polar_c>());
702 }
703
705 return *fitpack_polar_c_ref_bc_continuity_origin(as<fitpack_polar_c>());
706 }
707 const int32_t& bc_continuity_origin() const {
708 return *fitpack_polar_c_ref_bc_continuity_origin(as<fitpack_polar_c>());
709 }
710
711 int32_t& bc_boundary() {
712 return *fitpack_polar_c_ref_bc_boundary(as<fitpack_polar_c>());
713 }
714 const int32_t& bc_boundary() const {
715 return *fitpack_polar_c_ref_bc_boundary(as<fitpack_polar_c>());
716 }
717
718 int32_t& nmax() {
719 return *fitpack_polar_c_ref_nmax(as<fitpack_polar_c>());
720 }
721 const int32_t& nmax() const {
722 return *fitpack_polar_c_ref_nmax(as<fitpack_polar_c>());
723 }
724
725protected:
726 explicit fpPolar(NoAlloc tag) : fpFitter(tag) {}
727
728};
729
730#endif /* FPPOLAR_HPP_INCLUDED */
double & smoothing()
Definition fpFitter.hpp:317
fpFitter(NoAlloc)
Protected constructor for derived classes (does not allocate)
Definition fpFitter.hpp:354
T * as()
Definition fpFitter.hpp:360
fxArray< double > v() const
Zero-copy fxArray view of component 'v'.
Definition fpPolar.hpp:518
void destroy_base() override
Definition fpPolar.hpp:303
int32_t & bc_boundary()
Definition fpPolar.hpp:711
fxArray< double > z() const
Zero-copy fxArray view of component 'z'.
Definition fpPolar.hpp:428
const fpFitter & as_parent() const
Definition fpPolar.hpp:200
virtual double eval(double x, double y, int32_t *ierr=nullptr)
Definition fpPolar.hpp:238
fitpack_polar_c & c_handle()
Get underlying C wrapper (for interop)
Definition fpPolar.hpp:171
int32_t & bc_continuity_origin()
Definition fpPolar.hpp:704
void core_comm_pack(std::vector< double > &buffer) const override
core_comm_pack
Definition fpPolar.hpp:288
fpPolar()
Default constructor - allocates new fitpack_polar.
Definition fpPolar.hpp:64
fxArray< double > wrk2() const
Zero-copy fxArray view of component 'wrk2'.
Definition fpPolar.hpp:608
void core_comm_expand(std::vector< double > &buffer) override
core_comm_expand
Definition fpPolar.hpp:297
fpPolar & operator=(const fpPolar &other)
Copy assignment - deep copy.
Definition fpPolar.hpp:86
static fpPolar make_view()
Construct an empty (non-owning) wrapper, for use as a view target.
Definition fpPolar.hpp:190
const int32_t & lwrk2() const
Definition fpPolar.hpp:700
const char * c_type_name() const override
Return the C wrapper struct name for this class (e.g. "fitpack_polar_c").
Definition fpPolar.hpp:156
virtual std::vector< double > eval(std::vector< double > &x, std::vector< double > &y, int32_t *ierr=nullptr)
eval
Definition fpPolar.hpp:245
std::vector< double > u_vector() const
Deep copy of component 'u' as a std::vector.
Definition fpPolar.hpp:450
fxArray< double > u() const
Zero-copy fxArray view of component 'u'.
Definition fpPolar.hpp:473
std::vector< double > y_vector() const
Deep copy of component 'y' as a std::vector.
Definition fpPolar.hpp:360
std::array< int64_t, 2 > t_shape() const
Extents of component 't', leading dimension first.
Definition fpPolar.hpp:648
fxArray< double > w() const
Zero-copy fxArray view of component 'w'.
Definition fpPolar.hpp:563
virtual void new_points(std::vector< double > &x, std::vector< double > &y, std::vector< double > &z, fitpack_polar_boundary_fn boundary, double *w=nullptr, int32_t *boundary_bc=nullptr)
new_points
Definition fpPolar.hpp:211
int32_t comm_size() const override
Definition fpPolar.hpp:255
virtual int32_t least_squares(double *smoothing=nullptr, bool *reset_knots=nullptr)
Definition fpPolar.hpp:230
virtual int32_t fit(double *smoothing=nullptr, bool *keep_knots=nullptr)
Definition fpPolar.hpp:226
const int32_t & m() const
Definition fpPolar.hpp:693
double mse() const override
Definition fpPolar.hpp:277
fpFitter & as_parent()
Upcast to parent type (reference, no copy)
Definition fpPolar.hpp:197
int32_t & m()
Definition fpPolar.hpp:690
const int32_t & nmax() const
Definition fpPolar.hpp:721
fxArray< double > t() const
Zero-copy fxArray view of component 't'.
Definition fpPolar.hpp:668
~fpPolar() override
Destructor - deallocates if owned.
Definition fpPolar.hpp:71
fpPolar & operator=(fpPolar &&other) noexcept
Move assignment - transfer ownership.
Definition fpPolar.hpp:105
int32_t & lwrk2()
Definition fpPolar.hpp:697
bool is_allocated() const override
Check if object is allocated.
Definition fpPolar.hpp:142
fxArray< double > y() const
Zero-copy fxArray view of component 'y'.
Definition fpPolar.hpp:383
void comm_pack(std::vector< double > &buffer) const override
comm_pack
Definition fpPolar.hpp:262
virtual int32_t new_fit(std::vector< double > &x, std::vector< double > &y, std::vector< double > &z, fitpack_polar_boundary_fn boundary, double *w=nullptr, int32_t *boundary_bc=nullptr, double *smoothing=nullptr)
new_fit
Definition fpPolar.hpp:220
const int32_t & bc_continuity_origin() const
Definition fpPolar.hpp:707
void comm_expand(std::vector< double > &buffer) override
comm_expand
Definition fpPolar.hpp:271
int32_t & nmax()
Definition fpPolar.hpp:718
const fitpack_polar_c & c_handle() const
Get underlying C wrapper (const, for interop)
Definition fpPolar.hpp:178
virtual int32_t interpolate(bool *reset_knots=nullptr)
Definition fpPolar.hpp:234
std::vector< double > z_vector() const
Deep copy of component 'z' as a std::vector.
Definition fpPolar.hpp:405
int32_t core_comm_size() const override
Definition fpPolar.hpp:281
fpPolar(fitpack_polar_c &c_wrapper, ViewTag)
Non-owning view ctor: bit-copy the C handle, mark is_pointer=true. Used by parent classes' polymorphi...
Definition fpPolar.hpp:130
std::vector< double > w_vector() const
Deep copy of component 'w' as a std::vector.
Definition fpPolar.hpp:540
std::vector< double > t_vector() const
Deep copy of component 't' as a std::vector.
Definition fpPolar.hpp:634
std::vector< double > x_vector() const
Deep copy of component 'x' as a std::vector.
Definition fpPolar.hpp:315
fpPolar(const fpPolar &other)
Copy constructor - deep copy.
Definition fpPolar.hpp:78
fpPolar(fpPolar &&other) noexcept
Move constructor - transfer ownership.
Definition fpPolar.hpp:97
fpPolar(fitpack_polar_c &c_wrapper, bool move=false)
Construct from existing C wrapper (takes ownership if move=true)
Definition fpPolar.hpp:116
const int32_t & bc_boundary() const
Definition fpPolar.hpp:714
fpPolar(NoAlloc tag)
Definition fpPolar.hpp:726
const char * cpp_type_name() const override
Return the fully-qualified C++ class name for this class. Owned by the C++ layer — does not round-tri...
Definition fpPolar.hpp:164
fxArray< double > x() const
Zero-copy fxArray view of component 'x'.
Definition fpPolar.hpp:338
std::vector< double > v_vector() const
Deep copy of component 'v' as a std::vector.
Definition fpPolar.hpp:495
bool is_pointer() const override
Check if this is a non-owning pointer.
Definition fpPolar.hpp:149
std::vector< double > wrk2_vector() const
Deep copy of component 'wrk2' as a std::vector.
Definition fpPolar.hpp:585
Tag type for derived class constructors (no allocation)
Definition fpFitter.hpp:349
Tag type for non-owning view constructors of polymorphic concrete subtypes. Declared on roots and abs...
Definition fpFitter.hpp:103