Skip to content

Commit 30eb9a7

Browse files
committed
shift to slim_effect_t instead of slim_selcoeff_t
1 parent db483d0 commit 30eb9a7

16 files changed

Lines changed: 85 additions & 85 deletions

QtSLiM/QtSLiMChromosomeWidget_GL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ void QtSLiMChromosomeWidget::glDrawMutations(QRect &interiorRect, Chromosome *ch
265265
// We optimize fixed-DFE mutation types only, and those using a fixed color set by the user
266266
if ((ed_info.dfe_type_ == DFEType::kFixed) || mut_type_fixed_color)
267267
{
268-
slim_selcoeff_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : static_cast<slim_selcoeff_t>(ed_info.dfe_parameters_[0]));
268+
slim_effect_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : static_cast<slim_effect_t>(ed_info.dfe_parameters_[0]));
269269

270270
EIDOS_BZERO(heightBuffer, static_cast<size_t>(displayPixelWidth) * sizeof(int16_t));
271271

QtSLiM/QtSLiMChromosomeWidget_QT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void QtSLiMChromosomeWidget::qtDrawMutations(QRect &interiorRect, Chromosome *ch
261261
// We optimize fixed-DFE mutation types only, and those using a fixed color set by the user
262262
if ((ed_info.dfe_type_ == DFEType::kFixed) || mut_type_fixed_color)
263263
{
264-
slim_selcoeff_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : static_cast<slim_selcoeff_t>(ed_info.dfe_parameters_[0]));
264+
slim_effect_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : static_cast<slim_effect_t>(ed_info.dfe_parameters_[0]));
265265

266266
EIDOS_BZERO(heightBuffer, static_cast<size_t>(displayPixelWidth) * sizeof(int16_t));
267267

SLiMgui/ChromosomeView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ - (void)drawMutationsInInteriorRect:(NSRect)interiorRect chromosome:(Chromosome
706706
// We optimize fixed-DFE mutation types only, and those using a fixed color set by the user
707707
if ((ed_info.dfe_type_ == DFEType::kFixed) || mut_type_fixed_color)
708708
{
709-
slim_selcoeff_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : (slim_selcoeff_t)ed_info.dfe_parameters_[0]);
709+
slim_effect_t mut_type_selcoeff = (mut_type_fixed_color ? 0.0 : (slim_effect_t)ed_info.dfe_parameters_[0]);
710710

711711
EIDOS_BZERO(heightBuffer, displayPixelWidth * sizeof(int16_t));
712712

core/chromosome.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ MutationIndex Chromosome::DrawNewMutation(std::pair<slim_position_t, GenomicElem
10351035
const GenomicElementType &genomic_element_type = *(source_element.genomic_element_type_ptr_);
10361036
MutationType *mutation_type_ptr = genomic_element_type.DrawMutationType();
10371037

1038-
slim_selcoeff_t selection_coeff = static_cast<slim_selcoeff_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
1038+
slim_effect_t selection_coeff = static_cast<slim_effect_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
10391039

10401040
// NOTE THAT THE STACKING POLICY IS NOT ENFORCED HERE, SINCE WE DO NOT KNOW WHAT HAPLOSOME WE WILL BE INSERTED INTO! THIS IS THE CALLER'S RESPONSIBILITY!
10411041
MutationIndex new_mut_index = SLiM_NewMutationFromBlock();
@@ -1405,7 +1405,7 @@ MutationIndex Chromosome::DrawNewMutationExtended(std::pair<slim_position_t, Gen
14051405
// Draw mutation type and selection coefficient, and create the new mutation
14061406
MutationType *mutation_type_ptr = genomic_element_type.DrawMutationType();
14071407

1408-
slim_selcoeff_t selection_coeff = static_cast<slim_selcoeff_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
1408+
slim_effect_t selection_coeff = static_cast<slim_effect_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
14091409

14101410
// NOTE THAT THE STACKING POLICY IS NOT ENFORCED HERE! THIS IS THE CALLER'S RESPONSIBILITY!
14111411
MutationIndex new_mut_index = SLiM_NewMutationFromBlock();

core/haplosome.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,7 +2897,7 @@ EidosValue_SP Haplosome_Class::ExecuteMethod_addNewMutation(EidosGlobalStringID
28972897

28982898
MutationIndex new_mut_index = SLiM_NewMutationFromBlock();
28992899

2900-
Mutation *new_mut = new (gSLiM_Mutation_Block + new_mut_index) Mutation(mutation_type_ptr, chromosome->Index(), position, static_cast<slim_selcoeff_t>(selection_coeff), mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_, origin_subpop_id, origin_tick, (int8_t)nucleotide); // FIXME MULTITRAIT
2900+
Mutation *new_mut = new (gSLiM_Mutation_Block + new_mut_index) Mutation(mutation_type_ptr, chromosome->Index(), position, static_cast<slim_effect_t>(selection_coeff), mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_, origin_subpop_id, origin_tick, (int8_t)nucleotide); // FIXME MULTITRAIT
29012901

29022902
// This mutation type might not be used by any genomic element type (i.e. might not already be vetted), so we need to check and set pure_neutral_
29032903
// The selection coefficient might have been supplied by the user (i.e., not be from the mutation type's DFE), so we set all_pure_neutral_DFE_ also
@@ -3398,7 +3398,7 @@ EidosValue_SP Haplosome_Class::ExecuteMethod_readHaplosomesFromMS(EidosGlobalStr
33983398

33993399
MutationIndex new_mut_index = SLiM_NewMutationFromBlock();
34003400

3401-
Mutation *new_mut = new (gSLiM_Mutation_Block + new_mut_index) Mutation(mutation_type_ptr, chromosome->Index(), position, static_cast<slim_selcoeff_t>(selection_coeff), mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_, subpop_index, origin_tick, nucleotide); // FIXME MULTITRAIT
3401+
Mutation *new_mut = new (gSLiM_Mutation_Block + new_mut_index) Mutation(mutation_type_ptr, chromosome->Index(), position, static_cast<slim_effect_t>(selection_coeff), mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_, subpop_index, origin_tick, nucleotide); // FIXME MULTITRAIT
34023402

34033403
// This mutation type might not be used by any genomic element type (i.e. might not already be vetted), so we need to check and set pure_neutral_
34043404
if (selection_coeff != 0.0)
@@ -3721,8 +3721,8 @@ EidosValue_SP Haplosome_Class::ExecuteMethod_readHaplosomesFromVCF(EidosGlobalSt
37213721
// parse/validate the INFO fields that we recognize
37223722
std::vector<std::string> info_substrs = Eidos_string_split(info_str, ";");
37233723
std::vector<slim_mutationid_t> info_mutids;
3724-
std::vector<slim_selcoeff_t> info_selcoeffs;
3725-
std::vector<slim_selcoeff_t> info_domcoeffs;
3724+
std::vector<slim_effect_t> info_selcoeffs;
3725+
std::vector<slim_effect_t> info_domcoeffs;
37263726
std::vector<slim_objectid_t> info_poporigin;
37273727
std::vector<slim_tick_t> info_tickorigin;
37283728
std::vector<slim_objectid_t> info_muttype;
@@ -3950,20 +3950,20 @@ EidosValue_SP Haplosome_Class::ExecuteMethod_readHaplosomesFromVCF(EidosGlobalSt
39503950
EIDOS_TERMINATION << "ERROR (Haplosome_Class::ExecuteMethod_readHaplosomesFromVCF): VCF file MT field missing, but no default mutation type was supplied in the mutationType parameter." << EidosTerminate();
39513951

39523952
// get the dominance coefficient from DOM, or use the default coefficient from the mutation type
3953-
slim_selcoeff_t dominance_coeff;
3953+
slim_effect_t dominance_coeff;
39543954

39553955
if (info_domcoeffs.size() > 0)
39563956
dominance_coeff = info_domcoeffs[alt_allele_index];
39573957
else
39583958
dominance_coeff = mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_; // FIXME MULTITRAIT
39593959

39603960
// get the selection coefficient from S, or draw one from the mutation type
3961-
slim_selcoeff_t selection_coeff;
3961+
slim_effect_t selection_coeff;
39623962

39633963
if (info_selcoeffs.size() > 0)
39643964
selection_coeff = info_selcoeffs[alt_allele_index];
39653965
else
3966-
selection_coeff = static_cast<slim_selcoeff_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
3966+
selection_coeff = static_cast<slim_effect_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
39673967

39683968
// get the subpop index from PO, or set to -1; no bounds checking on this
39693969
slim_objectid_t subpop_index = -1;

core/individual.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,8 +4453,8 @@ EidosValue_SP Individual_Class::ExecuteMethod_readIndividualsFromVCF(EidosGlobal
44534453
// parse/validate the INFO fields that we recognize
44544454
std::vector<std::string> info_substrs = Eidos_string_split(info_str, ";");
44554455
std::vector<slim_mutationid_t> info_mutids;
4456-
std::vector<slim_selcoeff_t> info_selcoeffs;
4457-
std::vector<slim_selcoeff_t> info_domcoeffs;
4456+
std::vector<slim_effect_t> info_selcoeffs;
4457+
std::vector<slim_effect_t> info_domcoeffs;
44584458
std::vector<slim_objectid_t> info_poporigin;
44594459
std::vector<slim_tick_t> info_tickorigin;
44604460
std::vector<slim_objectid_t> info_muttype;
@@ -4579,20 +4579,20 @@ EidosValue_SP Individual_Class::ExecuteMethod_readIndividualsFromVCF(EidosGlobal
45794579
EIDOS_TERMINATION << "ERROR (Individual_Class::ExecuteMethod_readIndividualsFromVCF): VCF file MT field missing, but no default mutation type was supplied in the mutationType parameter." << EidosTerminate();
45804580

45814581
// get the dominance coefficient from DOM, or use the default coefficient from the mutation type
4582-
slim_selcoeff_t dominance_coeff;
4582+
slim_effect_t dominance_coeff;
45834583

45844584
if (info_domcoeffs.size() > 0)
45854585
dominance_coeff = info_domcoeffs[alt_allele_index];
45864586
else
45874587
dominance_coeff = mutation_type_ptr->effect_distributions_[0].default_dominance_coeff_; // FIXME MULTITRAIT
45884588

45894589
// get the selection coefficient from S, or draw one from the mutation type
4590-
slim_selcoeff_t selection_coeff;
4590+
slim_effect_t selection_coeff;
45914591

45924592
if (info_selcoeffs.size() > 0)
45934593
selection_coeff = info_selcoeffs[alt_allele_index];
45944594
else
4595-
selection_coeff = static_cast<slim_selcoeff_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
4595+
selection_coeff = static_cast<slim_effect_t>(mutation_type_ptr->DrawEffectForTrait(0)); // FIXME MULTITRAIT
45964596

45974597
// get the subpop index from PO, or set to -1; no bounds checking on this
45984598
slim_objectid_t subpop_index = -1;

core/mutation.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ size_t SLiMMemoryUsageForMutationRefcounts(void)
229229
// A global counter used to assign all Mutation objects a unique ID
230230
slim_mutationid_t gSLiM_next_mutation_id = 0;
231231

232-
Mutation::Mutation(MutationType *p_mutation_type_ptr, slim_chromosome_index_t p_chromosome_index, slim_position_t p_position, slim_selcoeff_t p_selection_coeff, slim_selcoeff_t p_dominance_coeff, slim_objectid_t p_subpop_index, slim_tick_t p_tick, int8_t p_nucleotide) :
232+
Mutation::Mutation(MutationType *p_mutation_type_ptr, slim_chromosome_index_t p_chromosome_index, slim_position_t p_position, slim_effect_t p_selection_coeff, slim_effect_t p_dominance_coeff, slim_objectid_t p_subpop_index, slim_tick_t p_tick, int8_t p_nucleotide) :
233233
mutation_type_ptr_(p_mutation_type_ptr), position_(p_position), selection_coeff_(p_selection_coeff), dominance_coeff_(p_dominance_coeff), subpop_index_(p_subpop_index), origin_tick_(p_tick), chromosome_index_(p_chromosome_index), state_(MutationState::kNewMutation), nucleotide_(p_nucleotide), mutation_id_(gSLiM_next_mutation_id++)
234234
{
235235
#ifdef DEBUG_LOCKS_ENABLED
@@ -240,9 +240,9 @@ mutation_type_ptr_(p_mutation_type_ptr), position_(p_position), selection_coeff_
240240
tag_value_ = SLIM_TAG_UNSET_VALUE;
241241

242242
// cache values used by the fitness calculation code for speed; see header
243-
cached_one_plus_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + selection_coeff_);
244-
cached_one_plus_dom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
245-
cached_one_plus_hemizygousdom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
243+
cached_one_plus_sel_ = (slim_effect_t)std::max(0.0, 1.0 + selection_coeff_);
244+
cached_one_plus_dom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
245+
cached_one_plus_hemizygousdom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
246246

247247
// zero out our refcount, which is now kept in a separate buffer
248248
gSLiM_Mutation_Refcounts[BlockIndex()] = 0;
@@ -281,17 +281,17 @@ mutation_type_ptr_(p_mutation_type_ptr), position_(p_position), selection_coeff_
281281
std::cout << "Class Mutation memory layout (sizeof(Mutation) == " << sizeof(Mutation) << ") :" << std::endl << std::endl;
282282
std::cout << " " << (ptr_mutation_type_ptr_ - ptr_base) << " (" << sizeof(MutationType *) << " bytes): MutationType *mutation_type_ptr_" << std::endl;
283283
std::cout << " " << (ptr_position_ - ptr_base) << " (" << sizeof(slim_position_t) << " bytes): const slim_position_t position_" << std::endl;
284-
std::cout << " " << (ptr_selection_coeff_ - ptr_base) << " (" << sizeof(slim_selcoeff_t) << " bytes): slim_selcoeff_t selection_coeff_" << std::endl;
284+
std::cout << " " << (ptr_selection_coeff_ - ptr_base) << " (" << sizeof(slim_effect_t) << " bytes): slim_effect_t selection_coeff_" << std::endl;
285285
std::cout << " " << (ptr_subpop_index_ - ptr_base) << " (" << sizeof(slim_objectid_t) << " bytes): slim_objectid_t subpop_index_" << std::endl;
286286
std::cout << " " << (ptr_origin_tick_ - ptr_base) << " (" << sizeof(slim_tick_t) << " bytes): const slim_tick_t origin_tick_" << std::endl;
287287
std::cout << " " << (ptr_state_ - ptr_base) << " (" << sizeof(int8_t) << " bytes): const int8_t state_" << std::endl;
288288
std::cout << " " << (ptr_nucleotide_ - ptr_base) << " (" << sizeof(int8_t) << " bytes): const int8_t nucleotide_" << std::endl;
289289
std::cout << " " << (ptr_scratch_ - ptr_base) << " (" << sizeof(int8_t) << " bytes): const int8_t scratch_" << std::endl;
290290
std::cout << " " << (ptr_mutation_id_ - ptr_base) << " (" << sizeof(slim_mutationid_t) << " bytes): const slim_mutationid_t mutation_id_" << std::endl;
291291
std::cout << " " << (ptr_tag_value_ - ptr_base) << " (" << sizeof(slim_usertag_t) << " bytes): slim_usertag_t tag_value_" << std::endl;
292-
std::cout << " " << (ptr_cached_one_plus_sel_ - ptr_base) << " (" << sizeof(slim_selcoeff_t) << " bytes): slim_selcoeff_t cached_one_plus_sel_" << std::endl;
293-
std::cout << " " << (ptr_cached_one_plus_dom_sel_ - ptr_base) << " (" << sizeof(slim_selcoeff_t) << " bytes): slim_selcoeff_t cached_one_plus_dom_sel_" << std::endl;
294-
std::cout << " " << (ptr_cached_one_plus_haploiddom_sel_ - ptr_base) << " (" << sizeof(slim_selcoeff_t) << " bytes): slim_selcoeff_t cached_one_plus_haploiddom_sel_" << std::endl;
292+
std::cout << " " << (ptr_cached_one_plus_sel_ - ptr_base) << " (" << sizeof(slim_effect_t) << " bytes): slim_effect_t cached_one_plus_sel_" << std::endl;
293+
std::cout << " " << (ptr_cached_one_plus_dom_sel_ - ptr_base) << " (" << sizeof(slim_effect_t) << " bytes): slim_effect_t cached_one_plus_dom_sel_" << std::endl;
294+
std::cout << " " << (ptr_cached_one_plus_haploiddom_sel_ - ptr_base) << " (" << sizeof(slim_effect_t) << " bytes): slim_effect_t cached_one_plus_haploiddom_sel_" << std::endl;
295295
std::cout << std::endl;
296296

297297
been_here = true;
@@ -300,16 +300,16 @@ mutation_type_ptr_(p_mutation_type_ptr), position_(p_position), selection_coeff_
300300
#endif
301301
}
302302

303-
Mutation::Mutation(slim_mutationid_t p_mutation_id, MutationType *p_mutation_type_ptr, slim_chromosome_index_t p_chromosome_index, slim_position_t p_position, slim_selcoeff_t p_selection_coeff, slim_selcoeff_t p_dominance_coeff, slim_objectid_t p_subpop_index, slim_tick_t p_tick, int8_t p_nucleotide) :
303+
Mutation::Mutation(slim_mutationid_t p_mutation_id, MutationType *p_mutation_type_ptr, slim_chromosome_index_t p_chromosome_index, slim_position_t p_position, slim_effect_t p_selection_coeff, slim_effect_t p_dominance_coeff, slim_objectid_t p_subpop_index, slim_tick_t p_tick, int8_t p_nucleotide) :
304304
mutation_type_ptr_(p_mutation_type_ptr), position_(p_position), selection_coeff_(p_selection_coeff), dominance_coeff_(p_dominance_coeff), subpop_index_(p_subpop_index), origin_tick_(p_tick), chromosome_index_(p_chromosome_index), state_(MutationState::kNewMutation), nucleotide_(p_nucleotide), mutation_id_(p_mutation_id)
305305
{
306306
// initialize the tag to the "unset" value
307307
tag_value_ = SLIM_TAG_UNSET_VALUE;
308308

309309
// cache values used by the fitness calculation code for speed; see header
310-
cached_one_plus_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + selection_coeff_);
311-
cached_one_plus_dom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
312-
cached_one_plus_hemizygousdom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
310+
cached_one_plus_sel_ = (slim_effect_t)std::max(0.0, 1.0 + selection_coeff_);
311+
cached_one_plus_dom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
312+
cached_one_plus_hemizygousdom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
313313

314314
// zero out our refcount, which is now kept in a separate buffer
315315
gSLiM_Mutation_Refcounts[BlockIndex()] = 0;
@@ -739,9 +739,9 @@ EidosValue_SP Mutation::ExecuteMethod_setSelectionCoeff(EidosGlobalStringID p_me
739739
EidosValue *selectionCoeff_value = p_arguments[0].get();
740740

741741
double value = selectionCoeff_value->FloatAtIndex_NOCAST(0, nullptr);
742-
slim_selcoeff_t old_coeff = selection_coeff_;
742+
slim_effect_t old_coeff = selection_coeff_;
743743

744-
selection_coeff_ = static_cast<slim_selcoeff_t>(value);
744+
selection_coeff_ = static_cast<slim_effect_t>(value);
745745
// intentionally no lower or upper bound; -1.0 is lethal, but DFEs may generate smaller values, and we don't want to prevent or bowdlerize that
746746
// also, the dominance coefficient modifies the selection coefficient, so values < -1 are in fact meaningfully different
747747

@@ -768,9 +768,9 @@ EidosValue_SP Mutation::ExecuteMethod_setSelectionCoeff(EidosGlobalStringID p_me
768768
}
769769

770770
// cache values used by the fitness calculation code for speed; see header
771-
cached_one_plus_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + selection_coeff_);
772-
cached_one_plus_dom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
773-
cached_one_plus_hemizygousdom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
771+
cached_one_plus_sel_ = (slim_effect_t)std::max(0.0, 1.0 + selection_coeff_);
772+
cached_one_plus_dom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
773+
cached_one_plus_hemizygousdom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
774774

775775
return gStaticEidosValueVOID;
776776
}
@@ -784,12 +784,12 @@ EidosValue_SP Mutation::ExecuteMethod_setDominanceCoeff(EidosGlobalStringID p_me
784784

785785
double value = dominanceCoeff_value->FloatAtIndex_NOCAST(0, nullptr);
786786

787-
dominance_coeff_ = static_cast<slim_selcoeff_t>(value); // intentionally no bounds check
787+
dominance_coeff_ = static_cast<slim_effect_t>(value); // intentionally no bounds check
788788

789789
// cache values used by the fitness calculation code for speed; see header
790-
//cached_one_plus_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + selection_coeff_);
791-
cached_one_plus_dom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
792-
//cached_one_plus_hemizygousdom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
790+
//cached_one_plus_sel_ = (slim_effect_t)std::max(0.0, 1.0 + selection_coeff_);
791+
cached_one_plus_dom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
792+
//cached_one_plus_hemizygousdom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
793793

794794
return gStaticEidosValueVOID;
795795
}
@@ -815,9 +815,9 @@ EidosValue_SP Mutation::ExecuteMethod_setMutationType(EidosGlobalStringID p_meth
815815
mutation_type_ptr_->all_pure_neutral_DFE_ = false;
816816

817817
// cache values used by the fitness calculation code for speed; see header
818-
cached_one_plus_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + selection_coeff_);
819-
cached_one_plus_dom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
820-
cached_one_plus_hemizygousdom_sel_ = (slim_selcoeff_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
818+
cached_one_plus_sel_ = (slim_effect_t)std::max(0.0, 1.0 + selection_coeff_);
819+
cached_one_plus_dom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + dominance_coeff_ * selection_coeff_);
820+
cached_one_plus_hemizygousdom_sel_ = (slim_effect_t)std::max(0.0, 1.0 + mutation_type_ptr_->hemizygous_dominance_coeff_ * selection_coeff_);
821821

822822
return gStaticEidosValueVOID;
823823
}

0 commit comments

Comments
 (0)