fitpack
Modern Fortran library for curve and surface fitting with splines
Loading...
Searching...
No Matches
fpGridPolar Class Reference

Standalone C++ RAII wrapper for Fortran fitpack_grid_polar. More...

#include <fpGridPolar.hpp>

Inheritance diagram for fpGridPolar:
Collaboration diagram for fpGridPolar:

Public Member Functions

 fpGridPolar ()
 Default constructor - allocates new fitpack_grid_polar.
 
 ~fpGridPolar () override
 Destructor - deallocates if owned.
 
 fpGridPolar (const fpGridPolar &other)
 Copy constructor - deep copy.
 
fpGridPolaroperator= (const fpGridPolar &other)
 Copy assignment - deep copy.
 
 fpGridPolar (fpGridPolar &&other) noexcept
 Move constructor - transfer ownership.
 
fpGridPolaroperator= (fpGridPolar &&other) noexcept
 Move assignment - transfer ownership.
 
 fpGridPolar (fitpack_grid_polar_c &c_wrapper, bool move=false)
 Construct from existing C wrapper (takes ownership if move=true)
 
 fpGridPolar (fitpack_grid_polar_c &c_wrapper, ViewTag)
 Non-owning view ctor: bit-copy the C handle, mark is_pointer=true. Used by parent classes' polymorphic accessors to wrap a base-class handle as the correct concrete subtype.
 
bool is_allocated () const override
 Check if object is allocated.
 
bool is_pointer () const override
 Check if this is a non-owning pointer.
 
const char * c_type_name () const override
 Return the C wrapper struct name for this class (e.g. "fitpack_grid_polar_c").
 
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-trip through Fortran.
 
fitpack_grid_polar_c & c_handle ()
 Get underlying C wrapper (for interop)
 
const fitpack_grid_polar_c & c_handle () const
 Get underlying C wrapper (const, for interop)
 
fpFitteras_parent ()
 Upcast to parent type (reference, no copy)
 
const fpFitteras_parent () const
 
virtual void new_points (std::vector< double > &u, std::vector< double > &v, double r, int32_t z_n1, int32_t z_n2, std::vector< double > &z, double *z0=nullptr)
 new_points
 
virtual int32_t new_fit (std::vector< double > &u, std::vector< double > &v, double r, int32_t z_n1, int32_t z_n2, std::vector< double > &z, double *z0=nullptr, double *smoothing=nullptr)
 new_fit
 
virtual void set_origin_BC (double *z0=nullptr, bool *exact=nullptr, bool *differentiable=nullptr)
 
virtual int32_t fit (double *smoothing=nullptr, bool *keep_knots=nullptr)
 
virtual int32_t least_squares (double *smoothing=nullptr, bool *reset_knots=nullptr)
 
virtual int32_t interpolate (bool *reset_knots=nullptr)
 
virtual double eval (double u, double v, int32_t *ierr=nullptr)
 
virtual std::vector< double > eval (std::vector< double > &u, std::vector< double > &v, int32_t *ierr=nullptr)
 eval
 
int32_t comm_size () const override
 
void comm_pack (std::vector< double > &buffer) const override
 comm_pack
 
void comm_expand (std::vector< double > &buffer) override
 comm_expand
 
virtual void write (const char *filename)
 
double mse () const override
 
int32_t core_comm_size () const override
 
void core_comm_pack (std::vector< double > &buffer) const override
 core_comm_pack
 
void core_comm_expand (std::vector< double > &buffer) override
 core_comm_expand
 
void destroy_base () override
 
std::vector< double > u_vector () const
 Deep copy of component 'u' as a std::vector.
 
fxArray< double > u () const
 Zero-copy fxArray view of component 'u'.
 
std::vector< double > v_vector () const
 Deep copy of component 'v' as a std::vector.
 
fxArray< double > v () const
 Zero-copy fxArray view of component 'v'.
 
std::vector< double > z_vector () const
 Deep copy of component 'z' as a std::vector.
 
std::array< int64_t, 2 > z_shape () const
 Extents of component 'z', leading dimension first.
 
fxArray< double > z () const
 Zero-copy fxArray view of component 'z'.
 
std::vector< double > t_vector () const
 Deep copy of component 't' as a std::vector.
 
std::array< int64_t, 2 > t_shape () const
 Extents of component 't', leading dimension first.
 
fxArray< double > t () const
 Zero-copy fxArray view of component 't'.
 
double & r ()
 
const double & r () const
 
double & z0 ()
 
const double & z0 () const
 
bool z0_present () const
 
void set_z0_present (bool value)
 
bool z0_exact () const
 
void set_z0_exact (bool value)
 
bool z0_zero_gradient () const
 
void set_z0_zero_gradient (bool value)
 
int32_t & nmax ()
 
const int32_t & nmax () const
 
int32_t & bc_continuity_origin ()
 
const int32_t & bc_continuity_origin () const
 
int32_t & bc_boundary ()
 
const int32_t & bc_boundary () const
 
- Public Member Functions inherited from fpFitter
virtual ~fpFitter ()=default
 
const char * fortran_type_name () const
 Return the dynamic Fortran type name of the underlying object.
 
fitpack_fitter_c & c_handle ()
 Get underlying C wrapper (for interop)
 
const fitpack_fitter_c & c_handle () const
 Get underlying C wrapper (const, for interop)
 
std::vector< double > c_vector () const
 Deep copy of component 'c' as a std::vector.
 
fxArray< double > c () const
 Zero-copy fxArray view of component 'c'.
 
std::vector< double > wrk_vector () const
 Deep copy of component 'wrk' as a std::vector.
 
fxArray< double > wrk () const
 Zero-copy fxArray view of component 'wrk'.
 
std::vector< int32_t > iwrk_vector () const
 Deep copy of component 'iwrk' as a std::vector.
 
fxArray< int32_t > iwrk () const
 Zero-copy fxArray view of component 'iwrk'.
 
int32_t & iopt ()
 
const int32_t & iopt () const
 
double & smoothing ()
 
const double & smoothing () const
 
double & fp ()
 
const double & fp () const
 
int32_t & lwrk ()
 
const int32_t & lwrk () const
 
int32_t & liwrk ()
 
const int32_t & liwrk () const
 

Static Public Member Functions

static fpGridPolar make_view ()
 Construct an empty (non-owning) wrapper, for use as a view target.
 

Protected Member Functions

 fpGridPolar (NoAlloc tag)
 
- Protected Member Functions inherited from fpFitter
 fpFitter (NoAlloc)
 Protected constructor for derived classes (does not allocate)
 
template<typename T>
T * as ()
 
template<typename T>
const T * as () const
 

Additional Inherited Members

- Protected Attributes inherited from fpFitter
fitpack_fitter_c cobj = fitpack_fitter_c_null
 

Detailed Description

Standalone C++ RAII wrapper for Fortran fitpack_grid_polar.

This class provides automatic memory management (RAII) and a natural C++ API for the underlying Fortran fitpack_grid_polar, without requiring the fortran-arrays library. Array arguments use std::vector<T> for standalone operation. Extends fpFitter (Fortran: extends(fitpack_fitter))

Constructor & Destructor Documentation

◆ fpGridPolar() [1/6]

fpGridPolar::fpGridPolar ( )
inline

Default constructor - allocates new fitpack_grid_polar.

Here is the call graph for this function:

◆ ~fpGridPolar()

fpGridPolar::~fpGridPolar ( )
inlineoverride

Destructor - deallocates if owned.

Here is the call graph for this function:

◆ fpGridPolar() [2/6]

fpGridPolar::fpGridPolar ( const fpGridPolar & other)
inline

Copy constructor - deep copy.

Here is the call graph for this function:

◆ fpGridPolar() [3/6]

fpGridPolar::fpGridPolar ( fpGridPolar && other)
inlinenoexcept

Move constructor - transfer ownership.

Here is the call graph for this function:

◆ fpGridPolar() [4/6]

fpGridPolar::fpGridPolar ( fitpack_grid_polar_c & c_wrapper,
bool move = false )
inlineexplicit

Construct from existing C wrapper (takes ownership if move=true)

Here is the call graph for this function:

◆ fpGridPolar() [5/6]

fpGridPolar::fpGridPolar ( fitpack_grid_polar_c & c_wrapper,
ViewTag  )
inlineexplicit

Non-owning view ctor: bit-copy the C handle, mark is_pointer=true. Used by parent classes' polymorphic accessors to wrap a base-class handle as the correct concrete subtype.

Here is the call graph for this function:

◆ fpGridPolar() [6/6]

fpGridPolar::fpGridPolar ( NoAlloc tag)
inlineexplicitprotected
Here is the call graph for this function:

Member Function Documentation

◆ as_parent() [1/2]

fpFitter & fpGridPolar::as_parent ( )
inline

Upcast to parent type (reference, no copy)

Here is the call graph for this function:

◆ as_parent() [2/2]

const fpFitter & fpGridPolar::as_parent ( ) const
inline
Here is the call graph for this function:

◆ bc_boundary() [1/2]

int32_t & fpGridPolar::bc_boundary ( )
inline
Here is the call graph for this function:

◆ bc_boundary() [2/2]

const int32_t & fpGridPolar::bc_boundary ( ) const
inline
Here is the call graph for this function:

◆ bc_continuity_origin() [1/2]

int32_t & fpGridPolar::bc_continuity_origin ( )
inline
Here is the call graph for this function:

◆ bc_continuity_origin() [2/2]

const int32_t & fpGridPolar::bc_continuity_origin ( ) const
inline
Here is the call graph for this function:

◆ c_handle() [1/2]

fitpack_grid_polar_c & fpGridPolar::c_handle ( )
inline

Get underlying C wrapper (for interop)

Here is the call graph for this function:

◆ c_handle() [2/2]

const fitpack_grid_polar_c & fpGridPolar::c_handle ( ) const
inline

Get underlying C wrapper (const, for interop)

Here is the call graph for this function:

◆ c_type_name()

const char * fpGridPolar::c_type_name ( ) const
inlineoverridevirtual

Return the C wrapper struct name for this class (e.g. "fitpack_grid_polar_c").

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ comm_expand()

void fpGridPolar::comm_expand ( std::vector< double > & buffer)
inlineoverridevirtual

comm_expand

Implements fpFitter.

Here is the call graph for this function:

◆ comm_pack()

void fpGridPolar::comm_pack ( std::vector< double > & buffer) const
inlineoverridevirtual

comm_pack

Implements fpFitter.

Here is the call graph for this function:

◆ comm_size()

int32_t fpGridPolar::comm_size ( ) const
inlineoverridevirtual

Implements fpFitter.

Here is the call graph for this function:

◆ core_comm_expand()

void fpGridPolar::core_comm_expand ( std::vector< double > & buffer)
inlineoverridevirtual

core_comm_expand

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ core_comm_pack()

void fpGridPolar::core_comm_pack ( std::vector< double > & buffer) const
inlineoverridevirtual

core_comm_pack

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ core_comm_size()

int32_t fpGridPolar::core_comm_size ( ) const
inlineoverridevirtual

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ cpp_type_name()

const char * fpGridPolar::cpp_type_name ( ) const
inlineoverridevirtual

Return the fully-qualified C++ class name for this class. Owned by the C++ layer — does not round-trip through Fortran.

Reimplemented from fpFitter.

◆ destroy_base()

void fpGridPolar::destroy_base ( )
inlineoverridevirtual

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ eval() [1/2]

virtual double fpGridPolar::eval ( double u,
double v,
int32_t * ierr = nullptr )
inlinevirtual
Here is the call graph for this function:

◆ eval() [2/2]

virtual std::vector< double > fpGridPolar::eval ( std::vector< double > & u,
std::vector< double > & v,
int32_t * ierr = nullptr )
inlinevirtual

eval

Here is the call graph for this function:

◆ fit()

virtual int32_t fpGridPolar::fit ( double * smoothing = nullptr,
bool * keep_knots = nullptr )
inlinevirtual
Here is the call graph for this function:

◆ interpolate()

virtual int32_t fpGridPolar::interpolate ( bool * reset_knots = nullptr)
inlinevirtual
Here is the call graph for this function:

◆ is_allocated()

bool fpGridPolar::is_allocated ( ) const
inlineoverridevirtual

Check if object is allocated.

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ is_pointer()

bool fpGridPolar::is_pointer ( ) const
inlineoverridevirtual

Check if this is a non-owning pointer.

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ least_squares()

virtual int32_t fpGridPolar::least_squares ( double * smoothing = nullptr,
bool * reset_knots = nullptr )
inlinevirtual
Here is the call graph for this function:

◆ make_view()

static fpGridPolar fpGridPolar::make_view ( )
inlinestatic

Construct an empty (non-owning) wrapper, for use as a view target.

The returned object has a null handle (cptr==nullptr, is_pointer==false) and does NOT allocate a Fortran object. Intended as a fill target for member-view accessors emitted on parent types — the parent populates the handle with c_loc() into its own storage and sets is_pointer=true.

Here is the call graph for this function:

◆ mse()

double fpGridPolar::mse ( ) const
inlineoverridevirtual

Reimplemented from fpFitter.

Here is the call graph for this function:

◆ new_fit()

virtual int32_t fpGridPolar::new_fit ( std::vector< double > & u,
std::vector< double > & v,
double r,
int32_t z_n1,
int32_t z_n2,
std::vector< double > & z,
double * z0 = nullptr,
double * smoothing = nullptr )
inlinevirtual

new_fit

Here is the call graph for this function:

◆ new_points()

virtual void fpGridPolar::new_points ( std::vector< double > & u,
std::vector< double > & v,
double r,
int32_t z_n1,
int32_t z_n2,
std::vector< double > & z,
double * z0 = nullptr )
inlinevirtual

new_points

Here is the call graph for this function:

◆ nmax() [1/2]

int32_t & fpGridPolar::nmax ( )
inline
Here is the call graph for this function:

◆ nmax() [2/2]

const int32_t & fpGridPolar::nmax ( ) const
inline
Here is the call graph for this function:

◆ operator=() [1/2]

fpGridPolar & fpGridPolar::operator= ( const fpGridPolar & other)
inline

Copy assignment - deep copy.

Here is the call graph for this function:

◆ operator=() [2/2]

fpGridPolar & fpGridPolar::operator= ( fpGridPolar && other)
inlinenoexcept

Move assignment - transfer ownership.

Here is the call graph for this function:

◆ r() [1/2]

double & fpGridPolar::r ( )
inline
Here is the call graph for this function:

◆ r() [2/2]

const double & fpGridPolar::r ( ) const
inline
Here is the call graph for this function:

◆ set_origin_BC()

virtual void fpGridPolar::set_origin_BC ( double * z0 = nullptr,
bool * exact = nullptr,
bool * differentiable = nullptr )
inlinevirtual
Here is the call graph for this function:

◆ set_z0_exact()

void fpGridPolar::set_z0_exact ( bool value)
inline
Here is the call graph for this function:

◆ set_z0_present()

void fpGridPolar::set_z0_present ( bool value)
inline
Here is the call graph for this function:

◆ set_z0_zero_gradient()

void fpGridPolar::set_z0_zero_gradient ( bool value)
inline
Here is the call graph for this function:

◆ t()

fxArray< double > fpGridPolar::t ( ) const
inline

Zero-copy fxArray view of component 't'.

array_c_from_ptr builds the descriptor from the borrowed pointer and bounds, so the view aliases the Fortran storage directly — nothing is copied and writes through t()(i, j) land in the object.

Note
Only available when the Fortran-Arrays library is present and enabled (HAVE_FXARRAY).
Warning
The view is invalidated by any refit, assignment or destroy call on this object; re-read it rather than retaining it.
Here is the call graph for this function:

◆ t_shape()

std::array< int64_t, 2 > fpGridPolar::t_shape ( ) const
inline

Extents of component 't', leading dimension first.

Returns
All zeros when the component is unallocated.
Here is the call graph for this function:

◆ t_vector()

std::vector< double > fpGridPolar::t_vector ( ) const
inline

Deep copy of component 't' as a std::vector.

The rank-2 component is flattened COLUMN-MAJOR (Fortran order): element (i, j, ...) — zero-based — is at index i + j * extents[0] + ... Query the extents with t_shape().

Returns
An owning copy, empty when the component is unallocated.
Here is the call graph for this function:

◆ u()

fxArray< double > fpGridPolar::u ( ) const
inline

Zero-copy fxArray view of component 'u'.

array_c_from_ptr builds the descriptor from the borrowed pointer and bounds, so the view aliases the Fortran storage directly — nothing is copied and writes through u()(i) land in the object.

Note
Only available when the Fortran-Arrays library is present and enabled (HAVE_FXARRAY).
Warning
The view is invalidated by any refit, assignment or destroy call on this object; re-read it rather than retaining it.
Here is the call graph for this function:

◆ u_vector()

std::vector< double > fpGridPolar::u_vector ( ) const
inline

Deep copy of component 'u' as a std::vector.

Returns
An owning copy, empty when the component is unallocated.
Here is the call graph for this function:

◆ v()

fxArray< double > fpGridPolar::v ( ) const
inline

Zero-copy fxArray view of component 'v'.

array_c_from_ptr builds the descriptor from the borrowed pointer and bounds, so the view aliases the Fortran storage directly — nothing is copied and writes through v()(i) land in the object.

Note
Only available when the Fortran-Arrays library is present and enabled (HAVE_FXARRAY).
Warning
The view is invalidated by any refit, assignment or destroy call on this object; re-read it rather than retaining it.
Here is the call graph for this function:

◆ v_vector()

std::vector< double > fpGridPolar::v_vector ( ) const
inline

Deep copy of component 'v' as a std::vector.

Returns
An owning copy, empty when the component is unallocated.
Here is the call graph for this function:

◆ write()

virtual void fpGridPolar::write ( const char * filename)
inlinevirtual
Here is the call graph for this function:

◆ z()

fxArray< double > fpGridPolar::z ( ) const
inline

Zero-copy fxArray view of component 'z'.

array_c_from_ptr builds the descriptor from the borrowed pointer and bounds, so the view aliases the Fortran storage directly — nothing is copied and writes through z()(i, j) land in the object.

Note
Only available when the Fortran-Arrays library is present and enabled (HAVE_FXARRAY).
Warning
The view is invalidated by any refit, assignment or destroy call on this object; re-read it rather than retaining it.
Here is the call graph for this function:

◆ z0() [1/2]

double & fpGridPolar::z0 ( )
inline
Here is the call graph for this function:

◆ z0() [2/2]

const double & fpGridPolar::z0 ( ) const
inline
Here is the call graph for this function:

◆ z0_exact()

bool fpGridPolar::z0_exact ( ) const
inline
Here is the call graph for this function:

◆ z0_present()

bool fpGridPolar::z0_present ( ) const
inline
Here is the call graph for this function:

◆ z0_zero_gradient()

bool fpGridPolar::z0_zero_gradient ( ) const
inline
Here is the call graph for this function:

◆ z_shape()

std::array< int64_t, 2 > fpGridPolar::z_shape ( ) const
inline

Extents of component 'z', leading dimension first.

Returns
All zeros when the component is unallocated.
Here is the call graph for this function:

◆ z_vector()

std::vector< double > fpGridPolar::z_vector ( ) const
inline

Deep copy of component 'z' as a std::vector.

The rank-2 component is flattened COLUMN-MAJOR (Fortran order): element (i, j, ...) — zero-based — is at index i + j * extents[0] + ... Query the extents with z_shape().

Returns
An owning copy, empty when the component is unallocated.
Here is the call graph for this function:

The documentation for this class was generated from the following file: