From 3935ba39d30666dd7d4a831155631847c77b70c4 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 2 Aug 2017 08:46:58 +0000 Subject: Massive patch using LLVM coding style. It was generated with: clang-format -style=LLVM -i *.cpp *.h Please set your editor to replace tabs with spaces and use indentation of 2 spaces. --- src/vc.h | 180 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 88 insertions(+), 92 deletions(-) (limited to 'src/vc.h') diff --git a/src/vc.h b/src/vc.h index 43c6979..c6f66b4 100644 --- a/src/vc.h +++ b/src/vc.h @@ -19,25 +19,25 @@ #ifndef __VC_H__ #define __VC_H__ -#include "gsl/gsl_vector.h" #include "gsl/gsl_matrix.h" -#include "param.h" +#include "gsl/gsl_vector.h" #include "io.h" +#include "param.h" using namespace std; class VC_PARAM { public: - const gsl_matrix *K; - const gsl_matrix *W; - const gsl_vector *y; - gsl_matrix *P; - gsl_vector *Py; - gsl_matrix *KPy_mat; - gsl_matrix *PKPy_mat; - gsl_matrix *Hessian; - bool noconstrain; + const gsl_matrix *K; + const gsl_matrix *W; + const gsl_vector *y; + gsl_matrix *P; + gsl_vector *Py; + gsl_matrix *KPy_mat; + gsl_matrix *PKPy_mat; + gsl_matrix *Hessian; + bool noconstrain; }; class VC { @@ -45,91 +45,87 @@ class VC { public: // IO-related parameters size_t a_mode; - string file_cat; - string file_beta; - string file_cor; - string file_mq; - string file_ms; - - string file_out; - string path_out; - - set setSnps; - - size_t ni_total_ref, ns_total_ref, ns_pair; - size_t ni_total, ns_total, ns_test; - size_t n_vc; - - double pve_total, se_pve_total; - vector v_sigma2; - vector v_se_sigma2; - vector v_pve; - vector v_se_pve; - vector v_traceG; - vector v_beta; - vector v_se_beta; - - size_t crt; - double window_cm, window_bp, window_ns; - - double time_UtX; - double time_opt; - - // Main functions. - void CopyFromParam (PARAM &cPar); - void CopyToParam (PARAM &cPar); - void WriteFile_qs (const gsl_vector *s_vec, const gsl_vector *q_vec, - const gsl_vector *qvar_vec, const gsl_matrix *S_mat, - const gsl_matrix *Svar_mat); - void CalcVChe (const gsl_matrix *K, const gsl_matrix *W, - const gsl_vector *y); - void CalcVCreml (const bool noconstrain, const gsl_matrix *K, - const gsl_matrix *W, const gsl_vector *y); - void CalcVCacl (const gsl_matrix *K, const gsl_matrix *W, - const gsl_vector *y); + string file_cat; + string file_beta; + string file_cor; + string file_mq; + string file_ms; + + string file_out; + string path_out; + + set setSnps; + + size_t ni_total_ref, ns_total_ref, ns_pair; + size_t ni_total, ns_total, ns_test; + size_t n_vc; + + double pve_total, se_pve_total; + vector v_sigma2; + vector v_se_sigma2; + vector v_pve; + vector v_se_pve; + vector v_traceG; + vector v_beta; + vector v_se_beta; + + size_t crt; + double window_cm, window_bp, window_ns; + + double time_UtX; + double time_opt; + + // Main functions. + void CopyFromParam(PARAM &cPar); + void CopyToParam(PARAM &cPar); + void WriteFile_qs(const gsl_vector *s_vec, const gsl_vector *q_vec, + const gsl_vector *qvar_vec, const gsl_matrix *S_mat, + const gsl_matrix *Svar_mat); + void CalcVChe(const gsl_matrix *K, const gsl_matrix *W, const gsl_vector *y); + void CalcVCreml(const bool noconstrain, const gsl_matrix *K, + const gsl_matrix *W, const gsl_vector *y); + void CalcVCacl(const gsl_matrix *K, const gsl_matrix *W, const gsl_vector *y); }; void CalcVCss(const gsl_matrix *Vq, const gsl_matrix *S_mat, - const gsl_matrix *Svar_mat, const gsl_vector *q_vec, - const gsl_vector *s_vec, const double df, vector &v_pve, - vector &v_se_pve, double &pve_total, - double &se_pve_total, vector &v_sigma2, - vector &v_se_sigma2, vector &v_enrich, - vector &v_se_enrich); - -bool BimbamXwz (const string &file_geno, const int display_pace, - vector &indicator_idv, vector &indicator_snp, - const vector &vec_cat, const gsl_vector *w, - const gsl_vector *z, size_t ns_test, gsl_matrix *XWz); -bool PlinkXwz (const string &file_bed, const int display_pace, - vector &indicator_idv, vector &indicator_snp, - const vector &vec_cat, const gsl_vector *w, - const gsl_vector *z, size_t ns_test, gsl_matrix *XWz); -bool MFILEXwz (const size_t mfile_mode, const string &file_mfile, - const int display_pace, vector &indicator_idv, - vector > &mindicator_snp, - const vector &vec_cat, const gsl_vector *w, - const gsl_vector *z, gsl_matrix *XWz); - -bool BimbamXtXwz (const string &file_geno, const int display_pace, - vector &indicator_idv, vector &indicator_snp, - const gsl_matrix *XWz, size_t ns_test, gsl_matrix *XtXWz); -bool PlinkXtXwz (const string &file_bed, const int display_pace, - vector &indicator_idv, vector &indicator_snp, - const gsl_matrix *XWz, size_t ns_test, gsl_matrix *XtXWz); -bool MFILEXtXwz (const size_t mfile_mode, const string &file_mfile, - const int display_pace, vector &indicator_idv, - vector > &mindicator_snp, const gsl_matrix *XWz, - gsl_matrix *XtXWz); + const gsl_matrix *Svar_mat, const gsl_vector *q_vec, + const gsl_vector *s_vec, const double df, vector &v_pve, + vector &v_se_pve, double &pve_total, double &se_pve_total, + vector &v_sigma2, vector &v_se_sigma2, + vector &v_enrich, vector &v_se_enrich); + +bool BimbamXwz(const string &file_geno, const int display_pace, + vector &indicator_idv, vector &indicator_snp, + const vector &vec_cat, const gsl_vector *w, + const gsl_vector *z, size_t ns_test, gsl_matrix *XWz); +bool PlinkXwz(const string &file_bed, const int display_pace, + vector &indicator_idv, vector &indicator_snp, + const vector &vec_cat, const gsl_vector *w, + const gsl_vector *z, size_t ns_test, gsl_matrix *XWz); +bool MFILEXwz(const size_t mfile_mode, const string &file_mfile, + const int display_pace, vector &indicator_idv, + vector> &mindicator_snp, + const vector &vec_cat, const gsl_vector *w, + const gsl_vector *z, gsl_matrix *XWz); + +bool BimbamXtXwz(const string &file_geno, const int display_pace, + vector &indicator_idv, vector &indicator_snp, + const gsl_matrix *XWz, size_t ns_test, gsl_matrix *XtXWz); +bool PlinkXtXwz(const string &file_bed, const int display_pace, + vector &indicator_idv, vector &indicator_snp, + const gsl_matrix *XWz, size_t ns_test, gsl_matrix *XtXWz); +bool MFILEXtXwz(const size_t mfile_mode, const string &file_mfile, + const int display_pace, vector &indicator_idv, + vector> &mindicator_snp, const gsl_matrix *XWz, + gsl_matrix *XtXWz); void CalcCIss(const gsl_matrix *Xz, const gsl_matrix *XWz, - const gsl_matrix *XtXWz, const gsl_matrix *S_mat, - const gsl_matrix *Svar_mat, const gsl_vector *w, - const gsl_vector *z, const gsl_vector *s_vec, - const vector &vec_cat, const vector &v_pve, - vector &v_se_pve, double &pve_total, - double &se_pve_total, vector &v_sigma2, - vector &v_se_sigma2, vector &v_enrich, - vector &v_se_enrich); + const gsl_matrix *XtXWz, const gsl_matrix *S_mat, + const gsl_matrix *Svar_mat, const gsl_vector *w, + const gsl_vector *z, const gsl_vector *s_vec, + const vector &vec_cat, const vector &v_pve, + vector &v_se_pve, double &pve_total, double &se_pve_total, + vector &v_sigma2, vector &v_se_sigma2, + vector &v_enrich, vector &v_se_enrich); #endif -- cgit v1.2.3