/** * -*- c++ -*- * * \file const_iterator_type.hpp * * \brief Const iterator to a given container type. * * Copyright (c) 2009, Marco Guazzone * * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * \author Marco Guazzone, marco.guazzone@gmail.com */ #ifndef BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP #define BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP #include #include #include namespace boost { namespace numeric { namespace ublas { namespace detail { /** * \brief Auxiliary class for retrieving the const iterator to the given * matrix expression according its orientation and to the given dimension tag. * \tparam MatrixT A model of MatrixExpression. * \tparam TagT A dimension tag type (e.g., tag::major). * \tparam OrientationT An orientation category type (e.g., row_major_tag). */ template struct const_iterator_type_impl; /// \brief Specialization of \c const_iterator_type_impl for row-major oriented /// matrices and over the major dimension. template struct const_iterator_type_impl { typedef typename matrix_view_traits::const_iterator1 type; }; /// \brief Specialization of \c const_iterator_type_impl for column-major /// oriented matrices and over the major dimension. template struct const_iterator_type_impl { typedef typename matrix_view_traits::const_iterator2 type; }; /// \brief Specialization of \c const_iterator_type_impl for row-major oriented /// matrices and over the minor dimension. template struct const_iterator_type_impl { typedef typename matrix_view_traits::const_iterator2 type; }; /// \brief Specialization of \c const_iterator_type_impl for column-major /// oriented matrices and over the minor dimension. template struct const_iterator_type_impl { typedef typename matrix_view_traits::const_iterator1 type; }; } // Namespace detail /** * \brief A const iterator for the given container type over the given * dimension. * \tparam ContainerT A container expression type. * \tparam TagT A dimension tag type (e.g., tag::major). */ template struct const_iterator_type; /** * \brief Specialization of \c const_iterator_type for vector expressions. * \tparam VectorT A model of VectorExpression type. */ template struct const_iterator_type { typedef typename vector_view_traits::const_iterator type; }; /** * \brief Specialization of \c const_iterator_type for matrix expressions and * over the major dimension. * \tparam MatrixT A model of MatrixExpression type. */ template struct const_iterator_type { typedef typename detail::const_iterator_type_impl::orientation_category>::type type; }; /** * \brief Specialization of \c const_iterator_type for matrix expressions and * over the minor dimension. * \tparam MatrixT A model of MatrixExpression type. */ template struct const_iterator_type { typedef typename detail::const_iterator_type_impl::orientation_category>::type type; }; }}} // Namespace boost::numeric::ublas #endif // BOOST_NUMERIC_UBLAS_TRAITS_CONST_ITERATOR_TYPE_HPP