Ticket #4442: operator_star_enable_if.patch
File operator_star_enable_if.patch, 5.5 KB (added by , 12 years ago) |
---|
-
matrix_expression.hpp
2940 2940 // (t * m) [i] [j] = t * m [i] [j] 2941 2941 template<class T1, class E2> 2942 2942 BOOST_UBLAS_INLINE 2943 typename enable_if< is_ convertible<T1, typename E2::value_type>,2943 typename enable_if< is_arithmetic<T1>, 2944 2944 typename matrix_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type 2945 2945 >::type 2946 2946 operator * (const T1 &e1, 2947 2947 const matrix_expression<E2> &e2) { 2948 2948 typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::expression_type expression_type; 2949 2949 return expression_type (e1, e2 ()); … … 3375 3375 // (m * t) [i] [j] = m [i] [j] * t 3376 3376 template<class E1, class T2> 3377 3377 BOOST_UBLAS_INLINE 3378 typename enable_if< is_ convertible<T2, typename E1::value_type>,3378 typename enable_if< is_arithmetic<T2>, 3379 3379 typename matrix_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::result_type 3380 3380 >::type 3381 3381 operator * (const matrix_expression<E1> &e1, 3382 3382 const T2 &e2) { 3383 3383 typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::expression_type expression_type; 3384 3384 return expression_type (e1 (), e2); … … 3725 3725 return prod (e1, e2, storage_category (), orientation_category ()); 3726 3726 } 3727 3727 3728 template<class E1, class E2> 3729 BOOST_UBLAS_INLINE 3730 typename matrix_vector_binary1_traits<typename E1::value_type, E1, 3731 typename E2::value_type, E2>::result_type 3732 operator * (const matrix_expression<E1> &e1, 3733 const vector_expression<E2> &e2) { 3734 BOOST_STATIC_ASSERT (E2::complexity == 0); 3735 typedef typename matrix_vector_binary1_traits<typename E1::value_type, E1, 3736 typename E2::value_type, E2>::storage_category storage_category; 3737 typedef typename matrix_vector_binary1_traits<typename E1::value_type, E1, 3738 typename E2::value_type, E2>::orientation_category orientation_category; 3739 return prod (e1, e2, storage_category (), orientation_category ()); 3740 } 3741 3742 3728 3743 template<class E1, class E2> 3729 3744 BOOST_UBLAS_INLINE 3730 3745 typename matrix_vector_binary1_traits<typename type_traits<typename E1::value_type>::precision_type, E1, … … 4115 4130 return prod (e1, e2, storage_category (), orientation_category ()); 4116 4131 } 4117 4132 4133 template<class E1, class E2> 4134 BOOST_UBLAS_INLINE 4135 typename matrix_vector_binary2_traits<typename E1::value_type, E1, 4136 typename E2::value_type, E2>::result_type 4137 operator* (const vector_expression<E1> &e1, 4138 const matrix_expression<E2> &e2) { 4139 BOOST_STATIC_ASSERT (E1::complexity == 0); 4140 typedef typename matrix_vector_binary2_traits<typename E1::value_type, E1, 4141 typename E2::value_type, E2>::storage_category storage_category; 4142 typedef typename matrix_vector_binary2_traits<typename E1::value_type, E1, 4143 typename E2::value_type, E2>::orientation_category orientation_category; 4144 return prod (e1, e2, storage_category (), orientation_category ()); 4145 } 4146 4118 4147 template<class E1, class E2> 4119 4148 BOOST_UBLAS_INLINE 4120 4149 typename matrix_vector_binary2_traits<typename type_traits<typename E1::value_type>::precision_type, E1, … … 4820 4849 return prod (e1, e2, storage_category (), orientation_category ()); 4821 4850 } 4822 4851 4852 template<class E1, class E2> 4853 BOOST_UBLAS_INLINE 4854 typename matrix_matrix_binary_traits<typename E1::value_type, E1, 4855 typename E2::value_type, E2>::result_type 4856 operator* (const matrix_expression<E1> &e1, 4857 const matrix_expression<E2> &e2) { 4858 BOOST_STATIC_ASSERT (E1::complexity == 0 && E2::complexity == 0); 4859 typedef typename matrix_matrix_binary_traits<typename E1::value_type, E1, 4860 typename E2::value_type, E2>::storage_category storage_category; 4861 typedef typename matrix_matrix_binary_traits<typename E1::value_type, E1, 4862 typename E2::value_type, E2>::orientation_category orientation_category; 4863 return prod (e1, e2, storage_category (), orientation_category ()); 4864 } 4865 4823 4866 template<class E1, class E2> 4824 4867 BOOST_UBLAS_INLINE 4825 4868 typename matrix_matrix_binary_traits<typename type_traits<typename E1::value_type>::precision_type, E1, -
vector_expression.hpp
15 15 16 16 #include <boost/numeric/ublas/expression_types.hpp> 17 17 18 19 18 // Expression templates based on ideas of Todd Veldhuizen and Geoffrey Furnish 20 19 // Iterators based on ideas of Jeremy Siek 21 20 // … … 1170 1169 // (t * v) [i] = t * v [i] 1171 1170 template<class T1, class E2> 1172 1171 BOOST_UBLAS_INLINE 1173 typename enable_if< is_ convertible<T1, typename E2::value_type>,1172 typename enable_if< is_arithmetic<T1>, 1174 1173 typename vector_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type 1175 1174 >::type 1176 1175 operator * (const T1 &e1, … … 1397 1396 // (v * t) [i] = v [i] * t 1398 1397 template<class E1, class T2> 1399 1398 BOOST_UBLAS_INLINE 1400 typename enable_if< is_ convertible<T2, typename E1::value_type>,1399 typename enable_if< is_arithmetic<T2>, 1401 1400 typename vector_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::result_type 1402 1401 >::type 1403 1402 operator * (const vector_expression<E1> &e1,