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.12
75 */
139 static CALLS __calls[__ncalls] = {
140 {"chfcm", 0}, // integer*4 function
141 {"chfdv", 0}, // subroutine
142 {"chfev", 0}, // subroutine
143 {"chfie", 0}, // real*4 function
144 {"dchfcm", 0}, // integer*4 function
145 {"dchfdv", 0}, // subroutine
146 {"dchfev", 0}, // subroutine
147 {"dchfie", 0}, // real*8 function
148 {"dpchbs", 0}, // subroutine
149 {"dpchce", 0}, // subroutine
150 {"dpchci", 0}, // subroutine
151 {"dpchcm", 0}, // subroutine
152 {"dpchcs", 0}, // subroutine
153 {"dpchdf", 0}, // real*8 function
154 {"dpchfd", 0}, // subroutine
155 {"dpchfe", 0}, // subroutine
156 {"dpchia", 0}, // real*8 function
157 {"dpchic", 0}, // subroutine
158 {"dpchid", 0}, // real*8 function
159 {"dpchim", 0}, // subroutine
160 {"dpchkt", 0}, // subroutine
161 {"dpchsp", 0}, // subroutine
162 {"dpchst", 0}, // real*8 function
163 {"dpchsw", 0}, // subroutine
164 {"pchbs", 0}, // subroutine
165 {"pchce", 0}, // subroutine
166 {"pchci", 0}, // subroutine
167 {"pchcm", 0}, // subroutine
168 {"pchcs", 0}, // subroutine
169 {"pchdf", 0}, // real*4 function
170 {"pchdoc", 0}, // subroutine
171 {"pchfd", 0}, // subroutine
172 {"pchfe", 0}, // subroutine
173 {"pchia", 0}, // real*4 function
174 {"pchic", 0}, // subroutine
175 {"pchid", 0}, // real*4 function
176 {"pchim", 0}, // subroutine
177 {"pchkt", 0}, // subroutine
178 {"pchsp", 0}, // subroutine
179 {"pchst", 0}, // real*4 function
180 {"pchsw", 0}, // subroutine
181 {NULL, 0}
182 };
183
186 int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_);
188 int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_);
190 , real_4 _p_ a_, real_4 _p_ b_);
193 , int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_);
195 , int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_);
197 d2_, real_8 _p_ a_, real_8 _p_ b_);
199 , int_4 _p_ nknots_, real_8 _p_ t_, real_8 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_);
201 real_8 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_);
204 skip_, int_4 _p_ ismon_, int_4 _p_ ierr_);
206 incfd_, int_4 _p_ ierr_);
209 skip_, int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ ierr_);
211 skip_, int_4 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ ierr_);
213 skip_, real_8 _p_ a_, real_8 _p_ b_, int_4 _p_ ierr_);
215 real_8 _p_ d_, int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
217 skip_, int_4 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_);
221 int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
224 _p_ slope_, int_4 _p_ ierr_);
226 int_4 _p_ nknots_, real_4 _p_ t_, real_4 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_);
228 real_4 _p_ d_, int_4 _p_ incfd_, int_4 _p_ ierr_);
231 skip_, int_4 _p_ ismon_, int_4 _p_ ierr_);
233 incfd_, int_4 _p_ ierr_);
237 skip_, int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ ierr_);
239 skip_, int_4 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ ierr_);
241 skip_, real_4 _p_ a_, real_4 _p_ b_, int_4 _p_ ierr_);
243 real_4 _p_ d_, int_4 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
245 skip_, int_4 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_);
249 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_);
252 slope_, int_4 _p_ ierr_);
253 int_4 _chfcm (real_4 _p_ d1_, real_4 _p_ d2_, real_4 _p_ delta_)
254 { // ** body not listed **
356 }
357
358 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_
359 ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_)
360 { // ** body not listed **
416 }
417
418 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_
419 ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_)
420 { // ** body not listed **
473 }
474
475 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
476 _p_ a_, real_4 _p_ b_)
477 { // ** body not listed **
556 }
557
558 int_4 _dchfcm (real_8 _p_ d1_, real_8 _p_ d2_, real_8 _p_ delta_)
559 { // ** body not listed **
661 }
662
663 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
664 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ next_, int_4 _p_ ierr_)
665 { // ** body not listed **
721 }
722
723 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
724 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ next_, int_4 _p_ ierr_)
725 { // ** body not listed **
778 }
779
780 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
781 _p_ a_, real_8 _p_ b_)
782 { // ** body not listed **
861 }
862
863 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
864 _p_ nknots_, real_8 _p_ t_, real_8 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_)
865 { // ** body not listed **
902 }
903
904 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_
905 d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
906 { // ** body not listed **
1056 }
1057
1058 int_4 _dpchci (int_4 _p_ n_, real_8 _p_ h_, real_8 _p_ slope_, real_8 _p_ d_, int_4 _p_ incfd_)
1059 { // ** body not listed **
1143 }
1144
1145 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
1146 _p_ ismon_, int_4 _p_ ierr_)
1147 { // ** body not listed **
1203 }
1204
1205 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_,
1206 int_4 _p_ ierr_)
1207 { // ** body not listed **
1352 }
1353
1354 real_8 _dpchdf (int_4 _p_ k_, real_8 _p_ x_, real_8 _p_ s_, int_4 _p_ ierr_)
1355 { // ** body not listed **
1393 }
1394
1395 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
1396 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, real_8 _p_ de_, int_4 _p_ ierr_)
1397 { // ** body not listed **
1514 }
1515
1516 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
1517 _p_ ne_, real_8 _p_ xe_, real_8 _p_ fe_, int_4 _p_ ierr_)
1518 { // ** body not listed **
1635 }
1636
1637 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_,
1638 real_8 _p_ a_, real_8 _p_ b_, int_4 _p_ ierr_)
1639 { // ** body not listed **
1754 }
1755
1756 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
1757 _p_ d_, int_4 _p_ incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
1758 { // ** body not listed **
1859 }
1860
1861 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
1862 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_)
1863 { // ** body not listed **
1957 }
1958 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_)
1959 { // ** body not listed **
2093 }
2094
2095 int_4 _dpchkt (int_4 _p_ n_, real_8 _p_ x_, int_4 _p_ knotyp_, real_8 _p_ t_)
2096 { // ** body not listed **
2124 }
2125
2126 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_
2127 incfd_, real_8 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
2128 { // ** body not listed **
2366 }
2367
2368 real_8 _dpchst (real_8 _p_ arg1_, real_8 _p_ arg2_)
2369 { // ** body not listed **
2399 }
2400
2401 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_,
2402 int_4 _p_ ierr_)
2403 { // ** body not listed **
2537 }
2538
2539 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_
2540 nknots_, real_4 _p_ t_, real_4 _p_ bcoef_, int_4 _p_ ndim_, int_4 _p_ kord_, int_4 _p_ ierr_)
2541 { // ** body not listed **
2578 }
2579
2580 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_
2581 d_, int_4 _p_ incfd_, int_4 _p_ ierr_)
2582 { // ** body not listed **
2732 }
2733
2734 int_4 _pchci (int_4 _p_ n_, real_4 _p_ h_, real_4 _p_ slope_, real_4 _p_ d_, int_4 _p_ incfd_)
2735 { // ** body not listed **
2819 }
2820
2821 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
2822 _p_ ismon_, int_4 _p_ ierr_)
2823 { // ** body not listed **
2879 }
2880
2881 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_,
2882 int_4 _p_ ierr_)
2883 { // ** body not listed **
3028 }
3029
3030 real_4 _pchdf (int_4 _p_ k_, real_4 _p_ x_, real_4 _p_ s_, int_4 _p_ ierr_)
3031 { // ** body not listed **
3069 }
3070
3071 int_4 _pchdoc (void)
3072 { // ** body not listed **
3075 }
3076
3077 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
3078 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, real_4 _p_ de_, int_4 _p_ ierr_)
3079 { // ** body not listed **
3196 }
3197
3198 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
3199 _p_ ne_, real_4 _p_ xe_, real_4 _p_ fe_, int_4 _p_ ierr_)
3200 { // ** body not listed **
3317 }
3318
3319 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
3320 _p_ a_, real_4 _p_ b_, int_4 _p_ ierr_)
3321 { // ** body not listed **
3436 }
3437
3438 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_
3439 d_, int_4 _p_ incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
3440 { // ** body not listed **
3541 }
3542
3543 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
3544 _p_ ia_, int_4 _p_ ib_, int_4 _p_ ierr_)
3545 { // ** body not listed **
3639 }
3640 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_)
3641 { // ** body not listed **
3775 }
3776
3777 int_4 _pchkt (int_4 _p_ n_, real_4 _p_ x_, int_4 _p_ knotyp_, real_4 _p_ t_)
3778 { // ** body not listed **
3806 }
3807
3808 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_
3809 incfd_, real_4 _p_ wk_, int_4 _p_ nwk_, int_4 _p_ ierr_)
3810 { // ** body not listed **
4048 }
4049
4050 real_4 _pchst (real_4 _p_ arg1_, real_4 _p_ arg2_)
4051 { // ** body not listed **
4081 }
4082
4083 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_,
4084 int_4 _p_ ierr_)
4085 { // ** body not listed **
4219 }
4220
© 2002-2025 J.M. van der Veer (jmvdveer@xs4all.nl)
|