C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
VectorFromMatrixSliceIterator.h
Go to the documentation of this file.
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
3 // -*- C++ -*-
4 #ifndef CPPQEDCORE_UTILS_VECTORFROMMATRIXSLICEITERATOR_H_INCLUDED
5 #define CPPQEDCORE_UTILS_VECTORFROMMATRIXSLICEITERATOR_H_INCLUDED
6 
7 #include "VectorFromMatrixSliceIteratorFwd.h"
8 
10 
11 
12 namespace blitzplusplus {
13 
14 
16 
29 namespace vfmsi {
30 
31 
32 struct Left : boost::mpl::false_ {};
33 struct Right : boost::mpl:: true_ {};
34 
35 
37 
46 template<int RANK, typename S>
47 struct LeftRight
48  : tmptools::Range<RANK,
49  boost::mpl::if_<S,
50  boost::mpl::int_<RANK>,
51  boost::mpl::int_<0>
52  >::type::value> {};
53 
54 
56 
62 template<int RANK, typename S, bool IS_CONST> using Iterator=basi::Iterator<RANK,LeftRight<RANK/2,S>,IS_CONST>;
63 
65 
66 template<typename S, typename A>
68 const Iterator<Rank<A>::value,S,false>
69 begin( A& array );
70 
71 template<typename S, typename A>
72 const Iterator<Rank<A>::value,S,false>
73 end ( A& array );
74 
75 template<typename S, typename A>
76 const Iterator<Rank<A>::value,S,true>
77 begin(const A& array );
78 
79 template<typename S, typename A>
80 const Iterator<Rank<A>::value,S,true>
81 end (const A& array );
82 
83 template<typename S, typename A>
84 const boost::iterator_range<Iterator<Rank<A>::value,S,true> >
85 fullRange(const A& array );
86 
87 template<typename S, typename A>
88 const boost::iterator_range<Iterator<Rank<A>::value,S,false> >
89 fullRange( A& array );
91 
92 
93 #define NS_NAME vfmsi
94 #define RETURN_type1(IS_CONST) Iterator<Rank<A>::value,V_S,IS_CONST>
95 #define ADDITIONAL_PARAMETER
96 #define ADDITIONAL_ARGUMENT
97 
98 #include "details_BlitzArraySliceIteratorReentrant.h"
99 
100 
101 } // vfmsi
102 
103 
106 namespace basi {
107 
108 template<int RANK, typename S> struct ConsistencyChecker<RANK,blitzplusplus::vfmsi::LeftRight<RANK/2,S> > {};
109 
110 } // basi
111 
114 } // blitzplusplus
115 
116 
117 #endif // CPPQEDCORE_UTILS_VECTORFROMMATRIXSLICEITERATOR_H_INCLUDED
Indicates composition from left.
Definition of blitzplusplus::basi::Iterator together with its helpers.
Indicates composition from right.
Metafunction returning the appropriate set of retained index positions.
const Iterator< Rank< A >::value, S, false > begin(A &array)
Same as begin but here it returns an Iterator instance.
Comprises our own extensions to Blitz++.
An integer range_c starting with Nbeg and having N elements (Nbeg ... Nbeg+N-1)
Definition: TMP_Tools.h:67