• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

/data/development/ViennaCL/dev/viennacl/traits/start.hpp

Go to the documentation of this file.
00001 #ifndef VIENNACL_TRAITS_START_HPP_
00002 #define VIENNACL_TRAITS_START_HPP_
00003 
00004 /* =========================================================================
00005    Copyright (c) 2010-2011, Institute for Microelectronics,
00006                             Institute for Analysis and Scientific Computing,
00007                             TU Wien.
00008 
00009                             -----------------
00010                   ViennaCL - The Vienna Computing Library
00011                             -----------------
00012 
00013    Project Head:    Karl Rupp                   rupp@iue.tuwien.ac.at
00014                
00015    (A list of authors and contributors can be found in the PDF manual)
00016 
00017    License:         MIT (X11), see file LICENSE in the base directory
00018 ============================================================================= */
00019 
00024 #include <string>
00025 #include <fstream>
00026 #include <sstream>
00027 #include "viennacl/forwards.h"
00028 
00029 namespace viennacl
00030 {
00031   namespace traits
00032   {
00033     //
00034     // start: Mostly for vectors
00035     //
00036     
00037     // Default: Try to get the start index from the .start() member function
00038     template <typename T>
00039     typename result_of::size_type<T>::type
00040     start(T const & obj)
00041     {
00042       return obj.start();
00043     }
00044     
00045     //ViennaCL vector leads to start index 0:
00046     template <typename ScalarType, unsigned int ALIGNMENT>
00047     typename result_of::size_type<viennacl::vector<ScalarType, ALIGNMENT> >::type
00048     start(viennacl::vector<ScalarType, ALIGNMENT> const & v)
00049     {
00050       return 0; 
00051     }
00052 
00053     //
00054     // start1: Row start index
00055     //
00056     
00057     // Default: Try to get the start index from the .start1() member function
00058     template <typename T>
00059     typename result_of::size_type<T>::type
00060     start1(T const & obj)
00061     {
00062       return obj.start1();
00063     }
00064 
00065     //ViennaCL matrix leads to start index 0:
00066     template <typename ScalarType, typename F, unsigned int ALIGNMENT>
00067     typename result_of::size_type<viennacl::matrix<ScalarType, F, ALIGNMENT> >::type
00068     start1(viennacl::matrix<ScalarType, F, ALIGNMENT> const & v)
00069     {
00070       return 0; 
00071     }
00072 
00073 
00074     //
00075     // start2: Column start index
00076     //
00077     template <typename T>
00078     typename result_of::size_type<T>::type
00079     start2(T const & obj)
00080     {
00081       return obj.start2();
00082     }
00083 
00084     //ViennaCL matrix leads to start index 0:
00085     template <typename ScalarType, typename F, unsigned int ALIGNMENT>
00086     typename result_of::size_type<viennacl::matrix<ScalarType, F, ALIGNMENT> >::type
00087     start2(viennacl::matrix<ScalarType, F, ALIGNMENT> const & v)
00088     {
00089       return 0; 
00090     }
00091     
00092 
00093   } //namespace traits
00094 } //namespace viennacl
00095     
00096 
00097 #endif

Generated on Fri Dec 30 2011 23:20:43 for ViennaCL - The Vienna Computing Library by  doxygen 1.7.1