// @(#)root/smatrix:$Name: $:$Id: UnaryOperators.h,v 1.2 2006/02/08 14:45:35 moneta Exp $ // Authors: T. Glebe, L. Moneta 2005 #ifndef ROOT_Math_UnaryOperators #define ROOT_Math_UnaryOperators //====================================================== // // 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 // //====================================================== #include namespace ROOT { namespace Math { template class SVector; template class SMatrix; //============================================================================== // Minus //============================================================================== template class Minus { public: static inline T apply(const T& rhs) { return -(rhs); } }; //============================================================================== // operator- (Expr, unary) //============================================================================== template inline VecExpr, VecExpr, T>, T, D> operator-(const VecExpr& rhs) { typedef UnaryOp, VecExpr, T> MinusUnaryOp; return VecExpr(MinusUnaryOp(Minus(),rhs)); } //============================================================================== // operator- (SVector, unary) //============================================================================== template inline VecExpr, SVector, T>, T, D> operator-(const SVector& rhs) { typedef UnaryOp, SVector, T> MinusUnaryOp; return VecExpr(MinusUnaryOp(Minus(),rhs)); } //============================================================================== // operator- (MatrixExpr, unary) //============================================================================== template inline Expr, Expr, T>, T, D, D2,R> operator-(const Expr& rhs) { typedef UnaryOp, Expr, T> MinusUnaryOp; return Expr(MinusUnaryOp(Minus(),rhs)); } //============================================================================== // operator- (SMatrix, unary) //============================================================================== template inline Expr, SMatrix, T>, T, D, D2,R> operator-(const SMatrix& rhs) { typedef UnaryOp, SMatrix, T> MinusUnaryOp; return Expr(MinusUnaryOp(Minus(),rhs)); } //============================================================================== // Fabs //============================================================================== template class Fabs { public: static inline T apply(const T& rhs) { return std::fabs(rhs); } }; //============================================================================== // fabs (Expr, unary) //============================================================================== template inline VecExpr, VecExpr, T>, T, D> fabs(const VecExpr& rhs) { typedef UnaryOp, VecExpr, T> FabsUnaryOp; return VecExpr(FabsUnaryOp(Fabs(),rhs)); } //============================================================================== // fabs (SVector, unary) //============================================================================== template inline VecExpr, SVector, T>, T, D> fabs(const SVector& rhs) { typedef UnaryOp, SVector, T> FabsUnaryOp; return VecExpr(FabsUnaryOp(Fabs(),rhs)); } //============================================================================== // fabs (MatrixExpr, unary) //============================================================================== template inline Expr, Expr, T>, T, D, D2, R> fabs(const Expr& rhs) { typedef UnaryOp, Expr, T> FabsUnaryOp; return Expr(FabsUnaryOp(Fabs(),rhs)); } //============================================================================== // fabs (SMatrix, unary) //============================================================================== template inline Expr, SMatrix, T>, T, D, D2, R> fabs(const SMatrix& rhs) { typedef UnaryOp, SMatrix, T> FabsUnaryOp; return Expr(FabsUnaryOp(Fabs(),rhs)); } //============================================================================== // Sqr //============================================================================== template class Sqr { public: static inline T apply(const T& rhs) { return square(rhs); } }; //============================================================================== // sqr (Expr, unary) //============================================================================== template inline VecExpr, VecExpr, T>, T, D> sqr(const VecExpr& rhs) { typedef UnaryOp, VecExpr, T> SqrUnaryOp; return VecExpr(SqrUnaryOp(Sqr(),rhs)); } //============================================================================== // sqr (SVector, unary) //============================================================================== template inline VecExpr, SVector, T>, T, D> sqr(const SVector& rhs) { typedef UnaryOp, SVector, T> SqrUnaryOp; return VecExpr(SqrUnaryOp(Sqr(),rhs)); } //============================================================================== // sqr (MatrixExpr, unary) //============================================================================== template inline Expr, Expr, T>, T, D, D2, R> sqr(const Expr& rhs) { typedef UnaryOp, Expr, T> SqrUnaryOp; return Expr(SqrUnaryOp(Sqr(),rhs)); } //============================================================================== // sqr (SMatrix, unary) //============================================================================== template inline Expr, SMatrix, T>, T, D, D2, R> sqr(const SMatrix& rhs) { typedef UnaryOp, SMatrix, T> SqrUnaryOp; return Expr(SqrUnaryOp(Sqr(),rhs)); } //============================================================================== // Sqrt //============================================================================== template class Sqrt { public: static inline T apply(const T& rhs) { return std::sqrt(rhs); } }; //============================================================================== // sqrt (VecExpr, unary) //============================================================================== template inline VecExpr, VecExpr, T>, T, D> sqrt(const VecExpr& rhs) { typedef UnaryOp, VecExpr, T> SqrtUnaryOp; return VecExpr(SqrtUnaryOp(Sqrt(),rhs)); } //============================================================================== // sqrt (SVector, unary) //============================================================================== template inline VecExpr, SVector, T>, T, D> sqrt(const SVector& rhs) { typedef UnaryOp, SVector, T> SqrtUnaryOp; return VecExpr(SqrtUnaryOp(Sqrt(),rhs)); } //============================================================================== // sqrt (MatrixExpr, unary) //============================================================================== template inline Expr, Expr, T>, T, D, D2, R> sqrt(const Expr& rhs) { typedef UnaryOp, Expr, T> SqrtUnaryOp; return Expr(SqrtUnaryOp(Sqrt(),rhs)); } //============================================================================== // sqrt (SMatrix, unary) //============================================================================== template inline Expr, SMatrix, T>, T, D, D2, R> sqrt(const SMatrix& rhs) { typedef UnaryOp, SMatrix, T> SqrtUnaryOp; return Expr(SqrtUnaryOp(Sqrt(),rhs)); } } // namespace Math } // namespace ROOT #endif /* ROOT_Math_UnaryOperators */