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

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

#include <fpFitter.hpp>

Inheritance diagram for fpFitter:

Classes

struct  NoAlloc
 Tag type for derived class constructors (no allocation) More...
 
struct  ViewTag
 Tag type for non-owning view constructors of polymorphic concrete subtypes. Declared on roots and abstract bases so descendants inherit it; variant accessors qualify the call site. More...
 

Public Member Functions

virtual ~fpFitter ()=default
 
virtual bool is_allocated () const
 Check if object is allocated.
 
virtual bool is_pointer () const
 Check if this is a non-owning pointer.
 
const char * fortran_type_name () const
 Return the dynamic Fortran type name of the underlying object.
 
virtual const char * c_type_name () const
 Return the C wrapper struct name for this class (e.g. "fitpack_fitter_c").
 
virtual const char * cpp_type_name () const
 Return the fully-qualified C++ class name for this class. Owned by the C++ layer — does not round-trip through Fortran.
 
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)
 
virtual double mse () const
 
virtual int32_t core_comm_size () const
 
virtual void core_comm_pack (std::vector< double > &buffer) const
 core_comm_pack
 
virtual void core_comm_expand (std::vector< double > &buffer)
 core_comm_expand
 
virtual void destroy_base ()
 
virtual int32_t comm_size () const =0
 
virtual void comm_pack (std::vector< double > &buffer) const =0
 comm_pack (deferred)
 
virtual void comm_expand (std::vector< double > &buffer)=0
 comm_expand (deferred)
 
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
 

Protected Member Functions

 fpFitter (NoAlloc)
 Protected constructor for derived classes (does not allocate)
 
template<typename T>
T * as ()
 
template<typename T>
const T * as () const
 

Protected Attributes

fitpack_fitter_c cobj = fitpack_fitter_c_null
 

Detailed Description

Standalone C++ RAII wrapper for Fortran fitpack_fitter.

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

Constructor & Destructor Documentation

◆ ~fpFitter()

virtual fpFitter::~fpFitter ( )
virtualdefault

◆ fpFitter()

fpFitter::fpFitter ( NoAlloc )
inlineexplicitprotected

Protected constructor for derived classes (does not allocate)

Member Function Documentation

◆ as() [1/2]

template<typename T>
T * fpFitter::as ( )
inlineprotected

◆ as() [2/2]

template<typename T>
const T * fpFitter::as ( ) const
inlineprotected

◆ c()

fxArray< double > fpFitter::c ( ) const
inline

Zero-copy fxArray view of component 'c'.

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 c()(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:

◆ c_handle() [1/2]

fitpack_fitter_c & fpFitter::c_handle ( )
inline

Get underlying C wrapper (for interop)

Here is the call graph for this function:

◆ c_handle() [2/2]

const fitpack_fitter_c & fpFitter::c_handle ( ) const
inline

Get underlying C wrapper (const, for interop)

Here is the call graph for this function:

◆ c_type_name()

virtual const char * fpFitter::c_type_name ( ) const
inlinevirtual

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

Reimplemented in fpClosedCurve, fpConstrainedCurve, fpConvexCurve, fpCurve, fpGridPolar, fpGridSphere, fpGridSpline, fpGridSurface, fpParametricCurve, fpParametricSurface, fpPeriodicCurve, fpPolar, fpSphere, and fpSurface.

Here is the call graph for this function:

◆ c_vector()

std::vector< double > fpFitter::c_vector ( ) const
inline

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

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

◆ comm_expand()

virtual void fpFitter::comm_expand ( std::vector< double > & buffer)
pure virtual

◆ comm_pack()

virtual void fpFitter::comm_pack ( std::vector< double > & buffer) const
pure virtual

◆ comm_size()

◆ core_comm_expand()

virtual void fpFitter::core_comm_expand ( std::vector< double > & buffer)
inlinevirtual

◆ core_comm_pack()

virtual void fpFitter::core_comm_pack ( std::vector< double > & buffer) const
inlinevirtual

◆ core_comm_size()

virtual int32_t fpFitter::core_comm_size ( ) const
inlinevirtual

◆ cpp_type_name()

virtual const char * fpFitter::cpp_type_name ( ) const
inlinevirtual

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

Reimplemented in fpClosedCurve, fpConstrainedCurve, fpConvexCurve, fpCurve, fpGridPolar, fpGridSphere, fpGridSpline, fpGridSurface, fpParametricCurve, fpParametricSurface, fpPeriodicCurve, fpPolar, fpSphere, and fpSurface.

◆ destroy_base()

virtual void fpFitter::destroy_base ( )
inlinevirtual

◆ fortran_type_name()

const char * fpFitter::fortran_type_name ( ) const
inline

Return the dynamic Fortran type name of the underlying object.

Here is the call graph for this function:

◆ fp() [1/2]

double & fpFitter::fp ( )
inline
Here is the call graph for this function:

◆ fp() [2/2]

const double & fpFitter::fp ( ) const
inline
Here is the call graph for this function:

◆ iopt() [1/2]

int32_t & fpFitter::iopt ( )
inline
Here is the call graph for this function:

◆ iopt() [2/2]

const int32_t & fpFitter::iopt ( ) const
inline
Here is the call graph for this function:

◆ is_allocated()

virtual bool fpFitter::is_allocated ( ) const
inlinevirtual

Check if object is allocated.

Reimplemented in fpClosedCurve, fpConstrainedCurve, fpConvexCurve, fpCurve, fpGridPolar, fpGridSphere, fpGridSpline, fpGridSurface, fpParametricCurve, fpParametricSurface, fpPeriodicCurve, fpPolar, fpSphere, and fpSurface.

Here is the call graph for this function:

◆ is_pointer()

virtual bool fpFitter::is_pointer ( ) const
inlinevirtual

Check if this is a non-owning pointer.

Reimplemented in fpClosedCurve, fpConstrainedCurve, fpConvexCurve, fpCurve, fpGridPolar, fpGridSphere, fpGridSpline, fpGridSurface, fpParametricCurve, fpParametricSurface, fpPeriodicCurve, fpPolar, fpSphere, and fpSurface.

Here is the call graph for this function:

◆ iwrk()

fxArray< int32_t > fpFitter::iwrk ( ) const
inline

Zero-copy fxArray view of component 'iwrk'.

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 iwrk()(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:

◆ iwrk_vector()

std::vector< int32_t > fpFitter::iwrk_vector ( ) const
inline

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

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

◆ liwrk() [1/2]

int32_t & fpFitter::liwrk ( )
inline
Here is the call graph for this function:

◆ liwrk() [2/2]

const int32_t & fpFitter::liwrk ( ) const
inline
Here is the call graph for this function:

◆ lwrk() [1/2]

int32_t & fpFitter::lwrk ( )
inline
Here is the call graph for this function:

◆ lwrk() [2/2]

const int32_t & fpFitter::lwrk ( ) const
inline
Here is the call graph for this function:

◆ mse()

virtual double fpFitter::mse ( ) const
inlinevirtual

◆ smoothing() [1/2]

double & fpFitter::smoothing ( )
inline
Here is the call graph for this function:

◆ smoothing() [2/2]

const double & fpFitter::smoothing ( ) const
inline
Here is the call graph for this function:

◆ wrk()

fxArray< double > fpFitter::wrk ( ) const
inline

Zero-copy fxArray view of component 'wrk'.

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 wrk()(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:

◆ wrk_vector()

std::vector< double > fpFitter::wrk_vector ( ) const
inline

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

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

Member Data Documentation

◆ cobj

fitpack_fitter_c fpFitter::cobj = fitpack_fitter_c_null
protected

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