4 * \file const_iterator_type.hpp
6 * \brief Const iterator to a given container type.
8 * Copyright (c) 2009, Marco Guazzone
10 * Distributed under the Boost Software License, Version 1.0. (See
11 * accompanying file LICENSE_1_0.txt or copy at
12 * http://www.boost.org/LICENSE_1_0.txt)
14 * \author Marco Guazzone, marco.guazzone@gmail.com
18 #ifndef BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP
19 #define BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP
22 #include <boost/numeric/ublas/fwd.hpp>
23 #include <boost/numeric/ublas/tags.hpp>
24 #include <boost/numeric/ublas/traits.hpp>
27 namespace boost { namespace numeric { namespace ublas {
32 * \brief Auxiliary class for retrieving the const iterator to the given
33 * matrix expression according its orientation and to the given dimension tag.
34 * \tparam MatrixT A model of MatrixExpression.
35 * \tparam TagT A dimension tag type (e.g., tag::major).
36 * \tparam OrientationT An orientation category type (e.g., row_major_tag).
38 template <typename MatrixT, typename TagT, typename OrientationT>
39 struct const_iterator_type_impl;
42 /// \brief Specialization of \c const_iterator_type_impl for row-major oriented
43 /// matrices and over the major dimension.
44 template <typename MatrixT>
45 struct const_iterator_type_impl<MatrixT,tag::major,row_major_tag>
47 typedef typename matrix_view_traits<MatrixT>::const_iterator1 type;
51 /// \brief Specialization of \c const_iterator_type_impl for column-major
52 /// oriented matrices and over the major dimension.
53 template <typename MatrixT>
54 struct const_iterator_type_impl<MatrixT,tag::major,column_major_tag>
56 typedef typename matrix_view_traits<MatrixT>::const_iterator2 type;
60 /// \brief Specialization of \c const_iterator_type_impl for row-major oriented
61 /// matrices and over the minor dimension.
62 template <typename MatrixT>
63 struct const_iterator_type_impl<MatrixT,tag::minor,row_major_tag>
65 typedef typename matrix_view_traits<MatrixT>::const_iterator2 type;
69 /// \brief Specialization of \c const_iterator_type_impl for column-major
70 /// oriented matrices and over the minor dimension.
71 template <typename MatrixT>
72 struct const_iterator_type_impl<MatrixT,tag::minor,column_major_tag>
74 typedef typename matrix_view_traits<MatrixT>::const_iterator1 type;
81 * \brief A const iterator for the given container type over the given
83 * \tparam ContainerT A container expression type.
84 * \tparam TagT A dimension tag type (e.g., tag::major).
86 template <typename ContainerT, typename TagT=void>
87 struct const_iterator_type;
91 * \brief Specialization of \c const_iterator_type for vector expressions.
92 * \tparam VectorT A model of VectorExpression type.
94 template <typename VectorT>
95 struct const_iterator_type<VectorT, void>
97 typedef typename vector_view_traits<VectorT>::const_iterator type;
102 * \brief Specialization of \c const_iterator_type for matrix expressions and
103 * over the major dimension.
104 * \tparam MatrixT A model of MatrixExpression type.
106 template <typename MatrixT>
107 struct const_iterator_type<MatrixT,tag::major>
109 typedef typename detail::const_iterator_type_impl<MatrixT,tag::minor,typename matrix_view_traits<MatrixT>::orientation_category>::type type;
114 * \brief Specialization of \c const_iterator_type for matrix expressions and
115 * over the minor dimension.
116 * \tparam MatrixT A model of MatrixExpression type.
118 template <typename MatrixT>
119 struct const_iterator_type<MatrixT,tag::minor>
121 typedef typename detail::const_iterator_type_impl<MatrixT,tag::minor,typename matrix_view_traits<MatrixT>::orientation_category>::type type;
124 }}} // Namespace boost::numeric::ublas
127 #endif // BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP