-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enforce formatting of C++ code (#76)
* add clang format * add github action check * indent * move around * run make format-cpp * pin clang-format version? * try 18 * pin version * Revert "run make format-cpp" This reverts commit 576f925. * run `make format-cpp` * remove a few pragma messages * run format * add includes
- Loading branch information
1 parent
8646354
commit 4b2cde6
Showing
98 changed files
with
28,148 additions
and
28,336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BasedOnStyle: Google | ||
IndentWidth: 2 | ||
UseTab: Never | ||
ColumnLimit: 100 | ||
IndentPPDirectives: AfterHash | ||
AlignAfterOpenBracket: BlockIndent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
#include "DichGammaBMD_NC.h" | ||
|
||
#ifdef R_COMPILATION | ||
//necessary things to run in R | ||
#include <RcppGSL.h> | ||
#include <RcppEigen.h> | ||
// necessary things to run in R | ||
# include <RcppEigen.h> | ||
# include <RcppGSL.h> | ||
#else | ||
#include <Eigen/Dense> | ||
# include <Eigen/Dense> | ||
#endif | ||
|
||
#include <gsl/gsl_blas.h> | ||
#include <gsl/gsl_cdf.h> | ||
#include <gsl/gsl_ieee_utils.h> | ||
#include <gsl/gsl_integration.h> | ||
#include <gsl/gsl_linalg.h> | ||
#include <gsl/gsl_math.h> | ||
#include <gsl/gsl_matrix.h> | ||
#include <gsl/gsl_randist.h> | ||
#include <gsl/gsl_rng.h> | ||
#include <gsl/gsl_test.h> | ||
#include <gsl/gsl_ieee_utils.h> | ||
#include <gsl/gsl_integration.h> | ||
#include <gsl/gsl_vector.h> | ||
#include <gsl/gsl_matrix.h> | ||
#include <gsl/gsl_blas.h> | ||
#include <gsl/gsl_linalg.h> | ||
#include <gsl/gsl_cdf.h> | ||
|
||
double GAMMA_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data){ | ||
log_gamma_inequality *M = (log_gamma_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = GAMMA_G(theta(0, 0)); | ||
double a = GAMMA_A(theta(1, 0)); | ||
double Z = GAMMA_EXTRA_Z(g, a, BMR); //note BMD is a placeholder | ||
Z = Z/BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
double GAMMA_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
log_gamma_inequality* M = (log_gamma_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = GAMMA_G(theta(0, 0)); | ||
double a = GAMMA_A(theta(1, 0)); | ||
double Z = GAMMA_EXTRA_Z(g, a, BMR); // note BMD is a placeholder | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
} | ||
|
||
double GAMMA_BMD_ADDED_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
log_gamma_inequality *M = (log_gamma_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
log_gamma_inequality* M = (log_gamma_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = GAMMA_G(theta(0, 0)); | ||
double a = GAMMA_A(theta(1, 0)); | ||
double g = GAMMA_G(theta(0, 0)); | ||
double a = GAMMA_A(theta(1, 0)); | ||
|
||
double Z = GAMMA_ADDED_Z(g, a, BMR); | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
double Z = GAMMA_ADDED_Z(g, a, BMR); | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
|
||
rV = (geq)? inequality - Z: Z - inequality; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
|
||
return rV; | ||
return rV; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,49 @@ | ||
#define STRICT_R_HEADERS | ||
|
||
#include "DichLogProbitBMD_NC.h" | ||
|
||
#include <gsl/gsl_cdf.h> | ||
#include <gsl/gsl_randist.h> | ||
#include "DichLogProbitBMD_NC.h" | ||
|
||
#ifdef R_COMPILATION | ||
//necessary things to run in R | ||
#include <RcppGSL.h> | ||
#include <RcppEigen.h> | ||
// necessary things to run in R | ||
# include <RcppEigen.h> | ||
# include <RcppGSL.h> | ||
#else | ||
#include <Eigen/Dense> | ||
# include <Eigen/Dense> | ||
#endif | ||
|
||
|
||
double logProbit_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data){ | ||
log_probit_inequality *M = (log_probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = LOGPROBIT_G(theta(0, 0)); | ||
double a = LOGPROBIT_A(theta(1, 0)); | ||
double Z = LOGPROBIT_EXTRA_Z(g, a, BMR); //note BMD is a placeholder | ||
Z = Z / log(BMD); | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
double logProbit_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
log_probit_inequality* M = (log_probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = LOGPROBIT_G(theta(0, 0)); | ||
double a = LOGPROBIT_A(theta(1, 0)); | ||
double Z = LOGPROBIT_EXTRA_Z(g, a, BMR); // note BMD is a placeholder | ||
Z = Z / log(BMD); | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
} | ||
|
||
double logProbit_BMD_ADDED_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
log_probit_inequality *M = (log_probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = LOGPROBIT_G(theta(0, 0)); | ||
double a = LOGPROBIT_A(theta(1, 0)); | ||
log_probit_inequality* M = (log_probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double g = LOGPROBIT_G(theta(0, 0)); | ||
double a = LOGPROBIT_A(theta(1, 0)); | ||
|
||
double Z = LOGPROBIT_ADDED_Z(g, a, BMR); | ||
Z = Z / log(BMD); | ||
double rV = 0.0; | ||
double Z = LOGPROBIT_ADDED_Z(g, a, BMR); | ||
Z = Z / log(BMD); | ||
double rV = 0.0; | ||
|
||
rV = (geq)? inequality - Z: Z - inequality; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
|
||
return rV; | ||
return rV; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
#include "DichLogisticBMD_NC.h" | ||
|
||
#ifdef R_COMPILATION | ||
//necessary things to run in R | ||
#include <RcppGSL.h> | ||
#include <RcppEigen.h> | ||
// necessary things to run in R | ||
# include <RcppEigen.h> | ||
# include <RcppGSL.h> | ||
#else | ||
#include <Eigen/Dense> | ||
# include <Eigen/Dense> | ||
#endif | ||
|
||
double LOGISTIC_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
logistic_inequality *M = (logistic_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = LOGISTIC_A(theta(0, 0)); | ||
double Z = LOGISTIC_EXTRA_Z(a, BMR); //note BMD is a placeholder | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
logistic_inequality* M = (logistic_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = LOGISTIC_A(theta(0, 0)); | ||
double Z = LOGISTIC_EXTRA_Z(a, BMR); // note BMD is a placeholder | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
} | ||
|
||
double LOGISTIC_BMD_ADDED_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
logistic_inequality *M = (logistic_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
logistic_inequality* M = (logistic_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = LOGISTIC_A(theta(0, 0)); | ||
double Z = LOGISTIC_ADDED_Z(a, BMR); | ||
Z = pow(Z, a) / pow(BMD, a); | ||
double rV = 0.0; | ||
double a = LOGISTIC_A(theta(0, 0)); | ||
double Z = LOGISTIC_ADDED_Z(a, BMR); | ||
Z = pow(Z, a) / pow(BMD, a); | ||
double rV = 0.0; | ||
|
||
rV = (geq) ? inequality - Z : Z - inequality; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
|
||
return rV; | ||
return rV; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#include "DichProbitBMD_NC.h" | ||
|
||
#ifdef R_COMPILATION | ||
//necessary things to run in R | ||
#include <RcppGSL.h> | ||
#include <RcppEigen.h> | ||
// necessary things to run in R | ||
# include <RcppEigen.h> | ||
# include <RcppGSL.h> | ||
#else | ||
#include <Eigen/Dense> | ||
# include <Eigen/Dense> | ||
#endif | ||
|
||
#include <gsl/gsl_cdf.h> | ||
#include <gsl/gsl_randist.h> | ||
|
||
double PROBIT_BMD_EXTRA_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
probit_inequality *M = (probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = PROBIT_A(theta(0, 0)); | ||
double Z = PROBIT_EXTRA_Z(a, BMR); //note BMD is a placeholder | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
probit_inequality* M = (probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = PROBIT_A(theta(0, 0)); | ||
double Z = PROBIT_EXTRA_Z(a, BMR); // note BMD is a placeholder | ||
Z = Z / BMD; | ||
double rV = 0.0; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
return rV; | ||
} | ||
|
||
double PROBIT_BMD_ADDED_NC_INEQUALITY(Eigen::MatrixXd theta, void* data) { | ||
probit_inequality *M = (probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
probit_inequality* M = (probit_inequality*)data; | ||
double inequality = M->inequality; | ||
double BMD = M->BMD; | ||
double BMR = M->BMR; | ||
bool geq = M->geq; | ||
|
||
double a = PROBIT_A(theta(0, 0)); | ||
double Z = PROBIT_ADDED_Z(a, BMR); | ||
Z = pow(Z, a) / pow(BMD, a); | ||
double rV = 0.0; | ||
double a = PROBIT_A(theta(0, 0)); | ||
double Z = PROBIT_ADDED_Z(a, BMR); | ||
Z = pow(Z, a) / pow(BMD, a); | ||
double rV = 0.0; | ||
|
||
rV = (geq) ? inequality - Z : Z - inequality; | ||
rV = (geq) ? inequality - Z : Z - inequality; | ||
|
||
return rV; | ||
return rV; | ||
} |
Oops, something went wrong.