4 #ifndef ROOT_Math_Functions 5 #define ROOT_Math_Functions 60 template <
class T,
unsigned int D>
class SVector;
86 return (lhs > rhs) ? lhs : rhs;
100 return (lhs < rhs) ? lhs : rhs;
113 return (x-static_cast<int>(x) < 0.5) ?
static_cast<int>(
x) : static_cast<int>(x+1);
127 inline int Sign(
const T&
x) {
return (x==0)? 0 : (x<0)? -1 : 1; }
132 template <
unsigned int I>
134 template <
class A,
class B,
class T>
135 static inline T f(
const A& lhs,
const B& rhs,
const T&
x) {
146 template <
class A,
class B,
class T>
147 static inline T f(
const A& lhs,
const B& rhs,
const T& ) {
148 return lhs.apply(0) * rhs.apply(0);
163 template <
class T,
unsigned int D>
171 template <
class A,
class T,
unsigned int D>
179 template <
class A,
class T,
unsigned int D>
188 template <
class A,
class B,
class T,
unsigned int D>
197 template <
unsigned int I>
199 template <
class A,
class T>
200 static inline T f(
const A& rhs,
const T&
x) {
211 template <
class A,
class T>
212 static inline T f(
const A& rhs,
const T& ) {
213 return Square(rhs.apply(0));
228 template <
class T,
unsigned int D>
236 template <
class A,
class T,
unsigned int D>
251 template <
class T,
unsigned int D>
259 template <
class A,
class T,
unsigned int D>
282 template <
class A,
class T>
306 template <
class A,
class T>
334 template <
class A,
class T>
347 template <
class T,
class A>
360 template <
class A,
class B,
class T>
380 template <
class T,
unsigned int D>
388 template <
class A,
class T,
unsigned int D>
397 template <
class T,
unsigned int D>
399 unit(
const SVector<T,D>& lhs) {
407 template <
class A,
class T,
unsigned int D>
408 inline VecExpr<BinaryOp<DivOp<T>,
VecExpr<A,T,D>, Constant<T>, T>,
T, D>
409 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: ...
Namespace for new ROOT classes and functions.
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