Skip to content

Commit d1a2410

Browse files
committed
replace MIN/MAX to avoid compilation errors on Windows
1 parent bc4f08e commit d1a2410

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

model/model_dna_rate_variation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void ModelDNARateVariation::estimateRatePerSite(cmaple::Tree* tree){
219219
RealNumType average_rate = rate_count / genome_size;
220220
for(int i = 0; i < genome_size; i++) {
221221
rates[i] /= average_rate;
222-
rates[i] = MIN(100.0, MAX(0.0001, rates[i]));
222+
rates[i] = std::min(100.0, std::max(0.0001, rates[i]));
223223
for(int stateA = 0; stateA < num_states_; stateA++) {
224224
RealNumType row_sum = 0;
225225
for(int stateB = 0; stateB < num_states_; stateB++) {
@@ -611,7 +611,7 @@ void ModelDNARateVariation::estimateRatesPerSitePerEntry(cmaple::Tree* tree) {
611611
RealNumType val = mutation_matrices[i * mat_size + (stateB + row_index[stateA])];
612612
//val /= average_rate;
613613
val /= total_rate;
614-
val = MIN(250.0, MAX(0.001, val));
614+
val = std::min(250.0, std::max(0.001, val));
615615

616616
mutation_matrices[i * mat_size + (stateB + row_index[stateA])] = val;
617617
transposed_mutation_matrices[i * mat_size + (stateA + row_index[stateB])] = val;
@@ -772,4 +772,4 @@ void ModelDNARateVariation::readRatesFile() {
772772
else {
773773
std::cerr << "Unable to open rate matrix file " << rates_filename << std::endl;
774774
}
775-
}
775+
}

0 commit comments

Comments
 (0)