#ifndef glas_expression_dotu_hpp #define glas_expression_dotu_hpp #include #ifdef GLAS_BACKEND_GLAS # include #endif #ifdef GLAS_BACKEND_BLAS # include #endif #ifdef GLAS_BACKEND_VSIPLPP # include #endif #include #include #include namespace glas { template class dotu_expression { typedef typename V::value_type first_value_type ; typedef typename W::value_type second_value_type ; public: static const int rank = 0 ; // required by Expression typedef V first_argument_type ; typedef W second_argument_type ; typedef typename mult_functor< first_value_type, second_value_type >::result_type value_type ; public: // required by binary-expression dotu_expression(V const & v, W const & w) : first_argument_( v ) , second_argument_( w ) { assert( v.size() == w.size() ) ; } // required by binary-expression first_argument_type const& first_argument() const { return first_argument_ ; } // required by binary-expression second_argument_type const& second_argument() const { return second_argument_ ; } template operator T () const { T temp ; return assign< backend_default >( temp, *this ) ; return temp ; } private: void operator=(dotu_expression const &) ; private: first_argument_type const& first_argument_ ; second_argument_type const& second_argument_ ; } ; /// inner_product free functor. template dotu_expression dotu( V const& v, W const& w ) { return dotu_expression( v,w ) ; } } #endif // glas_expression_dotu_hpp