Skip to content

Commit

Permalink
Seems to be working reasonably OK.
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfomunoz committed May 7, 2024
1 parent 579560d commit f6a8e7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/control-variates/region-sampling.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class region_sampling_importance {
sample[i] = dis(rng);
}
auto pos = reg->sample_subrange(sample,range,norm);
return std::tuple<std::array<Float,DIM>,Float>(pos,1.0/reg->pdf_subrange(pos,range,norm));
return std::tuple<std::array<Float,DIM>,Float>(pos,range.volume()/reg->pdf_subrange(pos,range,norm));
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/newton-cotes/rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ struct Simpson {
if ((r>=t0) && (r<=t1)) return r;
}
//Uniform sampling if not found a solution before
std::cout<<"Warning, no solutions for range "<<t0<<" - "<<t1;
for (Float r : res) std::cout<<" "<<r;
std::cout<<std::endl;
//std::cout<<"Warning, no solutions for range "<<t0<<" - "<<t1;
//for (Float r : res) std::cout<<" "<<r;
//std::cout<<std::endl;
return s*(t1-t0) + t0;
}

Expand Down

0 comments on commit f6a8e7a

Please sign in to comment.