yat  0.21pre
utility.h
1 #ifndef _theplu_yat_normalizer_utility_
2 #define _theplu_yat_normalizer_utility_
3 
4 // $Id: utility.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2010, 2016, 2022 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "yat/utility/concept_check.h"
26 #include "yat/utility/iterator_traits.h"
27 #include "yat/utility/WeightIterator.h"
28 
29 #include <boost/concept_check.hpp>
30 
31 #include <algorithm>
32 
33 namespace theplu {
34 namespace yat {
35 namespace normalizer {
36 
37 // internal functions in namespace detail
38 namespace detail {
39  template<typename InputIterator, typename OutputIterator>
40  void copy_weight_if_weighted(InputIterator first, InputIterator last,
41  OutputIterator result,
42  utility::unweighted_iterator_tag tag)
43  {
44  }
45 
46  template<typename InputIterator, typename OutputIterator>
47  void copy_weight_if_weighted(InputIterator first, InputIterator last,
48  OutputIterator result,
49  utility::weighted_iterator_tag tag)
50  {
51  using utility::weight_iterator;
52  std::copy(weight_iterator(first), weight_iterator(last),
53  weight_iterator(result));
54  }
55 
61  template<typename InputIterator, typename OutputIterator>
62  void copy_weight_if_weighted(InputIterator first, InputIterator last,
63  OutputIterator result)
64  {
65  BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<OutputIterator>));
67  copy_weight_if_weighted(first, last, result, tag);
68  }
69 } // of namespace detail
70 
71 }}} // of namespace normalizer, yat, and theplu
72 
73 #endif
detail::weighted_iterator_traits_detail< value >::type type
Definition: iterator_traits.h:114
The Department of Theoretical Physics namespace as we define it.

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14