From ea88c91def176856d2ec51841a9f72cbaede9413 Mon Sep 17 00:00:00 2001 From: James Eapen Date: Thu, 8 Aug 2024 14:36:27 -0400 Subject: [PATCH] refactor(bsseq): make initializations one line when same type --- src/bsseq.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/bsseq.hpp b/src/bsseq.hpp index 25c9d22..2d0a8a2 100644 --- a/src/bsseq.hpp +++ b/src/bsseq.hpp @@ -15,8 +15,7 @@ #include "../inst/include/iscream_types.h" typedef struct CpG { - int chr; - int start; + int chr, start; } CpG; static kh_inline khint_t kh_eq_cpg(CpG a, CpG b) { @@ -50,10 +49,7 @@ class BS { khmap_t *cpg_map; bool is_merged; - int n_intervals; - int n_cpgs; - int chr_id; - int n_samples; + int n_intervals, n_cpgs, chr_id, n_samples; Rcpp::CharacterVector seqnames; Rcpp::IntegerVector start; std::vector sample_names; @@ -66,8 +62,7 @@ class BS { void print_mat(std::vector>& matrix, const std::string& matrix_name); void print_BS(); - arma::umat cov_mat; - arma::umat m_mat; + arma::umat cov_mat, m_mat; Rcpp::List assays; Rcpp::S4 wrap() { Rcpp::Function BSseq("BSseq", Rcpp::Environment::namespace_env("bsseq"));