Skip to content

Commit

Permalink
replace Calloc with R_Calloc
Browse files Browse the repository at this point in the history
  • Loading branch information
stc04003 committed Oct 3, 2024
1 parent 78f09d8 commit 7921cc4
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 172 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: reReg
Title: Recurrent Event Regression
Version: 1.4.6
Version: 1.4.7
Authors@R: c(person(given = "Sy Han (Steven)", family = "Chiou",
email = "[email protected]",
role = c("aut", "cre")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `reReg` 1.4.7
* Changed Calloc to R_Calloc
# `reReg` 1.4.6
* Changed maintainer email
* Changed last.bumpup to right.polygons in geom_dl() when showName is specified
Expand Down
9 changes: 5 additions & 4 deletions src/Ghosh.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <R.h>
#include <Rmath.h>
#include <math.h>
#include <stdlib.h>

// \code{glU2} gives equation U2 in GL (2003) [eq. 4].
//
Expand All @@ -16,7 +17,7 @@ void glU2(int *n, int *p, int *start, int *M,
double *yi, double *tij, double *X,
double *weight, double *result) {
int i, j, k, r;
double *nu = Calloc(*p, double);
double *nu = R_Calloc(*p, double);
double de;
for (i = 0; i < *n; i++) {
for (k = 0; k < M[i]; k++) {
Expand Down Expand Up @@ -94,7 +95,7 @@ void glHaz(int *n, int *status, int *ny0, double *yi, double *y0, double *result
void log_ns_est(double *beta, double *Y, double *X, double *delta, int *clsize,
int *n, int *p, int *N, double *weights, double *gw, double *sn) {
int i, j, k, l, ik_idx = 0, jl_idx, r;
double *e = Calloc(*N, double), *nu = Calloc(*p, double);
double *e = R_Calloc(*N, double), *nu = R_Calloc(*p, double);
double de = 0.0;
for (i = 0; i < *N; i++) {
e[i] = 0.0;
Expand Down Expand Up @@ -137,7 +138,7 @@ void log_ns_est(double *beta, double *Y, double *X, double *delta, int *clsize,
/* void lwyy(double *Tik, double *Y, double *X, double *wgt, int *cl, int *clsz, */
/* int *n, int *p, double *res) { */
/* int i, j, k, r; */
/* double *nu = Calloc(*p, double); */
/* double *nu = R_Calloc(*p, double); */
/* double de; */
/* for (i = 0; i < *n; i++) { */
/* for (k = 0; k < cl[i]; k++) { */
Expand Down Expand Up @@ -175,7 +176,7 @@ void log_ns_est(double *beta, double *Y, double *X, double *delta, int *clsize,
void coxGL(double *Tik, double *Y, double *X, double *xb, double *wgt,
int *len_Tik, int *cl, int *clsz, int *n, int *p, double *res) {
int i, j, k, r;
double *nu = Calloc(*p, double);
double *nu = R_Calloc(*p, double);
double de;
for (i = 0; i < *n; i++) {
for (k = 0; k < cl[i]; k++) {
Expand Down
484 changes: 317 additions & 167 deletions vignettes/reReg-plot.html

Large diffs are not rendered by default.

0 comments on commit 7921cc4

Please sign in to comment.