/usr/include/boost/icl
NameSizeModeActions
concept/-0755rm
detail/-0755rm
predicates/-0755rm
type_traits/-0755rm
associative_element_container.hpp8620644editdlrm
associative_interval_container.hpp9970644editdlrm
closed_interval.hpp42520644editdlrm
continuous_interval.hpp71480644editdlrm
discrete_interval.hpp69910644editdlrm
dynamic_interval_traits.hpp13060644editdlrm
functors.hpp164890644editdlrm
gregorian.hpp42250644editdlrm
impl_config.hpp31190644editdlrm
interval.hpp59830644editdlrm
interval_base_map.hpp566990644editdlrm
interval_base_set.hpp225010644editdlrm
interval_bounds.hpp28930644editdlrm
interval_combining_style.hpp9450644editdlrm
interval_map.hpp118720644editdlrm
interval_set.hpp81240644editdlrm
interval_traits.hpp19000644editdlrm
iterator.hpp37420644editdlrm
left_open_interval.hpp45050644editdlrm
map.hpp262820644editdlrm
open_interval.hpp44420644editdlrm
ptime.hpp43170644editdlrm
rational.hpp22190644editdlrm
right_open_interval.hpp44220644editdlrm
separate_interval_set.hpp79280644editdlrm
set.hpp8730644editdlrm
split_interval_map.hpp105930644editdlrm
split_interval_set.hpp86160644editdlrm
Edit: /usr/include/boost/icl/open_interval.hpp (4442B)
/*-----------------------------------------------------------------------------+ Copyright (c) 2010-2010: Joachim Faulhaber +------------------------------------------------------------------------------+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENCE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +-----------------------------------------------------------------------------*/ #ifndef BOOST_ICL_OPEN_INTERVAL_HPP_JOFA_100930 #define BOOST_ICL_OPEN_INTERVAL_HPP_JOFA_100930 #include #include #include #include #include #include namespace boost{namespace icl { template class open_interval { public: typedef open_interval type; typedef DomainT domain_type; typedef ICL_COMPARE_DOMAIN(Compare,DomainT) domain_compare; public: //========================================================================== //= Construct, copy, destruct //========================================================================== /** Default constructor; yields an empty interval (0,0). */ open_interval() : _lwb(identity_element::value()), _upb(identity_element::value()) { BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept)); BOOST_CONCEPT_ASSERT((LessThanComparableConcept)); } //NOTE: Compiler generated copy constructor is used /** Constructor for an open singleton interval (val-1,val+1) */ explicit open_interval(const DomainT& val) : _lwb(pred(val)), _upb(succ(val)) { BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept)); BOOST_CONCEPT_ASSERT((LessThanComparableConcept)); // Only for discrete types this ctor creates an interval containing // a single element only. BOOST_STATIC_ASSERT((icl::is_discrete::value)); BOOST_ASSERT((numeric_minimum::value > ::is_less_than(val) )); } /** Interval from low to up with bounds bounds */ open_interval(const DomainT& low, const DomainT& up) : _lwb(low), _upb(up) { BOOST_CONCEPT_ASSERT((DefaultConstructibleConcept)); BOOST_CONCEPT_ASSERT((LessThanComparableConcept)); } DomainT lower()const{ return _lwb; } DomainT upper()const{ return _upb; } private: DomainT _lwb; DomainT _upb; }; //============================================================================== //=T open_interval -> concept intervals //============================================================================== template struct interval_traits< icl::open_interval > { typedef DomainT domain_type; typedef ICL_COMPARE_DOMAIN(Compare,DomainT) domain_compare; typedef icl::open_interval interval_type; static interval_type construct(const domain_type& lo, const domain_type& up) { return interval_type(lo, up); } static domain_type lower(const interval_type& inter_val){ return inter_val.lower(); } static domain_type upper(const interval_type& inter_val){ return inter_val.upper(); } }; //============================================================================== //= Type traits //============================================================================== template struct interval_bound_type< open_interval > { typedef interval_bound_type type; BOOST_STATIC_CONSTANT(bound_type, value = interval_bounds::static_open); }; template struct type_to_string > { static std::string apply() { return "(I)<"+ type_to_string::apply() +">"; } }; template struct value_size > { static std::size_t apply(const icl::open_interval&) { return 2; } }; }} // namespace icl boost #endif