00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_MATRIX_OPERATORS_INCLUDE
00013 #define MTL_MATRIX_OPERATORS_INCLUDE
00014
00015 #include <boost/static_assert.hpp>
00016 #include <boost/numeric/mtl/utility/ashape.hpp>
00017 #include <boost/numeric/mtl/matrix/all_mat_expr.hpp>
00018
00019
00020
00021 namespace mtl { namespace matrix {
00022
00023 template <typename E1, typename E2>
00024 inline mat_mat_plus_expr<E1, E2>
00025 operator+ (const mat_expr<E1>& e1, const mat_expr<E2>& e2)
00026 {
00027
00028 BOOST_STATIC_ASSERT((boost::is_same<typename ashape::ashape<E1>::type,
00029 typename ashape::ashape<E2>::type>::value));
00030 return mat_mat_plus_expr<E1, E2>(static_cast<const E1&>(e1), static_cast<const E2&>(e2));
00031 }
00032
00033
00034 #if 0
00035
00036 template <typename E1, typename E2>
00037 inline dmat_dmat_plus_expr<E1, E2>
00038 operator+ (const dmat_expr<E1>& e1, const dmat_expr<E2>& e2)
00039 {
00040
00041 BOOST_STATIC_ASSERT((boost::is_same<typename ashape::ashape<E1>::type,
00042 typename ashape::ashape<E2>::type>::value));
00043 return dmat_dmat_plus_expr<E1, E2>(static_cast<const E1&>(e1), static_cast<const E2&>(e2));
00044 }
00045 #endif
00046
00047
00048 template <typename E1, typename E2>
00049 inline mat_mat_minus_expr<E1, E2>
00050 operator- (const mat_expr<E1>& e1, const mat_expr<E2>& e2)
00051 {
00052
00053 BOOST_STATIC_ASSERT((boost::is_same<typename ashape::ashape<E1>::type,
00054 typename ashape::ashape<E2>::type>::value));
00055 return mat_mat_minus_expr<E1, E2>(static_cast<const E1&>(e1), static_cast<const E2&>(e2));
00056 }
00057
00058 template <typename E1, typename E2>
00059 inline mat_mat_ele_times_expr<E1, E2>
00060 ele_prod(const mat_expr<E1>& e1, const mat_expr<E2>& e2)
00061 {
00062
00063 BOOST_STATIC_ASSERT((boost::is_same<typename ashape::ashape<E1>::type,
00064 typename ashape::ashape<E2>::type>::value));
00065 return mat_mat_ele_times_expr<E1, E2>(static_cast<const E1&>(e1), static_cast<const E2&>(e2));
00066 }
00067
00068
00069
00070 }}
00071
00072 #endif // MTL_MATRIX_OPERATORS_INCLUDE