/** \file vector_operation.hpp \brief defing vector operators \author Junhua Gu */ #ifndef VECTOR_OPERATION_HPP #define VECTOR_OPERATION_HPP #include namespace opt_utilities { template typename element_type_trait::element_type inner_product(const pT& v1,const pT& v2) { typename element_type_trait::element_type result(0); for(int i=0;i T contract1(const T& x1,const T& x2,...) { return x1*x2; } template T contract(const T& x1,const T& x2,...) { return x1*x2; } template typename element_type_trait::element_type contract(const pT& v1,const pT& v2,const typename element_type_trait::element_type&) { typename element_type_trait::element_type result(0); for(int i=0;i