INGOR
Loading...
Searching...
No Matches
ytBSpline.h
1/*
2 math/ytBSpline.{h,c} : B-spline routines.
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in
15 the documentation and/or other materials provided with the
16 distribution.
17
18 * Neither the name of Kyoto University nor the names of its
19 contributors may be used to endorse or promote products derived
20 from this software without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 POSSIBILITY OF SUCH DAMAGE.
34*/
35
36#ifndef __YTLIB_BSPLINE_H
37#define __YTLIB_BSPLINE_H
38
39#include <stdio.h>
40
41void ytBSpline_designMatrix(const double * x, const int n,
42 const double xl, const double xr,
43 double * B, int * index,
44 const int ndx, const int degree, double * work);
45void ytBSpline_designMatrix2(const double * x, const int n, double * B, int * index,
46 const int ndx, const int degree, double * work);
47void ytBSpline_Dk(const int m, const int k, double * D);
48void ytBSpline_K(int m, int k, double * K, double * work);
49double ytBSpline_det_K_plus(const double * K, const int m);
50void ytBSpline_syBtB(const double * B, const int * index, const int n,
51 const int ndx, const int degree, double * BtB);
52void ytBSpline_syBtB2(const double * B, const int * index, const int n,
53 const int ndx, const int degree, double * BtB);
54void ytBSpline_dsycopy(const double * X, double * Y, int m);
55void ytBSpline_dsycopy20(const double * X, double * Y);
56void ytBSpline_syMBt(const double * restrict A,
57 const double * restrict B, const int* index,
58 const int n, const int ndx, const int degree,
59 double * restrict C);
60void ytBSpline_syMBt_D3(const double * restrict A,
61 const double * restrict B, const int * index,
62 const int n, const int ndx,
63 double * restrict C);
64void ytBSpline_syMBt_D3_2(const double * restrict A,
65 const double * restrict B, const int * index,
66 const int n, const int ndx,
67 double * restrict C);
68void ytBSpline_syMBt_D3_3(double * restrict A,
69 double * restrict B, const int * index,
70 const int n, const int ndx,
71 double * restrict C);
72void ytBSpline_dxpy_mask(int n, double * x, const double * y, const char * mask);
73void ytBSpline_dxmy_mask(int n, double * x, const double * y, const char * mask);
74void ytBSpline_Mv(int n, int m, const double * A, const double * b, double * c);
75void ytBSpline_Mv20(int n, const double * A, const double * b, double * c);
76void ytBSpline_Mv20_mask(int n, const double * A, const double * b, double * c, const char * mask);
77void ytBSpline_Bx3(const double * restrict B, const int * index,
78 const double * x, const int n, double * restrict y);
79double ytBSpline_var_mask(int n, const double * T, const double * g,
80 const char * mask);
81double ytBSpline_gKgL(int M, const double * K, const double * g);
82double ytBSpline_gKg20L(const double * K, const double * g);
83void ytBSpline_printB(FILE * fp, const double * B, const int * index,
84 int n, int M, int deg);
85double ytBSpline_gamma20(double x, double xl, double xr, double * gamma);
86#endif /* __YTLIB_BSPLINE_H */