Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spline.h
Go to the documentation of this file.
1 /*
2  * spline.h - spline class definitions
3  *
4  * Copyright (C) 2005, 2006, 2009 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id$
22  *
23  */
24 
25 #ifndef __SPLINE_H__
26 #define __SPLINE_H__
27 
28 #include "tvector.h"
29 
30 namespace qucs {
31 
32 // Types of boundary conditions.
35  SPLINE_BC_NATURAL, // natural splines -- zero derivatives
36  SPLINE_BC_CLAMPED, // endpoint derivatives given
37  SPLINE_BC_PERIODIC // periodic splines
38 };
39 
40 class vector;
41 class poly;
42 
43 class spline
44 {
45  public:
46  spline ();
47  spline (int);
50  ~spline ();
51 
54  void vectors (nr_double_t *, nr_double_t *, int);
55  void construct (void);
56  poly evaluate (nr_double_t);
57  void setBoundary (int b) { boundary = b; }
58  void setDerivatives (nr_double_t l, nr_double_t r) { d0 = l; dn = r; }
59 
60  private:
61  nr_double_t * upper_bound (nr_double_t *, nr_double_t *, nr_double_t);
62  void realloc (int);
63 
64  private:
65  nr_double_t * x;
66  nr_double_t * f0;
67  nr_double_t * f1;
68  nr_double_t * f2;
69  nr_double_t * f3;
70  nr_double_t d0, dn;
71  int n;
72  int boundary;
73 };
74 
75 } // namespace qucs
76 
77 #endif /* __SPLINE_H__ */
nr_double_t d0
Definition: spline.h:70
l
Definition: parse_vcd.y:213
poly evaluate(nr_double_t)
Definition: spline.cpp:285
void vectors(qucs::vector, qucs::vector)
Definition: spline.cpp:85
void construct(void)
Definition: spline.cpp:135
r
Definition: parse_mdl.y:515
nr_double_t * f0
Definition: spline.h:66
nr_double_t * f1
Definition: spline.h:67
void setBoundary(int b)
Definition: spline.h:57
nr_double_t * upper_bound(nr_double_t *, nr_double_t *, nr_double_t)
Definition: spline.cpp:264
void realloc(int)
Definition: spline.cpp:121
void setDerivatives(nr_double_t l, nr_double_t r)
Definition: spline.h:58
spline_boundary_type
Definition: spline.h:33
nr_double_t * f3
Definition: spline.h:69
int boundary
Definition: spline.h:72
nr_double_t * f2
Definition: spline.h:68
nr_double_t * x
Definition: spline.h:65
nr_double_t dn
Definition: spline.h:70