00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BZ_TVECGLOBS_H
00025 #define BZ_TVECGLOBS_H
00026
00027 #ifndef BZ_META_METAPROG_H
00028 #include <blitz/meta/metaprog.h>
00029 #endif
00030
00031 #ifndef BZ_NUMTRAIT_H
00032 #include <blitz/numtrait.h>
00033 #endif
00034
00035 #include <blitz/tvcross.h>
00036 #include <blitz/meta/dot.h>
00037 #include <blitz/meta/product.h>
00038 #include <blitz/meta/sum.h>
00039
00040 BZ_NAMESPACE(blitz)
00041
00042 template<typename T_numtype1, typename T_numtype2, int N_length>
00043 inline BZ_PROMOTE(T_numtype1, T_numtype2)
00044 dot(const TinyVector<T_numtype1, N_length>& a,
00045 const TinyVector<T_numtype2, N_length>& b)
00046 {
00047 return _bz_meta_vectorDot<N_length, 0>::f(a,b);
00048 }
00049
00050 template<typename T_expr1, typename T_numtype2, int N_length>
00051 inline BZ_PROMOTE(_bz_typename T_expr1::T_numtype, T_numtype2)
00052 dot(_bz_VecExpr<T_expr1> a, const TinyVector<T_numtype2, N_length>& b)
00053 {
00054 return _bz_meta_vectorDot<N_length, 0>::f_value_ref(a,b);
00055 }
00056
00057 template<typename T_numtype1, typename T_expr2, int N_length>
00058 inline BZ_PROMOTE(T_numtype1, _bz_typename T_expr2::T_numtype)
00059 dot(const TinyVector<T_numtype1, N_length>& a, _bz_VecExpr<T_expr2> b)
00060 {
00061 return _bz_meta_vectorDot<N_length, 0>::f_ref_value(a,b);
00062 }
00063
00064 template<typename T_numtype1, int N_length>
00065 inline BZ_SUMTYPE(T_numtype1)
00066 product(const TinyVector<T_numtype1, N_length>& a)
00067 {
00068 return _bz_meta_vectorProduct<N_length, 0>::f(a);
00069 }
00070
00071 template<typename T_numtype, int N_length>
00072 inline BZ_SUMTYPE(T_numtype)
00073 sum(const TinyVector<T_numtype, N_length>& a)
00074 {
00075 return _bz_meta_vectorSum<N_length, 0>::f(a);
00076 }
00077
00078 BZ_NAMESPACE_END
00079
00080 #endif // BZ_TVECGLOBS_H
00081