8 UniformBox::UniformBox(Eigen::MatrixXd
const& boundsIn) :
Distribution(boundsIn.rows(),
11 volume(ComputeVolume(boundsIn)) {
17 return (boundsIn.col(1)-boundsIn.col(0)).prod();
22 Eigen::MatrixXd bounds(boundsVec.size(),2);
23 for(
int i=0; i<boundsVec.size(); ++i){
24 bounds(i,0) = boundsVec.at(i).first;
25 bounds(i,1) = boundsVec.at(i).second;
31 Eigen::MatrixXd UniformBox::CreateBoundsDouble(std::vector<double>
const& boundsVec)
33 assert(boundsVec.size()%2==0);
35 Eigen::MatrixXd bounds(boundsVec.size()/2,2);
36 for(
int i=0; i<boundsVec.size()/2; ++i){
37 bounds(i,0) = boundsVec.at(2*i);
38 bounds(i,1) = boundsVec.at(2*i+1);
46 for(
unsigned int i=0; i<bounds.rows(); ++i ) {
48 const double x = inputs.at(0).get()(i);
51 if( x<bounds(i,0) || x>bounds(i,1) ) {
53 return -std::numeric_limits<double>::infinity();
62 assert(bounds.rows()>0);
64 Eigen::VectorXd sample;
65 sample = bounds.col(0).array() + (bounds.col(1)-bounds.col(0)).array() * RandomGenerator::GetUniform(bounds.rows()).array();
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...