@@ -229,7 +229,7 @@ size_t SLiMMemoryUsageForMutationRefcounts(void)
229229// A global counter used to assign all Mutation objects a unique ID
230230slim_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) :
233233mutation_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) :
304304mutation_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