|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54347 - in sandbox/itl: boost/itl boost/validate/driver libs/itl/test/test_itl_interval
From: afojgo_at_[hidden]
Date: 2009-06-25 13:27:43
Author: jofaber
Date: 2009-06-25 13:27:43 EDT (Thu, 25 Jun 2009)
New Revision: 54347
URL: http://svn.boost.org/trac/boost/changeset/54347
Log:
Refactoring: Some inlining for interval_sets.
Removed interval<T>::left/right_subtract(2). Stable {msvc-9.0 r+d, gcc-3.4.4}
Text files modified:
sandbox/itl/boost/itl/separate_interval_set.hpp | 6 ++--
sandbox/itl/boost/itl/split_interval_set.hpp | 10 ++++----
sandbox/itl/boost/validate/driver/signed_quantifier_driver.hpp | 42 ++++++++++++++++++++--------------------
sandbox/itl/libs/itl/test/test_itl_interval/test_itl_interval.cpp | 6 ++--
4 files changed, 32 insertions(+), 32 deletions(-)
Modified: sandbox/itl/boost/itl/separate_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/separate_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/separate_interval_set.hpp 2009-06-25 13:27:43 EDT (Thu, 25 Jun 2009)
@@ -143,7 +143,7 @@
template <typename DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-bool separate_interval_set<DomainT,Compare,Interval,Alloc>::contains_(const interval_type& interv)const
+inline bool separate_interval_set<DomainT,Compare,Interval,Alloc>::contains_(const interval_type& interv)const
{
if(interv.empty())
return true;
@@ -155,7 +155,7 @@
template<class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-void separate_interval_set<DomainT,Compare,Interval,Alloc>::add_(const value_type& addend)
+inline void separate_interval_set<DomainT,Compare,Interval,Alloc>::add_(const value_type& addend)
{
if(addend.empty()) return;
@@ -185,7 +185,7 @@
template<class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-void separate_interval_set<DomainT,Compare,Interval,Alloc>::subtract_(const value_type& minuend)
+inline void separate_interval_set<DomainT,Compare,Interval,Alloc>::subtract_(const value_type& minuend)
{
if(minuend.empty()) return;
iterator fst_it = this->_set.lower_bound(minuend);
Modified: sandbox/itl/boost/itl/split_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/split_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/split_interval_set.hpp 2009-06-25 13:27:43 EDT (Thu, 25 Jun 2009)
@@ -142,7 +142,7 @@
} ;
template <typename DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-bool split_interval_set<DomainT,Compare,Interval,Alloc>::contains_(const interval_type& interv)const
+inline bool split_interval_set<DomainT,Compare,Interval,Alloc>::contains_(const interval_type& interv)const
{
if(interv.empty())
return true;
@@ -154,7 +154,7 @@
template <typename DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-void split_interval_set<DomainT,Compare,Interval,Alloc>::add_(const value_type& addend)
+inline void split_interval_set<DomainT,Compare,Interval,Alloc>::add_(const value_type& addend)
{
if(addend.empty()) return;
@@ -211,8 +211,8 @@
template <typename DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-void split_interval_set<DomainT,Compare,Interval,Alloc>::insert_rest(interval_type& addend, iterator& it, iterator& end_it)
-{
+inline void split_interval_set<DomainT,Compare,Interval,Alloc>::insert_rest(interval_type& addend, iterator& it, iterator& end_it)
+{//JODO add_rest
interval_type left_gap, cur_itv;
iterator pred_it = it; --pred_it;
while(it != end_it)
@@ -230,7 +230,7 @@
template<class DomainT, ITL_COMPARE Compare, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
-void split_interval_set<DomainT,Compare,Interval,Alloc>::subtract_(const value_type& minuend)
+inline void split_interval_set<DomainT,Compare,Interval,Alloc>::subtract_(const value_type& minuend)
{
if(minuend.empty()) return;
iterator fst_it = this->_set.lower_bound(minuend);
Modified: sandbox/itl/boost/validate/driver/signed_quantifier_driver.hpp
==============================================================================
--- sandbox/itl/boost/validate/driver/signed_quantifier_driver.hpp (original)
+++ sandbox/itl/boost/validate/driver/signed_quantifier_driver.hpp 2009-06-25 13:27:43 EDT (Thu, 25 Jun 2009)
@@ -33,9 +33,9 @@
_rootChoice[RootType::interval_set] = 0;
_rootChoice[RootType::separate_interval_set] = 0;
_rootChoice[RootType::split_interval_set] = 0;
- _rootChoice[RootType::itl_map] = 0;//33;
- _rootChoice[RootType::interval_map] = 0;//33;
- _rootChoice[RootType::split_interval_map] = 100;//34;
+ _rootChoice[RootType::itl_map] = 33;
+ _rootChoice[RootType::interval_map] = 33;
+ _rootChoice[RootType::split_interval_map] = 34;
setRootTypeNames();
_rootChoice.init();
@@ -101,25 +101,25 @@
switch(rootChoice)
{
//-----------------------------------------------------------------
- //case RootType::itl_map: {
- // switch(neutronizerChoice) {
- // case NeutronHandlerType::partial_absorber: return new signed_quantifier_validater<itl::map<int,int,partial_absorber> >;
- // case NeutronHandlerType::partial_enricher: return new signed_quantifier_validater<itl::map<int,int,partial_enricher> >;
- // case NeutronHandlerType::total_absorber: return new signed_quantifier_validater<itl::map<int,int,total_absorber > >;
- // case NeutronHandlerType::total_enricher: return new signed_quantifier_validater<itl::map<int,int,total_enricher > >;
- // default: return choiceError(ITL_LOCATION("\nRootType::itl_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
- // }//switch neutronizerChoice
- //}//case itl_map
+ case RootType::itl_map: {
+ switch(neutronizerChoice) {
+ case NeutronHandlerType::partial_absorber: return new signed_quantifier_validater<itl::map<int,int,partial_absorber> >;
+ case NeutronHandlerType::partial_enricher: return new signed_quantifier_validater<itl::map<int,int,partial_enricher> >;
+ case NeutronHandlerType::total_absorber: return new signed_quantifier_validater<itl::map<int,int,total_absorber > >;
+ case NeutronHandlerType::total_enricher: return new signed_quantifier_validater<itl::map<int,int,total_enricher > >;
+ default: return choiceError(ITL_LOCATION("\nRootType::itl_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
+ }//switch neutronizerChoice
+ }//case itl_map
//-----------------------------------------------------------------
- //case RootType::interval_map: {
- // switch(neutronizerChoice) {
- // case NeutronHandlerType::partial_absorber: return new signed_quantifier_validater<interval_map<int,int,partial_absorber> >;
- // case NeutronHandlerType::partial_enricher: return new signed_quantifier_validater<interval_map<int,int,partial_enricher> >;
- // case NeutronHandlerType::total_absorber: return new signed_quantifier_validater<interval_map<int,int,total_absorber > >;
- // case NeutronHandlerType::total_enricher: return new signed_quantifier_validater<interval_map<int,int,total_enricher > >;
- // default: return choiceError(ITL_LOCATION("\nRootType::interval_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
- // }//switch neutronizerChoice
- //}//case interval_map
+ case RootType::interval_map: {
+ switch(neutronizerChoice) {
+ case NeutronHandlerType::partial_absorber: return new signed_quantifier_validater<interval_map<int,int,partial_absorber> >;
+ case NeutronHandlerType::partial_enricher: return new signed_quantifier_validater<interval_map<int,int,partial_enricher> >;
+ case NeutronHandlerType::total_absorber: return new signed_quantifier_validater<interval_map<int,int,total_absorber > >;
+ case NeutronHandlerType::total_enricher: return new signed_quantifier_validater<interval_map<int,int,total_enricher > >;
+ default: return choiceError(ITL_LOCATION("\nRootType::interval_map: neutronizerChoice:\n"), neutronizerChoice, _neutronizerChoice);
+ }//switch neutronizerChoice
+ }//case interval_map
//-----------------------------------------------------------------
case RootType::split_interval_map: {
switch(neutronizerChoice) {
Modified: sandbox/itl/libs/itl/test/test_itl_interval/test_itl_interval.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_itl_interval/test_itl_interval.cpp (original)
+++ sandbox/itl/libs/itl/test/test_itl_interval/test_itl_interval.cpp 2009-06-25 13:27:43 EDT (Thu, 25 Jun 2009)
@@ -383,7 +383,7 @@
interval<T> I6_7D = interval<T>::rightopen(v6,v7);
interval<T> I2_4D = interval<T>::rightopen(v2,v4);
- I2_6D.right_subtract(diff_1,I4_7D);
+ diff_1 = right_subtract(I2_6D, I4_7D);
BOOST_CHECK_EQUAL( diff_1, I2_4D );
diff_2 = I2_6D;
@@ -391,11 +391,11 @@
BOOST_CHECK_EQUAL( diff_2, I2_4D );
diff_1.clear();
- I0_3D.right_subtract(diff_1, I4_7D);
+ diff_1 = right_subtract(I0_3D, I4_7D);
BOOST_CHECK_EQUAL( diff_1, I0_3D );
// ---------------------------------
- I4_7D.left_subtract(diff_1, I2_6D);
+ diff_1 = left_subtract(I4_7D, I2_6D);
BOOST_CHECK_EQUAL( diff_1, I6_7D );
diff_2 = I4_7D;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk