/Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines/SplineCubic.hxx Source FileΒΆ

Splines: /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines/SplineCubic.hxx Source File
Splines
SplineCubic.hxx
1/*--------------------------------------------------------------------------*\
2 | |
3 | Copyright (C) 2016 |
4 | |
5 | , __ , __ |
6 | /|/ \ /|/ \ |
7 | | __/ _ ,_ | __/ _ ,_ |
8 | | \|/ / | | | | \|/ / | | | |
9 | |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
10 | /| /| |
11 | \| \| |
12 | |
13 | Enrico Bertolazzi |
14 | Dipartimento di Ingegneria Industriale |
15 | Universita` degli Studi di Trento |
16 | email: enrico.bertolazzi@unitn.it |
17 | |
18\*--------------------------------------------------------------------------*/
19
20/*\
21 | ____ _ _ ____ _ _
22 | / ___| _| |__ (_) ___/ ___| _ __ | (_)_ __ ___
23 | | | | | | | '_ \| |/ __\___ \| '_ \| | | '_ \ / _ \
24 | | |__| |_| | |_) | | (__ ___) | |_) | | | | | | __/
25 | \____\__,_|_.__/|_|\___|____/| .__/|_|_|_| |_|\___|
26 | |_|
27\*/
28
29namespace Splines {
30
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32
33 using CubicSpline_BC = enum class CubicSpline_BC : integer {
34 EXTRAPOLATE = 0,
35 NATURAL = 1,
36 PARABOLIC_RUNOUT = 2,
37 NOT_A_KNOT = 3
38 };
39
40 void
41 CubicSpline_build(
42 real_type const X[],
43 real_type const Y[],
44 real_type Yp[],
45 integer npts,
46 CubicSpline_BC bc0,
47 CubicSpline_BC bcn
48 );
49
50 void
51 CubicSpline_build(
52 real_type const X[],
53 real_type const Y[],
54 real_type Yp[],
55 real_type Ypp[],
56 real_type L[],
57 real_type D[],
58 real_type U[],
59 integer npts,
60 CubicSpline_BC bc0,
61 CubicSpline_BC bcn
62 );
63
64 #endif
65
70 private:
71 CubicSpline_BC m_bc0{CubicSpline_BC::EXTRAPOLATE};
72 CubicSpline_BC m_bcn{CubicSpline_BC::EXTRAPOLATE};
73 public:
78
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
82 #endif
83
89 CubicSpline( string const & name = "CubicSpline" )
91 {}
92
96 ~CubicSpline() override {}
97
99
104
109 void
110 set_initial_BC( CubicSpline_BC bc0 )
111 { m_bc0 = bc0; }
112
117 void
118 set_final_BC( CubicSpline_BC bcn )
119 { m_bcn = bcn; }
120
121 // --------------------------- VIRTUALS -----------------------------------
122
123 void build() override;
124 void setup( GenericContainer const & gc ) override;
125
127
131 SplineType1D type() const override { return SplineType1D::CUBIC; }
132
133 #ifdef SPLINES_BACK_COMPATIBILITY
134 void setInitialBC( CubicSpline_BC bc0 ) { m_bc0 = bc0; }
135 void setFinalBC( CubicSpline_BC bcn ) { m_bcn = bcn; }
136 #endif
137
138 };
139
140}
141
142// EOF: SplineCubic.hxx
Definition Splines.hh:936
void reserve(integer npts) override
Definition SplineCubic.hxx:69
void set_final_BC(CubicSpline_BC bcn)
Definition SplineCubic.hxx:118
~CubicSpline() override
Definition SplineCubic.hxx:96
void set_initial_BC(CubicSpline_BC bc0)
Definition SplineCubic.hxx:110
void build() override
Definition SplineCubic.cc:459
CubicSpline(string const &name="CubicSpline")
Definition SplineCubic.hxx:89
SplineType1D type() const override
Definition SplineCubic.hxx:131
void setup(GenericContainer const &gc) override
Definition SplineCubic.cc:512
virtual void build()=0
string const & name() const
Definition Splines.hh:438
Definition SplineAkima.cc:50
int integer
Signed integer type for splines.
Definition Splines.hh:58
enum class SplineType1D :integer { CONSTANT=0, LINEAR=1, CUBIC=2, AKIMA=3, BESSEL=4, PCHIP=5, QUINTIC=6, HERMITE=7, SPLINE_SET=8, SPLINE_VEC=9 } SplineType1D
Associate a number for each type of splines implemented.
Definition Splines.hh:71
double real_type
Floating point type for splines.
Definition Splines.hh:57