prelude-mathlib.c
1 //! @file prelude-mathlib.c
2 //! @author J. Marcel van der Veer
3
4 //! @section Copyright
5 //!
6 //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
7 //! Copyright 2001-2024 J. Marcel van der Veer [algol68g@xs4all.nl].
8
9 //! @section License
10 //!
11 //! This program is free software; you can redistribute it and/or modify it
12 //! under the terms of the GNU General Public License as published by the
13 //! Free Software Foundation; either version 3 of the License, or
14 //! (at your option) any later version.
15 //!
16 //! This program is distributed in the hope that it will be useful, but
17 //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 //! more details. You should have received a copy of the GNU General Public
20 //! License along with this program. If not, see [http://www.gnu.org/licenses/].
21
22 //! @section Synopsis
23 //!
24 //! Standard prelude definitions from GNU R math library.
25
26 #include "a68g.h"
27 #include "a68g-prelude.h"
28 #include "a68g-prelude-mathlib.h"
29
30 #if defined (HAVE_MATHLIB)
31
32 void stand_mathlib (void)
33 {
34 // R specific special functions
35 a68_idf (A68_EXT, "rdigamma", A68_MCACHE (proc_real_real), genie_R_digamma_real);
36 a68_idf (A68_EXT, "rtrigamma", A68_MCACHE (proc_real_real), genie_R_trigamma_real);
37 a68_idf (A68_EXT, "rtetragamma", A68_MCACHE (proc_real_real), genie_R_tetragamma_real);
38 a68_idf (A68_EXT, "rpentagamma", A68_MCACHE (proc_real_real), genie_R_pentagamma_real);
39 a68_idf (A68_EXT, "rpsigamma", A68_MCACHE (proc_real_real_real), genie_R_psigamma_real);
40 // R distribution related functions
41 MOID_T *m = A68_MCACHE (proc_real_real);
42 a68_idf (A68_EXT, "rrt", m, genie_R_rt_real);
43 a68_idf (A68_EXT, "rrchisq", m, genie_R_rchisq_real);
44 a68_idf (A68_EXT, "rrexp", m, genie_R_rexp_real);
45 a68_idf (A68_EXT, "rrgeom", m, genie_R_rgeom_real);
46 a68_idf (A68_EXT, "rrpois", m, genie_R_rpois_real);
47 a68_idf (A68_EXT, "rrsignrank", m, genie_R_rsignrank_real);
48 m = A68_MCACHE (proc_real_real_real);
49 a68_idf (A68_EXT, "rrbeta", m, genie_R_rbeta_real);
50 a68_idf (A68_EXT, "rrbinom", m, genie_R_rbinom_real);
51 a68_idf (A68_EXT, "rrcauchy", m, genie_R_rcauchy_real);
52 a68_idf (A68_EXT, "rrf", m, genie_R_rf_real);
53 a68_idf (A68_EXT, "rrlogis", m, genie_R_rlogis_real);
54 a68_idf (A68_EXT, "rrlnorm", m, genie_R_rlnorm_real);
55 a68_idf (A68_EXT, "rrnbinom", m, genie_R_rnbinom_real);
56 a68_idf (A68_EXT, "rrnorm", m, genie_R_rnorm_real);
57 a68_idf (A68_EXT, "rrunif", m, genie_R_runif_real);
58 a68_idf (A68_EXT, "rrweibull", m, genie_R_rweibull_real);
59 a68_idf (A68_EXT, "rrwilcox", m, genie_R_rwilcox_real);
60 m = a68_proc (M_REAL, M_REAL, M_REAL, M_BOOL, NO_MOID);
61 a68_idf (A68_EXT, "rdt", m, genie_R_dt_real);
62 a68_idf (A68_EXT, "rdchisq", m, genie_R_dchisq_real);
63 a68_idf (A68_EXT, "rdexp", m, genie_R_dexp_real);
64 a68_idf (A68_EXT, "rdgeom", m, genie_R_dgeom_real);
65 a68_idf (A68_EXT, "rdpois", m, genie_R_dpois_real);
66 m = a68_proc (M_REAL, M_REAL, M_REAL, M_REAL, M_BOOL, NO_MOID);
67 a68_idf (A68_EXT, "rdnorm", m, genie_R_dnorm_real);
68 a68_idf (A68_EXT, "rdbeta", m, genie_R_dbeta_real);
69 a68_idf (A68_EXT, "rdbinom", m, genie_R_dbinom_real);
70 a68_idf (A68_EXT, "rdnchisq", m, genie_R_dnchisq_real);
71 a68_idf (A68_EXT, "rdcauchy", m, genie_R_dcauchy_real);
72 a68_idf (A68_EXT, "rdf", m, genie_R_df_real);
73 a68_idf (A68_EXT, "rdlogis", m, genie_R_dlogis_real);
74 a68_idf (A68_EXT, "rdlnorm", m, genie_R_dlnorm_real);
75 a68_idf (A68_EXT, "rdnbinom", m, genie_R_dnbinom_real);
76 a68_idf (A68_EXT, "rdnt", m, genie_R_dnt_real);
77 a68_idf (A68_EXT, "rdunif", m, genie_R_dunif_real);
78 a68_idf (A68_EXT, "rdweibull", m, genie_R_dweibull_real);
79 m = a68_proc (M_REAL, M_REAL, M_REAL, M_REAL, M_REAL, M_BOOL, NO_MOID);
80 a68_idf (A68_EXT, "rdnf", m, genie_R_dnf_real);
81 a68_idf (A68_EXT, "rdhyper", m, genie_R_dhyper_real);
82 m = a68_proc (M_REAL, M_REAL, M_REAL, M_REAL, NO_MOID);
83 a68_idf (A68_EXT, "rrhyper", m, genie_R_rhyper_real);
84 m = a68_proc (M_REAL, M_REAL, M_REAL, M_BOOL, M_BOOL, NO_MOID);
85 a68_idf (A68_EXT, "rpt", m, genie_R_pt_real);
86 a68_idf (A68_EXT, "rqt", m, genie_R_qt_real);
87 a68_idf (A68_EXT, "rpchisq", m, genie_R_pchisq_real);
88 a68_idf (A68_EXT, "rqchisq", m, genie_R_qchisq_real);
89 a68_idf (A68_EXT, "rpexp", m, genie_R_pexp_real);
90 a68_idf (A68_EXT, "rqexp", m, genie_R_qexp_real);
91 a68_idf (A68_EXT, "rpgeom", m, genie_R_pgeom_real);
92 a68_idf (A68_EXT, "rqgeom", m, genie_R_qgeom_real);
93 a68_idf (A68_EXT, "rppois", m, genie_R_ppois_real);
94 a68_idf (A68_EXT, "rqpois", m, genie_R_qpois_real);
95 m = a68_proc (M_REAL, M_REAL, M_REAL, M_REAL, M_BOOL, M_BOOL, NO_MOID);
96 a68_idf (A68_EXT, "rpnorm", m, genie_R_pnorm_real);
97 a68_idf (A68_EXT, "rqnorm", m, genie_R_qnorm_real);
98 a68_idf (A68_EXT, "rpbeta", m, genie_R_pbeta_real);
99 a68_idf (A68_EXT, "rqbeta", m, genie_R_qbeta_real);
100 a68_idf (A68_EXT, "rpbinom", m, genie_R_pbinom_real);
101 a68_idf (A68_EXT, "rqbinom", m, genie_R_qbinom_real);
102 a68_idf (A68_EXT, "rpnchisq", m, genie_R_pnchisq_real);
103 a68_idf (A68_EXT, "rqnchisq", m, genie_R_qnchisq_real);
104 a68_idf (A68_EXT, "rpcauchy", m, genie_R_pcauchy_real);
105 a68_idf (A68_EXT, "rqcauchy", m, genie_R_qcauchy_real);
106 a68_idf (A68_EXT, "rpf", m, genie_R_pf_real);
107 a68_idf (A68_EXT, "rqf", m, genie_R_qf_real);
108 a68_idf (A68_EXT, "rplogis", m, genie_R_plogis_real);
109 a68_idf (A68_EXT, "rqlogis", m, genie_R_qlogis_real);
110 a68_idf (A68_EXT, "rplnorm", m, genie_R_plnorm_real);
111 a68_idf (A68_EXT, "rqlnorm", m, genie_R_qlnorm_real);
112 a68_idf (A68_EXT, "rpnbinom", m, genie_R_pnbinom_real);
113 a68_idf (A68_EXT, "rqnbinom", m, genie_R_qnbinom_real);
114 a68_idf (A68_EXT, "rpnt", m, genie_R_pnt_real);
115 a68_idf (A68_EXT, "rqnt", m, genie_R_qnt_real);
116 a68_idf (A68_EXT, "rpunif", m, genie_R_punif_real);
117 a68_idf (A68_EXT, "rqunif", m, genie_R_qunif_real);
118 a68_idf (A68_EXT, "rpweibull", m, genie_R_pweibull_real);
119 a68_idf (A68_EXT, "rqweibull", m, genie_R_qweibull_real);
120 m = a68_proc (M_REAL, M_REAL, M_REAL, M_REAL, M_REAL, M_BOOL, M_BOOL, NO_MOID);
121 a68_idf (A68_EXT, "rptukey", m, genie_R_ptukey_real);
122 a68_idf (A68_EXT, "rqtukey", m, genie_R_qtukey_real);
123 a68_idf (A68_EXT, "rpnf", m, genie_R_pnf_real);
124 a68_idf (A68_EXT, "rqnf", m, genie_R_qnf_real);
125 a68_idf (A68_EXT, "rphyper", m, genie_R_phyper_real);
126 a68_idf (A68_EXT, "rqhyper", m, genie_R_qhyper_real);
127 m = a68_proc (M_REAL, M_REAL, M_REAL, M_BOOL, NO_MOID);
128 a68_idf (A68_EXT, "rdsignrank", m, genie_R_dsignrank_real);
129 a68_idf (A68_EXT, "rdwilcox", m, genie_R_dwilcox_real);
130 m = a68_proc (M_REAL, M_REAL, M_REAL, M_BOOL, M_BOOL, NO_MOID);
131 a68_idf (A68_EXT, "rpsignrank", m, genie_R_psignrank_real);
132 a68_idf (A68_EXT, "rqsignrank", m, genie_R_qsignrank_real);
133 a68_idf (A68_EXT, "rpwilcox", m, genie_R_pwilcox_real);
134 a68_idf (A68_EXT, "rqwilcox", m, genie_R_qwilcox_real);
135 }
136
137 #endif
© 2002-2024 J.M. van der Veer (jmvdveer@xs4all.nl)
|