Skip to content

Commit

Permalink
update fix #72
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Oct 14, 2024
1 parent d2649ef commit d5b2425
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/DEploid/dEploidIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void DEploidIO::reInit() {


void DEploidIO::finalize() {
if ( this->doIbdPainting() | this->doComputeLLK() | this->doIbdViterbiPainting() ) {
if ( this->doIbdPainting() || this->doComputeLLK() || this->doIbdViterbiPainting() ) {
if (!initialPropWasGiven()) {
throw InitialPropUngiven("");
}
Expand Down Expand Up @@ -541,7 +541,7 @@ void DEploidIO::checkInput() {
// set k strain by proportion length
}
}
if (this->useBestPractice() & (!this->usePanel())){
if (this->useBestPractice() && (!this->usePanel())){
throw FlagsConflict("-best" , string("-noPanel. Reference panel is") +
string("required for using best-practices."));
}
Expand Down Expand Up @@ -764,7 +764,7 @@ void DEploidIO::readPanel() {
if ( this->usePanel() == false ) {
return;
}
if ( this->doIbdPainting() | this->doComputeLLK() ) {
if ( this->doIbdPainting() || this->doComputeLLK() ) {
return;
}

Expand Down
6 changes: 4 additions & 2 deletions src/DEploid/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ struct ShouldNotBeCalled : std::exception{
ShouldNotBeCalled() { }
virtual ~ShouldNotBeCalled() throw() {}
virtual const char* what() const noexcept {
return string("Should not reach here").c_str();
static const std::string msg = "Should not reach here";
return msg.c_str();
}
};

Expand Down Expand Up @@ -75,7 +76,8 @@ struct OutOfVectorSize : std::exception{
OutOfVectorSize() { }
virtual ~OutOfVectorSize() throw() {}
virtual const char* what() const noexcept {
return string("Out of vector size!").c_str();
static const std::string msg = "Out of vector size!";
return msg.c_str();
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/DEploid/mcmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void McmcMachinery::runMcmcChain( bool showProgress, bool useIBD, bool notInR )
this->mcmcSample_->siteOfOneMissCopyOne[atSiteI] /= (double)this->maxIteration_;
}

if ( notInR & ((jobbrief == "lassoK") | (jobbrief == "ibd") | (jobbrief == "classic")) ) { // notInPython
if ( notInR & ((jobbrief == "lassoK") || (jobbrief == "ibd") || (jobbrief == "classic")) ) { // notInPython
this->dEploidIO_->writeMcmcRelated(this->mcmcSample_, jobbrief, useIBD);
}

Expand Down
4 changes: 2 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
/* .Call calls */
extern SEXP _DEploid_dEploid(SEXP);
extern SEXP _DEploid_extractVcf(SEXP);
extern SEXP _DEploid_test_RRG_sample();
extern SEXP _DEploid_test_RRG_sample(void);
extern SEXP _DEploid_test_RRG_sampleExpoExpoLimit(SEXP, SEXP, SEXP);
extern SEXP _DEploid_test_RRG_sampleUnitExpo();
extern SEXP _DEploid_test_RRG_sampleUnitExpo(void);

static const R_CallMethodDef CallEntries[] = {
{"_DEploid_dEploid", (DL_FUNC) &_DEploid_dEploid, 1},
Expand Down

0 comments on commit d5b2425

Please sign in to comment.