Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58052 - in sandbox/itl/boost/validate/std: . algorithm
From: afojgo_at_[hidden]
Date: 2009-11-30 05:49:21


Author: jofaber
Date: 2009-11-30 05:49:20 EST (Mon, 30 Nov 2009)
New Revision: 58052
URL: http://svn.boost.org/trac/boost/changeset/58052

Log:
Added law based tests for element_iterators. Bugfixed bit_element_iterators for interval_bitset.
Added documentation on element_iterators. Stable {msvc-9.0}

Added:
   sandbox/itl/boost/validate/std/
   sandbox/itl/boost/validate/std/algorithm/
   sandbox/itl/boost/validate/std/algorithm/copy.hpp (contents, props changed)
   sandbox/itl/boost/validate/std/algorithm/set_algo.hpp (contents, props changed)

Added: sandbox/itl/boost/validate/std/algorithm/copy.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/validate/std/algorithm/copy.hpp 2009-11-30 05:49:20 EST (Mon, 30 Nov 2009)
@@ -0,0 +1,94 @@
+/*-----------------------------------------------------------------------------+
+A Law Based Test Automaton 'LaBatea'
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: 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_VALIDATE_STD_ALGORITHM_COPY_HPP_JOFA_091124
+#define BOOST_VALIDATE_STD_ALGORITHM_COPY_HPP_JOFA_091124
+
+#include <algorithm>
+
+namespace boost{namespace itl
+{
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_copy_forward
+{
+ static void apply(const SourceT& source, TargetT& target)
+ {
+ std::copy(source.begin(), source.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& source, TargetT& target)
+ {
+ std::copy(source.elements_begin(), source.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static std::string struct_abbreviation(){ return "cpy_f"; }
+};
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_copy_backward
+{
+ static void apply(const SourceT& source, TargetT& target)
+ {
+ std::copy(source.rbegin(), source.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& source, TargetT& target)
+ {
+ std::copy(source.elements_rbegin(), source.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static std::string struct_abbreviation(){ return "cpy_b"; }
+};
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_reverse_copy_forward
+{
+ static void apply(const SourceT& source, TargetT& target)
+ {
+ std::reverse_copy(source.begin(), source.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& source, TargetT& target)
+ {
+ std::reverse_copy(source.elements_begin(), source.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static std::string struct_abbreviation(){ return "rcpy_f"; }
+};
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_reverse_copy_backward
+{
+ static void apply(const SourceT& source, TargetT& target)
+ {
+ std::reverse_copy(source.rbegin(), source.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& source, TargetT& target)
+ {
+ std::reverse_copy(source.elements_rbegin(), source.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static std::string struct_abbreviation(){ return "rcpy_b"; }
+};
+
+
+}} // namespace itl boost
+
+#endif BOOST_VALIDATE_STD_ALGORITHM_COPY_HPP_JOFA_091124
+

Added: sandbox/itl/boost/validate/std/algorithm/set_algo.hpp
==============================================================================
--- (empty file)
+++ sandbox/itl/boost/validate/std/algorithm/set_algo.hpp 2009-11-30 05:49:20 EST (Mon, 30 Nov 2009)
@@ -0,0 +1,245 @@
+/*-----------------------------------------------------------------------------+
+A Law Based Test Automaton 'LaBatea'
+Author: Joachim Faulhaber
+Copyright (c) 2009-2009: 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_VALIDATE_STD_ALGORITHM_SET_ALGO_HPP_JOFA_091125
+#define BOOST_VALIDATE_STD_ALGORITHM_SET_ALGO_HPP_JOFA_091125
+
+#include <algorithm>
+
+namespace boost{namespace itl
+{
+
+//- includes -------------------------------------------------------------------
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_includes_forward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ target = std::includes(left.begin(), left.end(),
+ right.begin(), right.end());
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ target = std::includes(left.elements_begin(), left.elements_end(),
+ right.elements_begin(), right.elements_end());
+ }
+
+ static std::string struct_abbreviation(){ return "C=f"; }
+};
+
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_includes_backward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ target = std::includes(left.rbegin(), left.rend(),
+ right.rbegin(), right.rend());
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ target = std::includes(left.elements_rbegin(), left.elements_rend(),
+ right.elements_rbegin(), right.elements_rend());
+ }
+
+ static std::string struct_abbreviation(){ return "C=b"; }
+};
+
+
+//- set_union -----------------------------------------------------------------
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_union_forward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_union(left.begin(), left.end(), right.begin(), right.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_union(
+ left.elements_begin(), left.elements_end(),
+ right.elements_begin(), right.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "+f"; }
+};
+
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_union_backward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_union(left.rbegin(), left.rend(), right.rbegin(), right.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_union(
+ left.elements_rbegin(), left.elements_rend(),
+ right.elements_rbegin(), right.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "+b"; }
+};
+
+
+//- set_difference ------------------------------------------------------------
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_difference_forward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_difference(left.begin(), left.end(), right.begin(), right.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_difference(
+ left.elements_begin(), left.elements_end(),
+ right.elements_begin(), right.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "-f"; }
+};
+
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_difference_backward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_difference(left.rbegin(), left.rend(), right.rbegin(), right.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_difference(
+ left.elements_rbegin(), left.elements_rend(),
+ right.elements_rbegin(), right.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "-b"; }
+};
+
+
+//- set_intersection -----------------------------------------------------------
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_intersection_forward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_intersection(left.begin(), left.end(), right.begin(), right.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_intersection(
+ left.elements_begin(), left.elements_end(),
+ right.elements_begin(), right.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "^f"; }
+};
+
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_intersection_backward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_intersection(left.rbegin(), left.rend(), right.rbegin(), right.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_intersection(
+ left.elements_rbegin(), left.elements_rend(),
+ right.elements_rbegin(), right.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "^b"; }
+};
+
+
+//- set_symmetric_difference ---------------------------------------------------
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_symmetric_difference_forward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_symmetric_difference(left.begin(), left.end(), right.begin(), right.end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_symmetric_difference(
+ left.elements_begin(), left.elements_end(),
+ right.elements_begin(), right.elements_end(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "&f"; }
+};
+
+
+template<class SourceT, class TargetT, template<class>class InsertIterator>
+struct std_set_symmetric_difference_backward
+{
+ static void apply(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_symmetric_difference(left.rbegin(), left.rend(), right.rbegin(), right.rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end())));
+ }
+
+ static void apply_elemental(const SourceT& left, const SourceT& right, TargetT& target)
+ {
+ std::set_symmetric_difference(
+ left.elements_rbegin(), left.elements_rend(),
+ right.elements_rbegin(), right.elements_rend(),
+ InsertIterator<TargetT>(target, typename TargetT::iterator(target.end()))
+ );
+ }
+
+ static std::string struct_abbreviation(){ return "&b"; }
+};
+
+
+}} // namespace itl boost
+
+#endif BOOST_VALIDATE_STD_ALGORITHM_SET_ALGO_HPP_JOFA_091125
+


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