From fd1a51373f35fa111bfbd9c30f9386c603999d03 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Sat, 20 Mar 2021 09:55:56 +0000 Subject: [PATCH] fixing code style check --- src/ibd.cpp | 6 ++++- src/mcmc.hpp | 2 +- tests/unittest/test_utilities.cpp | 38 +++++++++++++++++++++---------- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/ibd.cpp b/src/ibd.cpp index f67bf0b5..537f25ae 100644 --- a/src/ibd.cpp +++ b/src/ibd.cpp @@ -685,7 +685,11 @@ void IBDpath::makeLlkSurf(vector altCount, vector refCount, vector ll; for ( double unadjustedP : pGrid ) { - ll.push_back(log(calcSiteLikelihood(ref, alt, unadjustedP, err, scalingConst))); + ll.push_back(log(calcSiteLikelihood(ref, + alt, + unadjustedP, + err, + scalingConst))); } double llmax = max_value(ll); diff --git a/src/mcmc.hpp b/src/mcmc.hpp index a97360cc..216cdaee 100644 --- a/src/mcmc.hpp +++ b/src/mcmc.hpp @@ -27,7 +27,7 @@ #include #include // std::setw #include -#include // std::pair <> +#include // std::pair<> #include "random/mersenne_twister.hpp" #include "dEploidIO.hpp" #include "panel.hpp" diff --git a/tests/unittest/test_utilities.cpp b/tests/unittest/test_utilities.cpp index 49f3c079..342706dd 100644 --- a/tests/unittest/test_utilities.cpp +++ b/tests/unittest/test_utilities.cpp @@ -253,32 +253,46 @@ class TestUtility : public CppUnit::TestCase { void testCalcLLK() { CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, - log(calcSiteLikelihood(0, 0, 0.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 0, 0.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, - log(calcSiteLikelihood(0, 0, 1.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 0, 1.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, - log(calcSiteLikelihood(0, 0, 0.5, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 0, 0.5, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.09622803, - log(calcSiteLikelihood(10, 0, 0.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(10, 0, 0.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-31.38367782, - log(calcSiteLikelihood(10, 0, 1.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(10, 0, 1.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-6.520005876, - log(calcSiteLikelihood(10, 0, 0.5, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(10, 0, 0.5, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-92.39749823, - log(calcSiteLikelihood(0, 50, 0.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 50, 0.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.4088264558, - log(calcSiteLikelihood(0, 50, 1.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 50, 1.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-26.30680376, - log(calcSiteLikelihood(0, 50, 0.5, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(0, 50, 0.5, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-39.454802987, - log(calcSiteLikelihood(11, 13, 0.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(11, 13, 0.0, this->err_, + this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-82.7561739077, - log(calcSiteLikelihood(41, 2, 1.0, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(41, 2, 1.0, this->err_, this->scalingFactor_)), + ep2); CPPUNIT_ASSERT_DOUBLES_EQUAL(-71.6257227, - log(calcSiteLikelihood(23, 99, 0.5, this->err_, this->scalingFactor_)), ep2); + log(calcSiteLikelihood(23, 99, 0.5, this->err_, + this->scalingFactor_)), + ep2); }