00001 /* 00002 * 00003 * Copyright (c) Kresimir Fresl 2002 00004 * 00005 * Distributed under the Boost Software License, Version 1.0. 00006 * (See accompanying file LICENSE_1_0.txt or copy at 00007 * http://www.boost.org/LICENSE_1_0.txt) 00008 * 00009 * Author acknowledges the support of the Faculty of Civil Engineering, 00010 * University of Zagreb, Croatia. 00011 * 00012 */ 00013 00014 #ifndef BOOST_NUMERIC_BINDINGS_CBLAS_ENUM_HPP 00015 #define BOOST_NUMERIC_BINDINGS_CBLAS_ENUM_HPP 00016 00017 #include <boost/numeric/bindings/traits/traits.hpp> 00018 #include <boost/numeric/bindings/atlas/cblas_inc.hpp> 00019 #ifdef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS 00020 # include <boost/numeric/ublas/config.hpp> 00021 #endif 00022 00023 namespace boost { namespace numeric { namespace bindings { 00024 00025 namespace atlas { 00026 00027 template <typename Ord> struct storage_order {}; 00028 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS 00029 template<> struct storage_order<traits::row_major_t> { 00030 // 'ename' - como (in enum_cast<>): 00031 // a template argument may not reference an unnamed type 00032 enum ename { value = CblasRowMajor }; 00033 }; 00034 template<> struct storage_order<traits::column_major_t> { 00035 enum ename { value = CblasColMajor }; 00036 }; 00037 #else 00038 template<> struct storage_order<boost::numeric::ublas::row_major_tag> { 00039 enum ename { value = CblasRowMajor }; 00040 }; 00041 template<> struct storage_order<boost::numeric::ublas::column_major_tag> { 00042 enum ename { value = CblasColMajor }; 00043 }; 00044 #endif 00045 00046 template <typename UpLo> struct uplo_triang {}; 00047 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS 00048 template<> struct uplo_triang<traits::upper_t> { 00049 enum ename { value = CblasUpper }; 00050 }; 00051 template<> struct uplo_triang<traits::lower_t> { 00052 enum ename { value = CblasLower }; 00053 }; 00054 #else 00055 template<> struct uplo_triang<boost::numeric::ublas::upper_tag> { 00056 enum ename { value = CblasUpper }; 00057 }; 00058 template<> struct uplo_triang<boost::numeric::ublas::lower_tag> { 00059 enum ename { value = CblasLower }; 00060 }; 00061 #endif 00062 00063 // g++ 3.0.4 rejects 'static_cast<E1> (e2)' 00064 template <typename E1, typename E2> 00065 E1 enum_cast (E2 e2) { 00066 return static_cast<E1> (static_cast<int> (e2)); 00067 } 00068 00069 } 00070 00071 }}} 00072 00073 #endif