![]() |
Boost.uBlas 1.49
Linear Algebra in C++: matrices, vectors and numeric algorithms
|
00001 00018 #ifndef BOOST_NUMERIC_UBLAS_TRAITS_ITERATOR_TYPE_HPP 00019 #define BOOST_NUMERIC_UBLAS_TRAITS_ITERATOR_TYPE_HPP 00020 00021 00022 #include <boost/numeric/ublas/fwd.hpp> 00023 #include <boost/numeric/ublas/traits.hpp> 00024 #include <boost/numeric/ublas/tags.hpp> 00025 00026 00027 namespace boost { namespace numeric { namespace ublas { 00028 00029 namespace detail { 00030 00038 template <typename MatrixT, typename TagT, typename OrientationT> 00039 struct iterator_type_impl; 00040 00041 00044 template <typename MatrixT> 00045 struct iterator_type_impl<MatrixT,tag::major,row_major_tag> 00046 { 00047 typedef typename matrix_traits<MatrixT>::iterator1 type; 00048 }; 00049 00050 00053 template <typename MatrixT> 00054 struct iterator_type_impl<MatrixT,tag::major,column_major_tag> 00055 { 00056 typedef typename matrix_traits<MatrixT>::iterator2 type; 00057 }; 00058 00059 00062 template <typename MatrixT> 00063 struct iterator_type_impl<MatrixT,tag::minor,row_major_tag> 00064 { 00065 typedef typename matrix_traits<MatrixT>::iterator2 type; 00066 }; 00067 00068 00071 template <typename MatrixT> 00072 struct iterator_type_impl<MatrixT,tag::minor,column_major_tag> 00073 { 00074 typedef typename matrix_traits<MatrixT>::iterator1 type; 00075 }; 00076 00077 } // Namespace detail 00078 00079 00085 template <typename ContainerT, typename TagT=void> 00086 struct iterator_type; 00087 00088 00093 template <typename VectorT> 00094 struct iterator_type<VectorT, void> 00095 { 00096 typedef typename vector_traits<VectorT>::iterator type; 00097 }; 00098 00099 00105 template <typename MatrixT> 00106 struct iterator_type<MatrixT,tag::major> 00107 { 00108 typedef typename detail::iterator_type_impl<MatrixT,tag::major,typename matrix_traits<MatrixT>::orientation_category>::type type; 00109 }; 00110 00111 00117 template <typename MatrixT> 00118 struct iterator_type<MatrixT,tag::minor> 00119 { 00120 typedef typename detail::iterator_type_impl<MatrixT,tag::minor,typename matrix_traits<MatrixT>::orientation_category>::type type; 00121 }; 00122 00123 }}} // Namespace boost::numeric::ublas 00124 00125 00126 #endif // BOOST_NUMERIC_UBLAS_TRAITS_ITERATOR_TYPE_HPP