Skip to content

Commit

Permalink
update to 4.2.2 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne authored Jan 25, 2023
1 parent 5c5dfd6 commit be5aaa4
Show file tree
Hide file tree
Showing 38 changed files with 1,107 additions and 530 deletions.
2 changes: 1 addition & 1 deletion RVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.4
4.2.2
37 changes: 12 additions & 25 deletions include/R_ext/RS.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1999-2016 The R Core Team.
* Copyright (C) 1999-2022 The R Core Team.
*
* This header file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -21,7 +21,7 @@
* https://www.R-project.org/Licenses/
*/

/* Included by R.h: API */
/* Included by R.h: mainly API */

#ifndef R_RS_H
#define R_RS_H
Expand All @@ -42,47 +42,32 @@
extern "C" {
#endif

/* S Like Error Handling */

#include <R_ext/Error.h> /* for error and warning */

#ifndef STRICT_R_HEADERS

#define R_PROBLEM_BUFSIZE 4096
/* Parentheses added for FC4 with gcc4 and -D_FORTIFY_SOURCE=2 */
#define PROBLEM {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
#define MESSAGE {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
#define ERROR ),error(R_problem_buf);}
#define RECOVER(x) ),error(R_problem_buf);}
#define WARNING(x) ),warning(R_problem_buf);}
#define LOCAL_EVALUATOR /**/
#define NULL_ENTRY /**/
#define WARN WARNING(NULL)

#endif

/* S Like Memory Management */

extern void *R_chk_calloc(R_SIZE_T, R_SIZE_T);
extern void *R_chk_realloc(void *, R_SIZE_T);
extern void R_chk_free(void *);

#ifndef STRICT_R_HEADERS
/* S-PLUS 3.x but not 5.x NULLs the pointer in the following */
/* S-PLUS 3.x but not 5.x NULLed the pointer in Free */
#define Calloc(n, t) (t *) R_chk_calloc( (R_SIZE_T) (n), sizeof(t) )
#define Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (R_SIZE_T)((n) * sizeof(t)) )
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
#endif

#define R_Calloc(n, t) (t *) R_chk_calloc( (R_SIZE_T) (n), sizeof(t) )
#define R_Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (R_SIZE_T)((n) * sizeof(t)) )
#define R_Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)

/* undocumented until 4.1.2: widely used. */
#define Memcpy(p,q,n) memcpy( p, q, (R_SIZE_T)(n) * sizeof(*p) )

/* added for 3.0.0 */
/* added for 3.0.0 but undocumented until 4.1.2.
Used by a couple of packages. */
#define Memzero(p,n) memset(p, 0, (R_SIZE_T)(n) * sizeof(*p))

#define CallocCharBuf(n) (char *) R_chk_calloc((R_SIZE_T) ((n)+1), sizeof(char))
/* Added in R 2.6.0 */
#define CallocCharBuf(n) (char *) R_chk_calloc(((R_SIZE_T)(n))+1, sizeof(char))

/* S Like Fortran Interface */
/* These may not be adequate everywhere. Convex had _ prepending common
Expand All @@ -98,9 +83,11 @@ extern void R_chk_free(void *);
#define F77_COM(x) F77_CALL(x)
#define F77_COMDECL(x) F77_CALL(x)

#ifndef NO_CALL_R
/* Depreacated in R 2.15.0, non-API
#if !defined(NO_CALL_R) && defined(DECLARE_LEGACY_CALL_R)
void call_R(char*, long, void**, char**, long*, char**, long, char**);
#endif
*/

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions include/R_ext/Random.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1998-2019 The R Core Team
* Copyright (C) 1998-2022 The R Core Team
*
* This header file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -58,7 +58,7 @@ typedef enum {
ROUNDING,
REJECTION
} Sampletype;
Sampletype R_sample_kind();
Sampletype R_sample_kind(void);

void GetRNGstate(void);
void PutRNGstate(void);
Expand Down
24 changes: 12 additions & 12 deletions include/Rmath.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- C -*-
* Mathlib : A C Library of Special Functions
* Copyright (C) 1998-2018 The R Core Team
* Copyright (C) 1998-2022 The R Core Team
* Copyright (C) 2004 The R Foundation
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -26,6 +26,7 @@
and nothing else.
It is part of the API and supports 'standalone Rmath'.
Some entries possibly are not yet documented in 'Writing R Extensions'.
*/
#ifndef RMATH_H
Expand All @@ -35,12 +36,9 @@
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#endif

#if defined(__cplusplus) && !defined(DO_NOT_USE_CXX_HEADERS)
# include <cmath>
// See comment in R.h
# ifdef __SUNPRO_CC
using namespace std;
# endif
#else
# include <math.h>
#endif
Expand Down Expand Up @@ -254,6 +252,7 @@ double Rlog1p(double);
#define lgammafn Rf_lgammafn
#define lgammafn_sign Rf_lgammafn_sign
#define lgamma1p Rf_lgamma1p
#define log1mexp Rf_log1mexp
#define log1pexp Rf_log1pexp
#define log1pmx Rf_log1pmx
#define logspace_add Rf_logspace_add
Expand Down Expand Up @@ -390,9 +389,11 @@ double pgamma(double, double, double, int, int);
double qgamma(double, double, double, int, int);
double rgamma(double, double);

double log1pmx(double);
double log1pmx(double); /* Accurate log(1+x) - x, {care for small x} */
double log1pexp(double); // <-- ../nmath/plogis.c
double lgamma1p(double);
double log1mexp(double);
double lgamma1p(double);/* accurate log(gamma(x+1)), small x (0 < x < 0.5) */

double logspace_add(double, double);
double logspace_sub(double, double);
double logspace_sum(const double *, int);
Expand Down Expand Up @@ -447,7 +448,7 @@ double pbinom(double, double, double, int, int);
double qbinom(double, double, double, int, int);
double rbinom(double, double);

/* Multnomial Distribution */
/* Multinomial Distribution */

void rmultinom(int, double*, int, int*);

Expand Down Expand Up @@ -543,13 +544,14 @@ double dwilcox(double, double, double, int);
double pwilcox(double, double, double, int, int);
double qwilcox(double, double, double, int, int);
double rwilcox(double, double);

void wilcox_free(void);
/* Wilcoxon Signed Rank Distribution */

double dsignrank(double, double, int);
double psignrank(double, double, int, int);
double qsignrank(double, double, int, int);
double rsignrank(double);
void signrank_free(void);

/* Gamma and Related Functions */
double gammafn(double);
Expand Down Expand Up @@ -592,9 +594,6 @@ double fround(double, double);
double fsign(double, double);
double ftrunc(double);

double log1pmx(double); /* Accurate log(1+x) - x, {care for small x} */
double lgamma1p(double);/* accurate log(gamma(x+1)), small x (0 < x < 0.5) */

/* More accurate cos(pi*x), sin(pi*x), tan(pi*x)
These declarations might clash with system headers if someone had
Expand All @@ -607,6 +606,7 @@ double cospi(double);
double sinpi(double);
double tanpi(double);
#endif
double Rtanpi(double); /* our own in any case */

/* Compute the log of a sum or difference from logs of terms, i.e.,
*
Expand Down
Loading

0 comments on commit be5aaa4

Please sign in to comment.