Skip to content

Commit

Permalink
Attempt to fix the Solaris problem on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
RLumSK committed Jun 12, 2020
1 parent 2b4345c commit 277a8e1
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions src/MC_C_CW_IRSL_LOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_CW_IRSL_LOC")]]
List MC_C_CW_IRSL_LOC(arma::vec times, int n_filled, double r, double A) {
List MC_C_CW_IRSL_LOC(arma::vec times, double n_filled, double r, double A) {
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
//r: detrapping ratio [cm^-3]
Expand Down Expand Up @@ -47,7 +47,7 @@ List MC_C_CW_IRSL_LOC(arma::vec times, int n_filled, double r, double A) {
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled, 2) / (r + n_filled));
signal(t,0) = P * (pow(n_filled, 2.0) / (r + n_filled));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/MC_C_CW_IRSL_TUN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_CW_IRSL_TUN")]]
List MC_C_CW_IRSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double A) {
List MC_C_CW_IRSL_TUN(arma::vec times, double N_e, arma::vec r, double rho, double A) {

//determine delta_t which allows to have delta t != 1
double delta_t = calc_deltat(times);
Expand All @@ -27,7 +27,7 @@ List MC_C_CW_IRSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double

std::size_t n_filled = N_e;

double P = A * exp(-(pow(rho,-1.0/3)) * r[k]);
double P = A * exp(-(pow(rho,-1.0/3.0)) * r[k]);

for(std::size_t t = 0; t < times.size(); ++t){

Expand All @@ -43,7 +43,7 @@ List MC_C_CW_IRSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double
break;

} // end n_filled
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2) * exp(-(pow(r[k],3)));
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2.0) * exp(-(pow(r[k],3.0)));
remaining_e(t,k) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_CW_OSL_DELOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_CW_OSL_DELOC")]]
List MC_C_CW_OSL_DELOC(arma::vec times, int N_e, int n_filled, double R, double A) {
List MC_C_CW_OSL_DELOC(arma::vec times, double N_e, double n_filled, double R, double A) {
//N >> N_e total: concentration of traps [cm^-3]
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
Expand Down Expand Up @@ -48,7 +48,7 @@ List MC_C_CW_OSL_DELOC(arma::vec times, int N_e, int n_filled, double R, double
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled,2) / (N_e * R + n_filled * (1 - R)));
signal(t,0) = P * (pow(n_filled,2.0) / (N_e * R + n_filled * (1 - R)));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_ISO_DELOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_ISO_DELOC")]]
List MC_C_ISO_DELOC(arma::vec times, int N_e, int n_filled, double R, double E, double s, double T) {
List MC_C_ISO_DELOC(arma::vec times, double N_e, double n_filled, double R, double E, double s, double T) {
//N >> N_e total: concentration of traps [cm^-3]
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
Expand Down Expand Up @@ -54,7 +54,7 @@ List MC_C_ISO_DELOC(arma::vec times, int N_e, int n_filled, double R, double E,

//calculate signal and remaining filled (here we have n_filled^2 before
//we have this per particle)
signal(t,0) = P * (pow(n_filled,2) / (N_e * R + n_filled * (1 - R)));
signal(t,0) = P * (pow(n_filled,2.0) / (N_e * R + n_filled * (1 - R)));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_ISO_LOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_ISO_LOC")]]
List MC_C_ISO_LOC(arma::vec times, int n_filled, double r, double E, double s, double T) {
List MC_C_ISO_LOC(arma::vec times, double n_filled, double r, double E, double s, double T) {
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
//E: energy of the trap [eV]
Expand Down Expand Up @@ -52,7 +52,7 @@ List MC_C_ISO_LOC(arma::vec times, int n_filled, double r, double E, double s, d
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled, 2) / (r + n_filled));
signal(t,0) = P * (pow(n_filled, 2.0) / (r + n_filled));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/MC_C_ISO_TUN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_ISO_TUN")]]
List MC_C_ISO_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, double s, double T) {
List MC_C_ISO_TUN(arma::vec times, double N_e, arma::vec r, double rho, double E, double s, double T) {

//determine delta_t which allows to have delta t != 1
double delta_t = calc_deltat(times);
Expand All @@ -29,7 +29,7 @@ List MC_C_ISO_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, d

std::size_t n_filled = N_e;

double P = ((s * exp(-E/(k_B * (273 + T)))) * exp(-(pow(rho,-1.0/3)) * r[k]));
double P = ((s * exp(-E/(k_B * (273 + T)))) * exp(-(pow(rho,-1.0/3.0)) * r[k]));

for(std::size_t t = 0; t < times.size(); ++t){
for(std::size_t j = 0; j < n_filled; ++j){
Expand All @@ -44,7 +44,7 @@ List MC_C_ISO_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, d
break;

} // end n_filled
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2) * exp(-(pow(r[k],3)));
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2.0) * exp(-(pow(r[k],3.0)));
remaining_e(t,k) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_LM_OSL_DELOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_LM_OSL_DELOC")]]
List MC_C_LM_OSL_DELOC(arma::vec times, int N_e, int n_filled, double R, double A) {
List MC_C_LM_OSL_DELOC(arma::vec times, double N_e, double n_filled, double R, double A) {
//N >> N_e total: concentration of traps [cm^-3]
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
Expand Down Expand Up @@ -48,7 +48,7 @@ List MC_C_LM_OSL_DELOC(arma::vec times, int N_e, int n_filled, double R, double
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled,2) / (N_e * R + n_filled * (1 - R)));
signal(t,0) = P * (pow(n_filled,2.0) / (N_e * R + n_filled * (1 - R)));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_LM_OSL_LOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_LM_OSL_LOC")]]
List MC_C_LM_OSL_LOC(arma::vec times, int n_filled, double r, double A) {
List MC_C_LM_OSL_LOC(arma::vec times, double n_filled, double r, double A) {
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
//r: detrapping ratio [cm^-3]
Expand Down Expand Up @@ -47,7 +47,7 @@ List MC_C_LM_OSL_LOC(arma::vec times, int n_filled, double r, double A) {
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled, 2) / (r + n_filled));
signal(t,0) = P * (pow(n_filled, 2.0) / (r + n_filled));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/MC_C_LM_OSL_TUN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_LM_OSL_TUN")]]
List MC_C_LM_OSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double A) {
List MC_C_LM_OSL_TUN(arma::vec times, double N_e, arma::vec r, double rho, double A) {

//determine delta_t which allows to have delta t != 1
double delta_t = calc_deltat(times);
Expand All @@ -29,7 +29,7 @@ List MC_C_LM_OSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double A

for(std::size_t t = 0; t < times.size(); ++t){

double P = A * (times[t]/max(times)) * exp(-(pow(rho,-1.0/3)) * r[k]);
double P = A * (times[t]/max(times)) * exp(-(pow(rho,-1.0/3.0)) * r[k]);

for(std::size_t j = 0; j < n_filled; ++j){

Expand All @@ -43,7 +43,7 @@ List MC_C_LM_OSL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double A
break;

} // end n_filled
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2) * exp(-(pow(r[k],3)));
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2.0) * exp(-(pow(r[k],3.0)));
remaining_e(t,k) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_TL_DELOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_TL_DELOC")]]
List MC_C_TL_DELOC(arma::vec times, int N_e, int n_filled, double R, double E, double s, double b) {
List MC_C_TL_DELOC(arma::vec times, double N_e, double n_filled, double R, double E, double s, double b) {
//N >> N_e total: concentration of traps [cm^-3]
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
Expand Down Expand Up @@ -54,7 +54,7 @@ List MC_C_TL_DELOC(arma::vec times, int N_e, int n_filled, double R, double E, d
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled,2) / (N_e * R + n_filled * (1 - R)));
signal(t,0) = P * (pow(n_filled,2.0) / (N_e * R + n_filled * (1 - R)));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MC_C_TL_LOC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_TL_LOC")]]
List MC_C_TL_LOC(arma::vec times, int n_filled, double r, double E, double s, double b) {
List MC_C_TL_LOC(arma::vec times, double n_filled, double r, double E, double s, double b) {
//n >> n_filled: concentration of filled traps [cm^-3]
//t >> times: refers basically to the temperature
//E: energy of the trap [eV]
Expand Down Expand Up @@ -52,7 +52,7 @@ List MC_C_TL_LOC(arma::vec times, int n_filled, double r, double E, double s, do
} // end n_filled

//calculate signal and remaining filled
signal(t,0) = P * (pow(n_filled, 2) / (r + n_filled));
signal(t,0) = P * (pow(n_filled, 2.0) / (r + n_filled));
remaining_e(t,0) = n_filled;

if (n_filled == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/MC_C_TL_TUN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace Rcpp;

// [[Rcpp::export("MC_C_TL_TUN")]]
List MC_C_TL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, double s, double b) {
List MC_C_TL_TUN(arma::vec times, double N_e, arma::vec r, double rho, double E, double s, double b) {

double k_B = 8.617*pow(10.0,-5.0);

Expand All @@ -28,7 +28,7 @@ List MC_C_TL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, do

for(std::size_t t = 0; t < times.size(); ++t){

double P = s * exp(-E/(k_B * (273 + times[t] * b))) * exp(-(pow(rho,-1.0/3)) * r[k]);
double P = s * exp(-E/(k_B * (273 + times[t] * b))) * exp(-(pow(rho,-1.0/3.0)) * r[k]);

for(std::size_t j = 0; j < n_filled; ++j){

Expand All @@ -41,7 +41,7 @@ List MC_C_TL_TUN(arma::vec times, int N_e, arma::vec r, double rho, double E, do
break;

} // end n_filled
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2) * exp(-(pow(r[k],3)));
signal(t,k) = n_filled * P * 3 * pow((double)r[k],2.0) * exp(-(pow(r[k],3.0)));
remaining_e(t,k) = n_filled;

if (n_filled == 0)
Expand Down
Loading

0 comments on commit 277a8e1

Please sign in to comment.