matvec_promotions.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00018 #ifndef matvec_promotions_h
00019 #define matvec_promotions_h
00020
00021 #include <cml/et/scalar_promotions.h>
00022 #include <cml/vector/vector_promotions.h>
00023
00024 namespace cml {
00025 namespace et {
00026
00027
00028 template<typename LeftT, typename RightT> struct MatVecPromote;
00029
00031 template<
00032 typename E1, class AT1, typename BO, typename L,
00033 typename E2, class AT2>
00034 struct MatVecPromote< cml::matrix<E1,AT1,BO,L>, cml::vector<E2,AT2> >
00035 {
00036 typedef cml::matrix<E1,AT1,BO,L> matrix_type;
00037 typedef cml::vector<E2,AT2> vector_type;
00038
00039
00040 typedef typename ArrayPromote<
00041 typename matrix_type::array_type,
00042 typename vector_type::array_type
00043 >::type promoted_array;
00044
00045
00046 typedef cml::vector<
00047 typename promoted_array::value_type,
00048 typename promoted_array::generator_type
00049 > type;
00050
00051
00052 typedef typename type::temporary_type temporary_type;
00053
00054
00055
00056 };
00057
00059 template<
00060 typename E1, class AT1,
00061 typename E2, class AT2, typename BO, typename L>
00062 struct MatVecPromote< cml::vector<E1,AT1>, cml::matrix<E2,AT2,BO,L> >
00063 {
00064 typedef cml::vector<E1,AT1> vector_type;
00065 typedef cml::matrix<E2,AT2,BO,L> matrix_type;
00066
00067
00068 typedef typename ArrayPromote<
00069 typename vector_type::array_type,
00070 typename matrix_type::array_type
00071 >::type promoted_array;
00072
00073
00074 typedef cml::vector<
00075 typename promoted_array::value_type,
00076 typename promoted_array::generator_type
00077 > type;
00078
00079
00080 typedef typename type::temporary_type temporary_type;
00081
00082
00083
00084 };
00085
00086 }
00087 }
00088
00089 #endif
00090
00091
00092