Skip to content

Commit

Permalink
Solved bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfomunoz committed May 10, 2024
1 parent fc9e1cd commit f3cc24f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/newton-cotes/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class Region {
const std::array<Float,DIMSUB>& b,const Norm& norm = Norm()) const {
static_assert(DIM>=DIMSUB,"Cannot calculate the subrange pdf for that many dimensions, as the region has less dimensions");
Float den = this->pdf_integral_subrange(a,b,norm);
if (den<1.e-10) den=1;
return Range(a,b).volume()*norm(this->approximation_at(pos))/den;
if (den<1.e-10) return Float(0);
else return Range(a,b).volume()*norm(this->approximation_at(pos))/den;
}

template<std::size_t DIMSUB,typename Norm = NormDefault>
Expand Down

0 comments on commit f3cc24f

Please sign in to comment.