#include <vector>
#include <cassert>
#include <iomanip>
Go to the source code of this file.
|
void | thomas_solve (double *a, double *b, double *c, double *d, int n) |
|
template<typename T > |
int | my_lower_bound (const T &val, const T *arr, const int arrlen) |
|
template<typename T > |
int | my_upper_bound (const T &val, T *arr, int arrlen) |
|
◆ Float
◆ my_lower_bound()
template<typename T >
int my_lower_bound |
( |
const T & |
val, |
|
|
const T * |
arr, |
|
|
const int |
arrlen |
|
) |
| |
Definition at line 63 of file cubic_spline.h.
65 int it, first=0, last=arrlen;
70 it = first; step=count/2;
◆ my_upper_bound()
template<typename T >
int my_upper_bound |
( |
const T & |
val, |
|
|
T * |
arr, |
|
|
int |
arrlen |
|
) |
| |
Definition at line 88 of file cubic_spline.h.
90 int it, first=0, last=arrlen;
95 it = first; step=count/2;
◆ thomas_solve()
void thomas_solve |
( |
double * |
a, |
|
|
double * |
b, |
|
|
double * |
c, |
|
|
double * |
d, |
|
|
int |
n |
|
) |
| |
|
inline |
Definition at line 35 of file cubic_spline.h.
40 for (
int i = 1; i < n; i++) {
41 c[i] /= b[i] - a[i]*c[i-1];
42 d[i] = (d[i] - a[i]*d[i-1]) / (b[i] - a[i]*c[i-1]);
45 d[n] = (d[n] - a[n]*d[n-1]) / (b[n] - a[n]*c[n-1]);
47 for (
int i = n; i-- > 0;) {