// @(#)root/smatrix:$Id: BinaryOperators.h 22916 2008-04-01 06:27:46Z moneta $ // 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 // //====================================================== #ifndef ROOT_Math_BinaryOpPolicy #include "Math/BinaryOpPolicy.h" #endif namespace ROOT { namespace Math { template class SVector; template class SMatrix; //============================================================================== // AddOp //============================================================================== /** Addition Operation Class @ingroup Expression */ template class AddOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs + rhs; } }; /** Addition of two vectors v3 = v1+v2 returning a vector expression @ingroup VectFunction */ //============================================================================== // operator+ (SVector, binary) //============================================================================== template < class T, unsigned int D> inline VecExpr, SVector, SVector, T>, T, D> operator+(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, SVector, T>, T, D> operator+(const VecExpr& lhs, const SVector& rhs) { typedef BinaryOp, VecExpr, SVector, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline VecExpr, SVector, VecExpr, T>, T, D> operator+(const SVector& lhs, const VecExpr& rhs) { typedef BinaryOp, SVector, VecExpr, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, VecExpr, T>, T, D> operator+(const VecExpr& lhs, const VecExpr& rhs) { typedef BinaryOp, VecExpr, VecExpr, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,rhs)); } /** Addition of a scalar to a each vector element: v2(i) = v1(i) + a returning a vector expression @ingroup VectFunction */ //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline VecExpr, SVector, Constant, T>, T, D> operator+(const SVector& lhs, const A& rhs) { typedef BinaryOpCopyR, SVector, Constant, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } /** Addition of a scalar to each vector element v2(i) = a + v1(i) returning a vector expression @ingroup VectFunction */ //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, SVector, T>, T, D> operator+(const A& lhs, const SVector& rhs) { typedef BinaryOpCopyL, Constant, SVector, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline VecExpr, VecExpr, Constant, T>, T, D> operator+(const VecExpr& lhs, const A& rhs) { typedef BinaryOpCopyR, VecExpr, Constant, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } //============================================================================== // operator+ (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, VecExpr, T>, T, D> operator+(const A& lhs, const VecExpr& rhs) { typedef BinaryOpCopyL, Constant, VecExpr, T> AddOpBinOp; return VecExpr(AddOpBinOp(AddOp(),Constant(lhs),rhs)); } /** Addition of two matrices C = A+B returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, SMatrix, T>, T, D, D2, typename AddPolicy::RepType > operator+(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> AddOpBinOp; return Expr::RepType>(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> operator+(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> AddOpBinOp; return Expr::RepType>(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, Expr, T>, T, D, D2,typename AddPolicy::RepType> operator+(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> AddOpBinOp; return Expr::RepType>(AddOpBinOp(AddOp(),lhs,rhs)); } //============================================================================== // operator+ (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2, typename AddPolicy::RepType > operator+(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> AddOpBinOp; return Expr::RepType>(AddOpBinOp(AddOp(),lhs,rhs)); } /** Addition element by element of matrix and a scalar C(i,j) = A(i,j) + s returning a matrix expression @ingroup MatrixFunctions */ //============================================================================= // operator+ (SMatrix, binary, Constant) //============================================================================= template inline Expr, SMatrix, Constant, T>, T, D, D2, R> operator+(const SMatrix& lhs, const A& rhs) { typedef BinaryOpCopyR, SMatrix, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(),lhs,Constant(rhs))); } /** Addition element by element of matrix and a scalar C(i,j) = s + A(i,j) returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2, R> operator+(const A& lhs, const SMatrix& rhs) { typedef BinaryOpCopyL, Constant, SMatrix, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(), Constant(lhs),rhs)); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2, R> operator+(const Expr& lhs, const A& rhs) { typedef BinaryOpCopyR, Expr, Constant, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(), lhs,Constant(rhs))); } //============================================================================== // operator+ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2, R> operator+(const A& lhs, const Expr& rhs) { typedef BinaryOpCopyL, Constant, Expr, T> AddOpBinOp; return Expr(AddOpBinOp(AddOp(), Constant(lhs),rhs)); } //============================================================================== // MinOp //============================================================================== /** Subtraction Operation Class @ingroup Expression */ template class MinOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs - rhs; } }; /** Vector Subtraction: v3 = v1 - v2 returning a vector expression @ingroup VectFunction */ //============================================================================== // operator- (SVector, binary) //============================================================================== template < class T, unsigned int D> inline VecExpr, SVector, SVector, T>, T, D> operator-(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, SVector, T>, T, D> operator-(const VecExpr& lhs, const SVector& rhs) { typedef BinaryOp, VecExpr, SVector, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline VecExpr, SVector, VecExpr, T>, T, D> operator-(const SVector& lhs, const VecExpr& rhs) { typedef BinaryOp, SVector, VecExpr, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, VecExpr, T>, T, D> operator-(const VecExpr& lhs, const VecExpr& rhs) { typedef BinaryOp, VecExpr, VecExpr, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,rhs)); } /** Subtraction of a scalar from each vector element: v2(i) = v1(i) - a returning a vector expression @ingroup VectFunction */ //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline VecExpr, SVector, Constant, T>, T, D> operator-(const SVector& lhs, const A& rhs) { typedef BinaryOpCopyR, SVector, Constant, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } /** Subtraction scalar vector (for each vector element) v2(i) = a - v1(i) returning a vector expression @ingroup VectFunction */ //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, SVector, T>, T, D> operator-(const A& lhs, const SVector& rhs) { typedef BinaryOpCopyL, Constant, SVector, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline VecExpr, VecExpr, Constant, T>, T, D> operator-(const VecExpr& lhs, const A& rhs) { typedef BinaryOpCopyR, VecExpr, Constant, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, VecExpr, T>, T, D> operator-(const A& lhs, const VecExpr& rhs) { typedef BinaryOpCopyL, Constant, VecExpr, T> MinOpBinOp; return VecExpr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } /** Subtraction of two matrices C = A-B returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator- (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> operator-(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> MinOpBinOp; return Expr::RepType>(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2,typename AddPolicy::RepType> operator-(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> MinOpBinOp; return Expr::RepType>(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, Expr, T>, T, D, D2, typename AddPolicy::RepType> operator-(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> MinOpBinOp; return Expr::RepType>(MinOpBinOp(MinOp(),lhs,rhs)); } //============================================================================== // operator- (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2,typename AddPolicy::RepType> operator-(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MinOpBinOp; return Expr::RepType>(MinOpBinOp(MinOp(),lhs,rhs)); } /** Subtraction of a scalar and a matrix (element wise) B(i,j) = A(i,j) - s returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, SMatrix, Constant, T>, T, D, D2, R> operator-(const SMatrix& lhs, const A& rhs) { typedef BinaryOpCopyR, SMatrix, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(), lhs,Constant(rhs))); } /** Subtraction of a scalar and a matrix (element wise) B(i,j) = s - A(i,j) returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2, R> operator-(const A& lhs, const SMatrix& rhs) { typedef BinaryOpCopyL, Constant, SMatrix, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),Constant(lhs),rhs)); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2, R> operator-(const Expr& lhs, const A& rhs) { typedef BinaryOpCopyR, Expr, Constant, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(),lhs,Constant(rhs))); } //============================================================================== // operator- (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2, R> operator-(const A& lhs, const Expr& rhs) { typedef BinaryOpCopyL, Constant, Expr, T> MinOpBinOp; return Expr(MinOpBinOp(MinOp(), Constant(lhs),rhs)); } /** Multiplication (element-wise) Operation Class @ingroup Expression */ //============================================================================== // MulOp //============================================================================== template class MulOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs * rhs; } }; /** Element by element vector product v3(i) = v1(i)*v2(i) returning a vector expression. Note this is NOT the Dot, Cross or Tensor product. @ingroup VectFunction */ //============================================================================== // operator* (SVector, binary) //============================================================================== template < class T, unsigned int D> inline VecExpr, SVector, SVector, T>, T, D> operator*(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== // template // inline VecExpr, VecExpr, SVector, T>, T, D> // operator*(const VecExpr& lhs, const SVector& rhs) { // typedef BinaryOp, VecExpr, SVector, T> MulOpBinOp; // return VecExpr(MulOpBinOp(MulOp(),lhs,rhs)); // } template inline VecExpr, Expr, SVector, T>, T, D> operator*(const VecExpr& lhs, const SVector& rhs) { typedef BinaryOp, VecExpr, SVector, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline VecExpr, SVector, VecExpr, T>, T, D> operator*(const SVector& lhs, const VecExpr& rhs) { typedef BinaryOp, SVector, VecExpr, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, VecExpr, T>, T, D> operator*(const VecExpr& lhs, const VecExpr& rhs) { typedef BinaryOp, VecExpr, VecExpr, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline VecExpr, SVector, Constant, T>, T, D> operator*(const SVector& lhs, const A& rhs) { typedef BinaryOpCopyR, SVector, Constant, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, SVector, T>, T, D> operator*(const A& lhs, const SVector& rhs) { typedef BinaryOpCopyL, Constant, SVector, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline VecExpr, VecExpr, Constant, T>, T, D> operator*(const VecExpr& lhs, const A& rhs) { typedef BinaryOpCopyR, VecExpr, Constant, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),lhs,Constant(rhs))); } //============================================================================== // operator* (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, VecExpr, T>, T, D> operator*(const A& lhs, const VecExpr& rhs) { typedef BinaryOpCopyL, Constant, VecExpr, T> MulOpBinOp; return VecExpr(MulOpBinOp(MulOp(),Constant(lhs),rhs)); } /** Element by element matrix multiplication C(i,j) = A(i,j)*B(i,j) returning a matrix expression. This is not a matrix-matrix multiplication and works only for matrices of the same dimensions. @ingroup MatrixFunctions */ // Times: Function for element - wise multiplication //============================================================================== // Times (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> Times(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> MulOpBinOp; return Expr::RepType>(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // Times (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> Times(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> MulOpBinOp; return Expr::RepType>(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // Times (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, Expr, T>, T, D, D2, typename AddPolicy::RepType> Times(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> MulOpBinOp; return Expr::RepType>(MulOpBinOp(MulOp(),lhs,rhs)); } //============================================================================== // Times (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2, typename AddPolicy::RepType> Times(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> MulOpBinOp; return Expr::RepType>(MulOpBinOp(MulOp(),lhs,rhs)); } /** Multiplication (element wise) of a matrix and a scalar, B(i,j) = A(i,j) * s returning a matrix expression @ingroup MatrixFunctions */ //============================================================================= // operator* (SMatrix, binary, Constant) //============================================================================= template inline Expr, SMatrix, Constant, T>, T, D, D2, R> operator*(const SMatrix& lhs, const A& rhs) { typedef BinaryOpCopyR, SMatrix, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(), lhs,Constant(rhs))); } /** Multiplication (element wise) of a matrix and a scalar, B(i,j) = s * A(i,j) returning a matrix expression @ingroup MatrixFunctions */ //============================================================================= // operator* (SMatrix, binary, Constant) //============================================================================= template inline Expr, Constant, SMatrix, T>, T, D, D2, R> operator*(const A& lhs, const SMatrix& rhs) { typedef BinaryOpCopyL, Constant, SMatrix, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(), Constant(lhs),rhs)); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2, R> operator*(const Expr& lhs, const A& rhs) { typedef BinaryOpCopyR, Expr, Constant, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(), lhs,Constant(rhs))); } //============================================================================== // operator* (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2, R> operator*(const A& lhs, const Expr& rhs) { typedef BinaryOpCopyL, Constant, Expr, T> MulOpBinOp; return Expr(MulOpBinOp(MulOp(), Constant(lhs),rhs)); } //============================================================================= // DivOp //============================================================================= /** Division (element-wise) Operation Class @ingroup Expression */ template class DivOp { public: static inline T apply(const T& lhs, const T& rhs) { return lhs / rhs; } }; /** Element by element division of vectors of the same dimension: v3(i) = v1(i)/v2(i) returning a vector expression @ingroup VectFunction */ //============================================================================== // operator/ (SVector, binary) //============================================================================== template < class T, unsigned int D> inline VecExpr, SVector, SVector, T>, T, D> operator/(const SVector& lhs, const SVector& rhs) { typedef BinaryOp, SVector, SVector, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary) //============================================================================== template inline VecExpr, VecExpr, SVector, T>, T, D> operator/(const VecExpr& lhs, const SVector& rhs) { typedef BinaryOp, VecExpr, SVector, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // operator/ (SVector, binary) //============================================================================== template < class A, class T, unsigned int D> inline VecExpr, SVector, VecExpr, T>, T, D> operator/(const SVector& lhs, const VecExpr& rhs) { typedef BinaryOp, SVector, VecExpr, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================= // operator/ (SVector, binary) //============================================================================= template inline VecExpr, VecExpr, VecExpr, T>, T, D> operator/(const VecExpr& lhs, const VecExpr& rhs) { typedef BinaryOp, VecExpr, VecExpr, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,rhs)); } /** Division of the vector element by a scalar value: v2(i) = v1(i)/a returning a vector expression @ingroup VectFunction */ //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline VecExpr, SVector, Constant, T>, T, D> operator/(const SVector& lhs, const A& rhs) { typedef BinaryOpCopyR, SVector, Constant, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } /** Division of a scalar value by the vector element: v2(i) = a/v1(i) returning a vector expression @ingroup VectFunction */ //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, SVector, T>, T, D> operator/(const A& lhs, const SVector& rhs) { typedef BinaryOpCopyL, Constant, SVector, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline VecExpr, VecExpr, Constant, T>, T, D> operator/(const VecExpr& lhs, const A& rhs) { typedef BinaryOpCopyR, VecExpr, Constant, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),lhs,Constant(rhs))); } //============================================================================== // operator/ (SVector, binary, Constant) //============================================================================== template inline VecExpr, Constant, VecExpr, T>, T, D> operator/(const A& lhs, const VecExpr& rhs) { typedef BinaryOpCopyL, Constant, VecExpr, T> DivOpBinOp; return VecExpr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } /** Division (element wise) of two matrices of the same dimensions: C(i,j) = A(i,j) / B(i,j) returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // Div (SMatrix, binary) //============================================================================== template < class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> Div(const SMatrix& lhs, const SMatrix& rhs) { typedef BinaryOp, SMatrix, SMatrix, T> DivOpBinOp; return Expr::RepType>(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // Div (SMatrix, binary) //============================================================================== template inline Expr, Expr, SMatrix, T>, T, D, D2, typename AddPolicy::RepType> Div(const Expr& lhs, const SMatrix& rhs) { typedef BinaryOp, Expr, SMatrix, T> DivOpBinOp; return Expr::RepType>(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // Div (SMatrix, binary) //============================================================================== template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2> inline Expr, SMatrix, Expr, T>, T, D, D2, typename AddPolicy::RepType> Div(const SMatrix& lhs, const Expr& rhs) { typedef BinaryOp, SMatrix, Expr, T> DivOpBinOp; return Expr::RepType>(DivOpBinOp(DivOp(),lhs,rhs)); } //============================================================================== // Div (SMatrix, binary) //============================================================================== template inline Expr, Expr, Expr, T>, T, D, D2,typename AddPolicy::RepType> Div(const Expr& lhs, const Expr& rhs) { typedef BinaryOp, Expr, Expr, T> DivOpBinOp; return Expr::RepType>(DivOpBinOp(DivOp(),lhs,rhs)); } /** Division (element wise) of a matrix and a scalar, B(i,j) = A(i,j) / s returning a matrix expression @ingroup MatrixFunctions */ //============================================================================= // operator/ (SMatrix, binary, Constant) //============================================================================= template inline Expr, SMatrix, Constant, T>, T, D, D2, R> operator/(const SMatrix& lhs, const A& rhs) { typedef BinaryOpCopyR, SMatrix, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(), lhs,Constant(rhs))); } /** Division (element wise) of a matrix and a scalar, B(i,j) = s / A(i,j) returning a matrix expression @ingroup MatrixFunctions */ //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, SMatrix, T>, T, D, D2, R> operator/(const A& lhs, const SMatrix& rhs) { typedef BinaryOpCopyL, Constant, SMatrix, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(), Constant(lhs),rhs)); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Expr, Constant, T>, T, D, D2, R> operator/(const Expr& lhs, const A& rhs) { typedef BinaryOpCopyR, Expr, Constant, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(), lhs,Constant(rhs))); } //============================================================================== // operator/ (SMatrix, binary, Constant) //============================================================================== template inline Expr, Constant, Expr, T>, T, D, D2,R> operator/(const A& lhs, const Expr& rhs) { typedef BinaryOpCopyL, Constant, Expr, T> DivOpBinOp; return Expr(DivOpBinOp(DivOp(),Constant(lhs),rhs)); } } // namespace Math } // namespace ROOT #endif /*ROOT_Math_BinaryOperators */