Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 907536c

Browse files
committed
define STRICT_R_HEADERS, change PI to M_PI
1 parent 6d50fa0 commit 907536c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/compute_groupcond_logl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define STRICT_R_HEADERS
12
#include <Rcpp.h>
23
using namespace Rcpp;
34

@@ -41,7 +42,7 @@ double compute_groupcond_logl(NumericMatrix x,
4142
int wn = dims[3];
4243

4344
// constants
44-
double sqrtpi = std::sqrt(2*PI);
45+
double sqrtpi = std::sqrt(2*M_PI);
4546
double cz = std::pow(sqrtpi, zn);
4647
double cw = std::pow(sqrtpi, wn);
4748

@@ -128,4 +129,4 @@ double compute_groupcond_logl(NumericMatrix x,
128129
}
129130

130131
return out - N*std::log(cz*std::sqrt(detveps)*cw*std::sqrt(detvarz)*gamisize);
131-
}
132+
}

src/creg_group_logl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define STRICT_R_HEADERS
12
#include <Rcpp.h>
23
using namespace Rcpp;
34

@@ -54,7 +55,7 @@ NumericVector creg_group_logl_cpp(List datalist, List modellist){
5455
int wn = dims[3];
5556

5657
// constants
57-
double sqrtpi = std::sqrt(2*PI);
58+
double sqrtpi = std::sqrt(2*M_PI);
5859
double cz = std::pow(sqrtpi, zn);
5960
double cw = std::pow(sqrtpi, wn);
6061

@@ -144,4 +145,4 @@ NumericVector creg_group_logl_cpp(List datalist, List modellist){
144145

145146
}
146147
return res;
147-
}
148+
}

0 commit comments

Comments
 (0)