4 #ifndef ROOT_Math_Functions 5 #define ROOT_Math_Functions 36 #ifndef ROOT_Math_Expression 62 template <
class T,
unsigned int D>
class SVector;
88 return (lhs > rhs) ? lhs : rhs;
102 return (lhs < rhs) ? lhs : rhs;
115 return (x-static_cast<int>(x) < 0.5) ?
static_cast<int>(
x) : static_cast<int>(x+1);
129 inline int Sign(
const T&
x) {
return (x==0)? 0 : (x<0)? -1 : 1; }
134 template <
unsigned int I>
136 template <
class A,
class B,
class T>
137 static inline T f(
const A& lhs,
const B& rhs,
const T&
x) {
148 template <
class A,
class B,
class T>
149 static inline T f(
const A& lhs,
const B& rhs,
const T& ) {
150 return lhs.apply(0) * rhs.apply(0);
165 template <
class T,
unsigned int D>
173 template <
class A,
class T,
unsigned int D>
181 template <
class A,
class T,
unsigned int D>
190 template <
class A,
class B,
class T,
unsigned int D>
199 template <
unsigned int I>
201 template <
class A,
class T>
202 static inline T f(
const A& rhs,
const T&
x) {
213 template <
class A,
class T>
214 static inline T f(
const A& rhs,
const T& ) {
215 return Square(rhs.apply(0));
230 template <
class T,
unsigned int D>
238 template <
class A,
class T,
unsigned int D>
253 template <
class T,
unsigned int D>
261 template <
class A,
class T,
unsigned int D>
284 template <
class A,
class T>
308 template <
class A,
class T>
336 template <
class A,
class T>
349 template <
class T,
class A>
362 template <
class A,
class B,
class T>
382 template <
class T,
unsigned int D>
390 template <
class A,
class T,
unsigned int D>
399 template <
class T,
unsigned int D>
401 unit(
const SVector<T,D>& lhs) {
409 template <
class A,
class T,
unsigned int D>
410 inline VecExpr<BinaryOp<DivOp<T>,
VecExpr<A,T,D>, Constant<T>, T>,
T, D>
411 unit(
const VecExpr<A,T,D>& lhs) {
T Dot(const SVector< T, D > &lhs, const SVector< T, D > &rhs)
Vector dot product.
Constant expression class A class representing constant expressions (literals) in the parse tree...
T Lmag(const SVector< T, 4 > &rhs)
Lmag: Minkowski Lorentz-Vector norm (only for 4-dim vectors) Length of a vector Lorentz-Vector: ...
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Division (element-wise) Operation Class.
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
int Round(const T &x)
round.
const T Minimum(const T &lhs, const T &rhs)
minimum.
const T Maximum(const T &lhs, const T &rhs)
maximum.
int Sign(const T &x)
sign.
BinaryOperation class A class representing binary operators in the parse tree.
T apply(unsigned int i) const
access the parse tree. Index starts from zero
T Mag2(const SVector< T, D > &rhs)
Vector magnitude square Template to compute .
SVector< T, 3 > Cross(const SVector< T, 3 > &lhs, const SVector< T, 3 > &rhs)
Vector Cross Product (only for 3-dim vectors) .
T Lmag2(const SVector< T, 4 > &rhs)
Lmag2: Square of Minkowski Lorentz-Vector norm (only for 4D Vectors) Template to compute ...
Namespace for new Math classes and functions.
Expression wrapper class for Vector objects.
const T Square(const T &x)
square Template function to compute , for any type T returning a type T
SVector< T, D > Unit(const SVector< T, D > &rhs)
Unit.
SVector: a generic fixed size Vector class.
T apply(unsigned int i) const