From 1fc0bbad7f03e3f08cbe9a00d07271c4c4526654 Mon Sep 17 00:00:00 2001 From: Zilong-Li Date: Mon, 22 Jan 2024 13:21:51 +0100 Subject: [PATCH] rename function --- src/admixture.cpp | 4 ++-- src/common.hpp | 2 +- src/parse-phaseless.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/admixture.cpp b/src/admixture.cpp index 6ba6240..e61e412 100644 --- a/src/admixture.cpp +++ b/src/admixture.cpp @@ -26,7 +26,7 @@ double Admixture::runOptimalWithBigAss(int ind, const std::unique_ptr & get_cluster_probability(ind, nsnps, alpha, beta, genome->gls[ic], genome->R[ic], genome->PI[ic], genome->F[ic]); // return gamma ae.setZero(C * C, nGrids); - get_cluster_pairs_probabity(ae, genome->R[ic], genome->PI[ic]); + get_cluster_frequency(ae, genome->R[ic], genome->PI[ic]); kapa.setZero(C * K, nGrids); // C x K x M layout Ekg.setZero(K, nGrids); for(s = 0; s < nGrids; s++, m++) @@ -78,7 +78,7 @@ double Admixture::runNativeWithBigAss(int ind, const std::unique_ptr & g beta.setZero(C * C, nGrids); get_cluster_probability(ind, nsnps, alpha, beta, genome->gls[ic], genome->R[ic], genome->PI[ic], genome->F[ic]); ae.setZero(C * C, nGrids); - get_cluster_pairs_probabity(ae, genome->R[ic], genome->PI[ic]); + get_cluster_frequency(ae, genome->R[ic], genome->PI[ic]); iEkc.setZero(C * K, nGrids); Ekg.setZero(K, nGrids); for(s = 0; s < nGrids; s++, m++) diff --git a/src/common.hpp b/src/common.hpp index 93d2d56..ffcaaaa 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -581,7 +581,7 @@ inline auto get_cluster_probability(int ind, return cs; } -inline auto get_cluster_pairs_probabity(MyArr2D & ae, const MyFloat1D & R_, const MyFloat1D & PI_) +inline auto get_cluster_frequency(MyArr2D & ae, const MyFloat1D & R_, const MyFloat1D & PI_) { const int C2 = ae.rows(); const int M = ae.cols(); diff --git a/src/parse-phaseless.cpp b/src/parse-phaseless.cpp index 6c8d14e..c25f108 100644 --- a/src/parse-phaseless.cpp +++ b/src/parse-phaseless.cpp @@ -181,7 +181,7 @@ List parse_impute_par(std::string filename, int ic = -1) get_cluster_probability(ind, iM, alpha, beta, genome->gls[ic], genome->R[ic], genome->PI[ic], genome->F[ic]); if(!((1 - (alpha * beta).colwise().sum()).abs() < 1e-6).all()) cao.error("gamma sum is not 1.0!\n"); ae.setZero(genome->C * genome->C, nGrids); - get_cluster_pairs_probabity(ae, genome->R[ic], genome->PI[ic]); + get_cluster_frequency(ae, genome->R[ic], genome->PI[ic]); alphaI[c] = alpha; betaI[c] = beta; aeI[c] = ae;