ViennaCL - The Vienna Computing Library  1.5.1
viennacl/traits/stride.hpp
Go to the documentation of this file.
00001 #ifndef VIENNACL_TRAITS_STRIDE_HPP_
00002 #define VIENNACL_TRAITS_STRIDE_HPP_
00003 
00004 /* =========================================================================
00005    Copyright (c) 2010-2014, Institute for Microelectronics,
00006                             Institute for Analysis and Scientific Computing,
00007                             TU Wien.
00008    Portions of this software are copyright by UChicago Argonne, LLC.
00009 
00010                             -----------------
00011                   ViennaCL - The Vienna Computing Library
00012                             -----------------
00013 
00014    Project Head:    Karl Rupp                   rupp@iue.tuwien.ac.at
00015 
00016    (A list of authors and contributors can be found in the PDF manual)
00017 
00018    License:         MIT (X11), see file LICENSE in the base directory
00019 ============================================================================= */
00020 
00025 #include <string>
00026 #include <fstream>
00027 #include <sstream>
00028 #include "viennacl/forwards.h"
00029 #include "viennacl/meta/result_of.hpp"
00030 
00031 
00032 #include <vector>
00033 #include <map>
00034 
00035 namespace viennacl
00036 {
00037 
00038   namespace traits
00039   {
00040 
00041     //
00042     // inc: Increment for vectors. Defaults to 1
00043     //
00044     template <typename T>
00045     typename result_of::size_type< viennacl::vector_base<T> >::type
00046     stride(viennacl::vector_base<T> const & s) { return s.stride(); }
00047 
00048     //
00049     // inc1: Row increment for matrices. Defaults to 1
00050     //
00051     //template <typename MatrixType>
00052     //typename result_of::size_type<MatrixType>::type
00053     //stride1(MatrixType const &) { return 1; }
00054 
00055     template <typename NumericT, typename F>
00056     typename result_of::size_type< matrix_base<NumericT, F> >::type
00057     stride1(matrix_base<NumericT, F> const & s) { return s.stride1(); }
00058 
00059     //
00060     // inc2: Column increment for matrices. Defaults to 1
00061     //
00062     //template <typename MatrixType>
00063     //typename result_of::size_type<MatrixType>::type
00064     //stride2(MatrixType const &) { return 1; }
00065 
00066     template <typename NumericT, typename F>
00067     typename result_of::size_type< matrix_base<NumericT, F> >::type
00068     stride2(matrix_base<NumericT, F> const & s) { return s.stride2(); }
00069 
00070 
00071   } //namespace traits
00072 } //namespace viennacl
00073 
00074 
00075 #endif