mathlib-pchip.c
1 //! @file mathlib-pchip.c
2 //
3 //! @section copyright
4 //
5 // This file is part of VIF - vintage fortran compiler.
6 // Copyright 2020-2025 J. Marcel van der Veer <algol68g@xs4all.nl>.
7 //
8 //! @section license
9 //
10 // This program is free software; you can redistribute it and/or modify it
11 // under the terms of the gnu general public license as published by the
12 // free software foundation; either version 3 of the license, or
13 // (at your option) any later version.
14 //
15 // This program is distributed in the hope that it will be useful, but
16 // without any warranty; without even the implied warranty of merchantability
17 // or fitness for a particular purpose. See the GNU general public license for
18 // more details. you should have received a copy of the GNU general public
19 // license along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //! @Synopsis
22 //
23 //! 41 subprograms from PCHIP
24
25 // Compiled from Fortran source code by VIF.
26 // Selected subprograms are:
27 //
28 // CHFCM DCHFDV DPCHCE DPCHDF DPCHIC DPCHSP PCHCE PCHDF PCHIA PCHKT
29 // CHFDV DCHFEV DPCHCI DPCHFD DPCHID DPCHST PCHCI PCHDOC PCHIC PCHSP
30 // CHFEV DCHFIE DPCHCM DPCHFE DPCHIM DPCHSW PCHCM PCHFD PCHID PCHST
31 // CHFIE DPCHBS DPCHCS DPCHIA DPCHKT PCHBS PCHCS PCHFE PCHIM PCHSW
32 // DCHFCM
33
34 // PCHIP routines from SLATEC.
35 //
36 // Source: netlib.org/slatec/
37
38 // The license for PCHIP Fortran source code is:
39 //
40 // The SLATEC Common Mathematical Library was developed at
41 // US government research laboratories and is in the public domain.
42 //
43 // Repository: http://www.netlib.org/slatec/
44 //
45 // The SLATEC common mathematical library is issued by the following
46 //
47 // Air Force Weapons Laboratory, Albuquerque
48 // Lawrence Livermore National Laboratory, Livermore
49 // Los Alamos National Laboratory, Los Alamos
50 // National Institute of Standards and Technology, Washington
51 // National Energy Research Supercomputer Center, Livermore
52 // Oak Ridge National Laboratory, Oak Ridge
53 // Sandia National Laboratories, Albuquerque
54 // Sandia National Laboratories, Livermore
55 //
56 // All questions concerning the distribution of the library should be
57 // directed to the NATIONAL ENERGY SOFTWARE CENTER, 9700 Cass Ave.,
58 // Argonne, Illinois 60439, and not to the authors of the subprograms.
59 //
60 // * * * * * Notice * * * * *
61 //
62 // This material was prepared as an account of work sponsored by the
63 // United States Government. Neither the United States, nor the
64 // Department of Energy, nor the Department of Defense, nor any of
65 // their employees, nor any of their contractors, subcontractors, or
66 // their employees, makes any warranty, expressed or implied, or
67 // assumes any legal liability or responsibility for the accuracy,
68 // completeness, or usefulness of any information, apparatus, product,
69 // or process disclosed, or represents that its use would not infringe
70 // upon privately owned rights.
71
72 /*
73 Generated by VIF - experimental VIntage Fortran compiler.
74 VIF release 1.2.17
75 */
76 #if defined (__GNUC__)
77 #pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
78 #pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
79 #if (__GNUC__ >= 14)
80 #pragma GCC diagnostic ignored "-Wdeclaration-missing-parameter-type"
81 #pragma GCC diagnostic ignored "-Wimplicit-int"
82 #pragma GCC diagnostic ignored "-Wint-conversion"
83 #pragma GCC diagnostic ignored "-Wreturn-mismatch"
84 #endif
85 #else
86 #error VIF requires GCC
87 #endif
151 static CALLS __calls[__ncalls] = {
152 {"chfcm", 0}, // integer*4 function
153 {"chfdv", 0}, // subroutine
154 {"chfev", 0}, // subroutine
155 {"chfie", 0}, // real*4 function
156 {"dchfcm", 0}, // integer*4 function
157 {"dchfdv", 0}, // subroutine
158 {"dchfev", 0}, // subroutine
159 {"dchfie", 0}, // real*8 function
160 {"dpchbs", 0}, // subroutine
161 {"dpchce", 0}, // subroutine
162 {"dpchci", 0}, // subroutine
163 {"dpchcm", 0}, // subroutine
164 {"dpchcs", 0}, // subroutine
165 {"dpchdf", 0}, // real*8 function
166 {"dpchfd", 0}, // subroutine
167 {"dpchfe", 0}, // subroutine
168 {"dpchia", 0}, // real*8 function
169 {"dpchic", 0}, // subroutine
170 {"dpchid", 0}, // real*8 function
171 {"dpchim", 0}, // subroutine
172 {"dpchkt", 0}, // subroutine
173 {"dpchsp", 0}, // subroutine
174 {"dpchst", 0}, // real*8 function
175 {"dpchsw", 0}, // subroutine
176 {"pchbs", 0}, // subroutine
177 {"pchce", 0}, // subroutine
178 {"pchci", 0}, // subroutine
179 {"pchcm", 0}, // subroutine
180 {"pchcs", 0}, // subroutine
181 {"pchdf", 0}, // real*4 function
182 {"pchdoc", 0}, // subroutine
183 {"pchfd", 0}, // subroutine
184 {"pchfe", 0}, // subroutine
185 {"pchia", 0}, // real*4 function
186 {"pchic", 0}, // subroutine
187 {"pchid", 0}, // real*4 function
188 {"pchim", 0}, // subroutine
189 {"pchkt", 0}, // subroutine
190 {"pchsp", 0}, // subroutine
191 {"pchst", 0}, // real*4 function
192 {"pchsw", 0}, // subroutine
193 {NULL, 0}
194 };
195
198 int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_);
200 int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_);
202 , real_4 _p_ a_, real_4 _p_ b_);
205 , int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_);
207 , int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_);
209 d2_, real_8 _p_ a_, real_8 _p_ b_);
211 , int_4 _p_ nknots_, real_8 _p_ t_, real_8 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_);
213 real_8 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_);
216 skip_, int_4 _p_ ismon_, int_4 _p_ ierr_);
218 incfd_, int_4 _p_ ierr_);
221 skip_, int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ ierr_);
223 skip_, int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ ierr_);
225 skip_, real_8 _p_ a_, real_8 _p_ b_, int_4 _p_ ierr_);
227 real_8 _p_ d_, int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
229 skip_, int_4 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_);
233 int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
236 _p_ slope_, int_4 _p_ ierr_);
238 int_4 _p_ nknots_, real_4 _p_ t_, real_4 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_);
240 real_4 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_);
243 skip_, int_4 _p_ ismon_, int_4 _p_ ierr_);
245 incfd_, int_4 _p_ ierr_);
249 skip_, int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ ierr_);
251 skip_, int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ ierr_);
253 skip_, real_4 _p_ a_, real_4 _p_ b_, int_4 _p_ ierr_);
255 real_4 _p_ d_, int_4 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
257 skip_, int_4 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_);
261 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
264 slope_, int_4 _p_ ierr_);
265 int_4 _chfcm (real_4 _p_ d1_, real_4 _p_ d2_, real_4 _p_ delta_)
266 { // ** body not listed **
368 }
369
370 int_4 _chfdv (real_4 _p_ x1_, real_4 _p_ x2_, real_4 _p_ f1_, real_4 _p_ f2_, real_4 _p_ d1_, real_4 _p_ d2_, int_4 _p_
371 ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_)
372 { // ** body not listed **
428 }
429
430 int_4 _chfev (real_4 _p_ x1_, real_4 _p_ x2_, real_4 _p_ f1_, real_4 _p_ f2_, real_4 _p_ d1_, real_4 _p_ d2_, int_4 _p_
431 ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_)
432 { // ** body not listed **
485 }
486
487 real_4 _chfie (real_4 _p_ x1_, real_4 _p_ x2_, real_4 _p_ f1_, real_4 _p_ f2_, real_4 _p_ d1_, real_4 _p_ d2_, real_4
488 _p_ a_, real_4 _p_ b_)
489 { // ** body not listed **
568 }
569
570 int_4 _dchfcm (real_8 _p_ d1_, real_8 _p_ d2_, real_8 _p_ delta_)
571 { // ** body not listed **
673 }
674
675 int_4 _dchfdv (real_8 _p_ x1_, real_8 _p_ x2_, real_8 _p_ f1_, real_8 _p_ f2_, real_8 _p_ d1_, real_8 _p_ d2_, int_4
676 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_)
677 { // ** body not listed **
733 }
734
735 int_4 _dchfev (real_8 _p_ x1_, real_8 _p_ x2_, real_8 _p_ f1_, real_8 _p_ f2_, real_8 _p_ d1_, real_8 _p_ d2_, int_4
736 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_)
737 { // ** body not listed **
790 }
791
792 real_8 _dchfie (real_8 _p_ x1_, real_8 _p_ x2_, real_8 _p_ f1_, real_8 _p_ f2_, real_8 _p_ d1_, real_8 _p_ d2_, real_8
793 _p_ a_, real_8 _p_ b_)
794 { // ** body not listed **
873 }
874
875 int_4 _dpchbs (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, int_4 _p_ knotyp_, int_4
876 _p_ nknots_, real_8 _p_ t_, real_8 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_)
877 { // ** body not listed **
914 }
915
916 int_4 _dpchce (int_4 _p_ ic_, real_8 _p_ vc_, int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ h_, real_8 _p_ slope_, real_8 _p_
917 d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
918 { // ** body not listed **
1068 }
1069
1070 int_4 _dpchci (int_4 _p_ n_, real_8 _p_ h_, real_8 _p_ slope_, real_8 _p_ d_, int_4 _p_ incfd_)
1071 { // ** body not listed **
1155 }
1156
1157 int_4 _dpchcm (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
1158 _p_ ismon_, int_4 _p_ ierr_)
1159 { // ** body not listed **
1215 }
1216
1217 int_4 _dpchcs (real_8 _p_ switch_, int_4 _p_ n_, real_8 _p_ h_, real_8 _p_ slope_, real_8 _p_ d_, int_4 _p_ incfd_,
1218 int_4 _p_ ierr_)
1219 { // ** body not listed **
1364 }
1365
1366 real_8 _dpchdf (int_4 _p_ k_, real_8 _p_ x_, real_8 _p_ s_, int_4 _p_ ierr_)
1367 { // ** body not listed **
1405 }
1406
1407 int_4 _dpchfd (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
1408 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ ierr_)
1409 { // ** body not listed **
1526 }
1527
1528 int_4 _dpchfe (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
1529 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ ierr_)
1530 { // ** body not listed **
1647 }
1648
1649 real_8 _dpchia (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_,
1650 real_8 _p_ a_, real_8 _p_ b_, int_4 _p_ ierr_)
1651 { // ** body not listed **
1766 }
1767
1768 int_4 _dpchic (int_4 _p_ ic_, real_8 _p_ vc_, real_8 _p_ switch_, int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8
1769 _p_ d_, int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
1770 { // ** body not listed **
1871 }
1872
1873 real_8 _dpchid (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
1874 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_)
1875 { // ** body not listed **
1969 }
1970 int_4 _dpchim (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
1971 { // ** body not listed **
2105 }
2106
2107 int_4 _dpchkt (int_4 _p_ n_, real_8 _p_ x_, int_4 _p_ knotyp_, real_8 _p_ t_)
2108 { // ** body not listed **
2136 }
2137
2138 int_4 _dpchsp (int_4 _p_ ic_, real_8 _p_ vc_, int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ f_, real_8 _p_ d_, int_4 _p_
2139 incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
2140 { // ** body not listed **
2378 }
2379
2380 real_8 _dpchst (real_8 _p_ arg1_, real_8 _p_ arg2_)
2381 { // ** body not listed **
2411 }
2412
2413 int_4 _dpchsw (real_8 _p_ dfmax_, int_4 _p_ iextrm_, real_8 _p_ d1_, real_8 _p_ d2_, real_8 _p_ h_, real_8 _p_ slope_,
2414 int_4 _p_ ierr_)
2415 { // ** body not listed **
2549 }
2550
2551 int_4 _pchbs (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, int_4 _p_ knotyp_, int_4 _p_
2552 nknots_, real_4 _p_ t_, real_4 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_)
2553 { // ** body not listed **
2590 }
2591
2592 int_4 _pchce (int_4 _p_ ic_, real_4 _p_ vc_, int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ h_, real_4 _p_ slope_, real_4 _p_
2593 d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
2594 { // ** body not listed **
2744 }
2745
2746 int_4 _pchci (int_4 _p_ n_, real_4 _p_ h_, real_4 _p_ slope_, real_4 _p_ d_, int_4 _p_ incfd_)
2747 { // ** body not listed **
2831 }
2832
2833 int_4 _pchcm (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
2834 _p_ ismon_, int_4 _p_ ierr_)
2835 { // ** body not listed **
2891 }
2892
2893 int_4 _pchcs (real_4 _p_ switch_, int_4 _p_ n_, real_4 _p_ h_, real_4 _p_ slope_, real_4 _p_ d_, int_4 _p_ incfd_,
2894 int_4 _p_ ierr_)
2895 { // ** body not listed **
3040 }
3041
3042 real_4 _pchdf (int_4 _p_ k_, real_4 _p_ x_, real_4 _p_ s_, int_4 _p_ ierr_)
3043 { // ** body not listed **
3081 }
3082
3083 int_4 _pchdoc (void)
3084 { // ** body not listed **
3087 }
3088
3089 int_4 _pchfd (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
3090 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ ierr_)
3091 { // ** body not listed **
3208 }
3209
3210 int_4 _pchfe (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
3211 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ ierr_)
3212 { // ** body not listed **
3329 }
3330
3331 real_4 _pchia (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, real_4
3332 _p_ a_, real_4 _p_ b_, int_4 _p_ ierr_)
3333 { // ** body not listed **
3448 }
3449
3450 int_4 _pchic (int_4 _p_ ic_, real_4 _p_ vc_, real_4 _p_ switch_, int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_
3451 d_, int_4 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
3452 { // ** body not listed **
3553 }
3554
3555 real_4 _pchid (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, logical_4 _p_ skip_, int_4
3556 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_)
3557 { // ** body not listed **
3651 }
3652 int_4 _pchim (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
3653 { // ** body not listed **
3787 }
3788
3789 int_4 _pchkt (int_4 _p_ n_, real_4 _p_ x_, int_4 _p_ knotyp_, real_4 _p_ t_)
3790 { // ** body not listed **
3818 }
3819
3820 int_4 _pchsp (int_4 _p_ ic_, real_4 _p_ vc_, int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ f_, real_4 _p_ d_, int_4 _p_
3821 incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
3822 { // ** body not listed **
4060 }
4061
4062 real_4 _pchst (real_4 _p_ arg1_, real_4 _p_ arg2_)
4063 { // ** body not listed **
4093 }
4094
4095 int_4 _pchsw (real_4 _p_ dfmax_, int_4 _p_ iextrm_, real_4 _p_ d1_, real_4 _p_ d2_, real_4 _p_ h_, real_4 _p_ slope_,
4096 int_4 _p_ ierr_)
4097 { // ** body not listed **
4231 }
4232
© 2002-2025 J.M. van der Veer (jmvdveer@xs4all.nl)
|