Skip to content
Snippets Groups Projects
Commit c9dac54e authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

GsfMaterialMixtureConvolution: use float::min for small (double) weights

parent 907fd5cf
No related branches found
No related tags found
No related merge requests found
...@@ -274,10 +274,10 @@ Trk::GsfMaterialMixtureConvolution::update( ...@@ -274,10 +274,10 @@ Trk::GsfMaterialMixtureConvolution::update(
// Store component weight // Store component weight
caches[i].weights[j] *= inputState[i].second; caches[i].weights[j] *= inputState[i].second;
// Ensure weight of component is not too small to save us from potential // Ensure weight of component is not too small to save us from potential
// FPE's Value chosen to be sufficiently small so that the final state // FPE's Value. Weights are double so the min of float should
// will not be impacted // be small enough and should be handled
if (caches[i].weights[j] < 1e-12) { if (caches[i].weights[j] < std::numeric_limits<float>::min()) {
caches[i].weights[j] = 1e-12; caches[i].weights[j] = std::numeric_limits<float>::min();
} }
} }
n += caches[i].weights.size(); n += caches[i].weights.size();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment