// @(#)root/smatrix:$Name: $:$Id: BinaryOperators.h,v 1.1 2005/11/24 16:03:42 brun Exp $ // Authors: T. Glebe, L. Moneta 2005 #ifndef ROOT_Math_BinaryOperators #define ROOT_Math_BinaryOperators //====================================================== // // ATTENTION: This file was automatically generated, // do not edit! // // author: Thorsten Glebe // HERA-B Collaboration // Max-Planck-Institut fuer Kernphysik // Saupfercheckweg 1 // 69117 Heidelberg // Germany // E-mail: T.Glebe@mpi-hd.mpg.de // //====================================================== namespace ROOT { namespace Math { template class SVector; template class SMatrix; //============================================================================== // AddOp //============================================================================== template class AddOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs + rhs; } }; //============================================================================== // operator+ (SVector, binary) //============================================================================== template < class T, unsigned int D> inline Expr, SVector, SVector, T>, T, D> operator+(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template inline Expr, Expr, SVector, T>, T, D> operator+(const Expr& lhs, const SVector& rhs) { typedef BinaryOp, Expr, SVector, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline Expr, SVector, Expr, T>, T, D> operator+(const SVector& lhs, const Expr& rhs) { typedef BinaryOp, SVector, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D> operator+(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline Expr, SVector, Constant, T>, T, D> operator+(const SVector& lhs, const A& rhs) { typedef BinaryOp, SVector, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, SVector, T>, T, D> operator+(const A& lhs, const SVector& rhs) { typedef BinaryOp, Constant, SVector, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D> operator+(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D> operator+(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, SMatrix, T>, T, D, D2> operator+(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2> operator+(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, Expr, T>, T, D, D2> operator+(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2> operator+(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, SMatrix, Constant, T>, T, D, D2> operator+(const SMatrix& lhs, const A& rhs) { typedef BinaryOp, SMatrix, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2> operator+(const A& lhs, const SMatrix& rhs) { typedef BinaryOp, Constant, SMatrix, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2> operator+(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2> operator+(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } //============================================================================== // MinOp //============================================================================== template class MinOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs - rhs; } }; //============================================================================== // operator- (SVector, binary) //============================================================================== template < class T, unsigned int D> inline Expr, SVector, SVector, T>, T, D> operator-(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template inline Expr, Expr, SVector, T>, T, D> operator-(const Expr& lhs, const SVector& rhs) { typedef BinaryOp, Expr, SVector, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline Expr, SVector, Expr, T>, T, D> operator-(const SVector& lhs, const Expr& rhs) { typedef BinaryOp, SVector, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D> operator-(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline Expr, SVector, Constant, T>, T, D> operator-(const SVector& lhs, const A& rhs) { typedef BinaryOp, SVector, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, SVector, T>, T, D> operator-(const A& lhs, const SVector& rhs) { typedef BinaryOp, Constant, SVector, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D> operator-(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D> operator-(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, SMatrix, T>, T, D, D2> operator-(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2> operator-(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, Expr, T>, T, D, D2> operator-(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2> operator-(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, SMatrix, Constant, T>, T, D, D2> operator-(const SMatrix& lhs, const A& rhs) { typedef BinaryOp, SMatrix, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2> operator-(const A& lhs, const SMatrix& rhs) { typedef BinaryOp, Constant, SMatrix, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2> operator-(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2> operator-(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // MulOp //============================================================================== template class MulOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs * rhs; } }; //============================================================================== // operator* (SVector, binary) //============================================================================== template < class T, unsigned int D> inline Expr, SVector, SVector, T>, T, D> operator*(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== template inline Expr, Expr, SVector, T>, T, D> operator*(const Expr& lhs, const SVector& rhs) { typedef BinaryOp, Expr, SVector, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline Expr, SVector, Expr, T>, T, D> operator*(const SVector& lhs, const Expr& rhs) { typedef BinaryOp, SVector, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D> operator*(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline Expr, SVector, Constant, T>, T, D> operator*(const SVector& lhs, const A& rhs) { typedef BinaryOp, SVector, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, SVector, T>, T, D> operator*(const A& lhs, const SVector& rhs) { typedef BinaryOp, Constant, SVector, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D> operator*(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D> operator*(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } //============================================================================== // times (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, SMatrix, T>, T, D, D2> times(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // times (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2> times(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // times (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, Expr, T>, T, D, D2> times(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // times (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2> times(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, SMatrix, Constant, T>, T, D, D2> operator*(const SMatrix& lhs, const A& rhs) { typedef BinaryOp, SMatrix, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2> operator*(const A& lhs, const SMatrix& rhs) { typedef BinaryOp, Constant, SMatrix, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2> operator*(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2> operator*(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } //============================================================================== // DivOp //============================================================================== template class DivOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs / rhs; } }; //============================================================================== // operator/ (SVector, binary) //============================================================================== template < class T, unsigned int D> inline Expr, SVector, SVector, T>, T, D> operator/(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary) //============================================================================== template inline Expr, Expr, SVector, T>, T, D> operator/(const Expr& lhs, const SVector& rhs) { typedef BinaryOp, Expr, SVector, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline Expr, SVector, Expr, T>, T, D> operator/(const SVector& lhs, const Expr& rhs) { typedef BinaryOp, SVector, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D> operator/(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline Expr, SVector, Constant, T>, T, D> operator/(const SVector& lhs, const A& rhs) { typedef BinaryOp, SVector, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, SVector, T>, T, D> operator/(const A& lhs, const SVector& rhs) { typedef BinaryOp, Constant, SVector, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D> operator/(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D> operator/(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } //============================================================================== // operator/ (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, SMatrix, T>, T, D, D2> operator/(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2> operator/(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2> inline Expr, SMatrix, Expr, T>, T, D, D2> operator/(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2> operator/(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, SMatrix, Constant, T>, T, D, D2> operator/(const SMatrix& lhs, const A& rhs) { typedef BinaryOp, SMatrix, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2> operator/(const A& lhs, const SMatrix& rhs) { typedef BinaryOp, Constant, SMatrix, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2> operator/(const Expr& lhs, const A& rhs) { typedef BinaryOp, Expr, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2> operator/(const A& lhs, const Expr& rhs) { typedef BinaryOp, Constant, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } } // namespace Math } // namespace ROOT #endif /*ROOT_Math_BinaryOperators */