33 #ifndef SHARK_OBJECTIVEFUNCTIONS_BOXCONSTRAINTHANDLER_H 34 #define SHARK_OBJECTIVEFUNCTIONS_BOXCONSTRAINTHANDLER_H 41 template<
class Vector>
45 :m_lower(lower),m_upper(upper){
48 this->
m_features |= base_type::CAN_PROVIDE_CLOSEST_FEASIBLE;
49 this->
m_features |= base_type::IS_BOX_CONSTRAINED;
50 this->
m_features |= base_type::CAN_GENERATE_RANDOM_POINT;
53 :m_lower(Vector(dim,lower)),m_upper(Vector(dim,upper)){
55 this->
m_features |= base_type::CAN_PROVIDE_CLOSEST_FEASIBLE;
56 this->
m_features |= base_type::IS_BOX_CONSTRAINED;
57 this->
m_features |= base_type::CAN_GENERATE_RANDOM_POINT;
62 this->
m_features |= base_type::CAN_PROVIDE_CLOSEST_FEASIBLE;
63 this->
m_features |= base_type::IS_BOX_CONSTRAINED;
64 this->
m_features |= base_type::CAN_GENERATE_RANDOM_POINT;
68 return m_lower.size();
74 if(point(i) + 1.e-13 < m_lower(i)||point(i) - 1.e-13 > m_upper(i))
82 point(i) = std::max(point(i),m_lower(i));
83 point(i) = std::min(point(i),m_upper(i));
89 for(std::size_t i = 0; i !=
dimensions(); ++i){
90 startingPoint(i) =
random::uni(rng, m_lower(i),m_upper(i));
103 m_lower = Vector(dimension,lower);
104 m_upper = Vector(dimension,upper);