00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_MAT_MAT_ELE_TIMES_EXPR_INCLUDE
00013 #define MTL_MAT_MAT_ELE_TIMES_EXPR_INCLUDE
00014
00015 #include <boost/shared_ptr.hpp>
00016 #include <boost/numeric/mtl/mtl_fwd.hpp>
00017 #include <boost/numeric/mtl/matrix/mat_mat_op_expr.hpp>
00018 #include <boost/numeric/mtl/operation/sfunctor.hpp>
00019 #include <boost/numeric/linear_algebra/identity.hpp>
00020
00021
00022 namespace mtl { namespace matrix {
00023
00024 template <typename E1, typename E2>
00025 struct mat_mat_ele_times_expr
00026 : public mat_mat_op_expr< E1, E2, mtl::sfunctor::times<typename E1::value_type, typename E2::value_type> >,
00027 public mat_expr< mat_mat_ele_times_expr<E1, E2> >
00028 {
00029 typedef mat_mat_op_expr< E1, E2, mtl::sfunctor::times<typename E1::value_type, typename E2::value_type> > op_base;
00030 typedef mat_expr< mat_mat_ele_times_expr<E1, E2> > crtp_base;
00031 typedef mat_mat_ele_times_expr self;
00032 typedef E1 first_argument_type ;
00033 typedef E2 second_argument_type ;
00034 typedef typename E1::orientation orientation;
00035 typedef mtl::non_fixed::dimensions dim_type;
00036 typedef typename E1::key_type key_type;
00037
00038
00039 mat_mat_ele_times_expr( E1 const& v1, E2 const& v2 )
00040 : op_base( v1, v2 ), crtp_base(*this), first(v1), second(v2)
00041 {}
00042
00043 first_argument_type const& first ;
00044 second_argument_type const& second ;
00045 };
00046
00047 template <typename E1, typename E2>
00048 std::size_t inline num_rows(const mat_mat_ele_times_expr<E1, E2>& expr)
00049 { return num_rows(expr.first); }
00050
00051 template <typename E1, typename E2>
00052 std::size_t inline num_cols(const mat_mat_ele_times_expr<E1, E2>& expr)
00053 { return num_cols(expr.second); }
00054
00055 template <typename E1, typename E2>
00056 std::size_t inline size(const mat_mat_ele_times_expr<E1, E2>& expr)
00057 { return num_rows(expr) * num_cols(expr); }
00058
00059 }}
00060
00061 #endif // MTL_MAT_MAT_ELE_TIMES_EXPR_INCLUDE