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

/data/development/ViennaCL/dev/viennacl/meta/predicate.hpp

Go to the documentation of this file.
00001 #ifndef VIENNACL_META_PREDICATE_HPP_
00002 #define VIENNACL_META_PREDICATE_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     //
00032     // is_cpu_scalar: checks for float or double
00033     //
00034     template <typename T>
00035     struct is_cpu_scalar
00036     {
00037       enum { value = false };
00038     };
00039   
00040     template <>
00041     struct is_cpu_scalar<float>
00042     {
00043       enum { value = true };
00044     };
00045 
00046     template <>
00047     struct is_cpu_scalar<double>
00048     {
00049       enum { value = true };
00050     };
00051     
00052     //
00053     // is_scalar: checks for viennacl::scalar
00054     //
00055     template <typename T>
00056     struct is_scalar
00057     {
00058       enum { value = false };
00059     };
00060   
00061     template <typename T>
00062     struct is_scalar<viennacl::scalar<T> >
00063     {
00064       enum { value = true };
00065     };
00066   
00067     //
00068     // is_vector
00069     //
00070     template <typename T>
00071     struct is_vector
00072     {
00073       enum { value = false };
00074     };
00075 
00076     template <typename ScalarType, unsigned int ALIGNMENT>
00077     struct is_vector<viennacl::vector<ScalarType, ALIGNMENT> >
00078     {
00079       enum { value = true };
00080     };
00081 
00082     template <typename T>
00083     struct is_vector<viennacl::vector_range<T> >
00084     {
00085       enum { value = true };
00086     };
00087     
00088     
00089     
00090     //
00091     // is_matrix
00092     //
00093     template <typename T>
00094     struct is_matrix
00095     {
00096       enum { value = false };
00097     };
00098 
00099     template <typename ScalarType, typename F, unsigned int ALIGNMENT>
00100     struct is_matrix<viennacl::matrix<ScalarType, F, ALIGNMENT> >
00101     {
00102       enum { value = true };
00103     };
00104 
00105     template <typename T>
00106     struct is_matrix<viennacl::matrix_range<T> >
00107     {
00108       enum { value = true };
00109     };
00110     
00111 
00112 } //namespace viennacl
00113     
00114 
00115 #endif

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