19#ifndef _GIMLI_SPLINE__H
20#define _GIMLI_SPLINE__H
32 CubicFunct(
const double a = 0.0,
const double b = 0.0,
const double c = 0.0,
const double d = 0.0)
33 : a_( a ), b_( b ), c_( c ), d_( d ) {}
37 CubicFunct operator = (
const CubicFunct & C ) {
39 a_ = C.a_; b_ = C.b_; c_ = C.c_; d_ = C.d_;
43 inline double operator()(
double t )
const {
return t * (t * (t * a_ + b_) + c_) + d_; }
45 inline double val(
double t )
const {
return (*
this)( t ); }
47 friend bool operator == (
const CubicFunct & a ,
const CubicFunct & b );
49 double a_, b_, c_, d_;
53 if ( std::fabs( a.a_ - b.a_ ) < TOLERANCE &&
54 std::fabs( a.b_ - b.b_ ) < TOLERANCE &&
55 std::fabs( a.c_ - b.c_ ) < TOLERANCE &&
56 std::fabs( a.d_ - b.d_ ) < TOLERANCE )
return true;
else return false;
59DLLEXPORT std::vector < CubicFunct > calcNaturalCubic(
const std::vector < double > &
x );
63DLLEXPORT std::vector < RVector3 >
createSpline(
const std::vector < RVector3 > & input,
int nSegments,
bool close );
66DLLEXPORT std::vector < RVector3 >
createSplineLocalDX(
const std::vector < RVector3 > & input,
double localDX,
bool close );
CubicFunct(const double a=0.0, const double b=0.0, const double c=0.0, const double d=0.0)
Definition spline.h:32
GIMLi main namespace for the Geophyiscal Inversion and Modelling Library.
Definition baseentity.h:24
std::vector< RVector3 > createSpline(const std::vector< RVector3 > &input, int nSegments, bool close)
Definition spline.cpp:23
RVector x(const R3Vector &rv)
Definition pos.cpp:107
std::vector< CubicFunct > calcNaturalCubicClosed(const std::vector< double > &x)
Definition spline.cpp:86
std::vector< RVector3 > createSplineLocalDX(const std::vector< RVector3 > &input, double localDX, bool close)
Definition spline.cpp:51