00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL__OPERATION_COMPUTE_SUMMAND_INCLUDE
00013 #define MTL__OPERATION_COMPUTE_SUMMAND_INCLUDE
00014
00015 #include <boost/numeric/mtl/mtl_fwd.hpp>
00016 #include <boost/numeric/mtl/utility/copy_expression_const_ref_container.hpp>
00017
00018 namespace mtl { namespace operation {
00019
00021
00029 template <typename Expr>
00030 struct compute_summand
00031 {
00032 typedef Expr type;
00033 compute_summand(const Expr& expr) : value(expr) {}
00034
00035 typename mtl::traits::copy_expression_const_ref_container<Expr>::type value;
00036 };
00037
00038
00040 template <typename Matrix, typename CVector>
00041 struct compute_summand< mat_cvec_times_expr<Matrix, CVector> >
00042 {
00043 typedef CVector type;
00044
00045 compute_summand(const mat_cvec_times_expr<Matrix, CVector>& expr)
00046 : value(num_rows(expr.first))
00047 {
00048 value= expr.first * expr.second;
00049 }
00050
00051 CVector value;
00052 };
00053
00054 }}
00055
00056 #endif // MTL__OPERATION_COMPUTE_SUMMAND_INCLUDE