Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
UnaryOperators.h
Go to the documentation of this file.
1// @(#)root/smatrix:$Id$
2// Authors: T. Glebe, L. Moneta 2005
3
4#ifndef ROOT_Math_UnaryOperators
5#define ROOT_Math_UnaryOperators
6//======================================================
7//
8// ATTENTION: This file was automatically generated,
9// do not edit!
10//
11// author: Thorsten Glebe
12// HERA-B Collaboration
13// Max-Planck-Institut fuer Kernphysik
14// Saupfercheckweg 1
15// 69117 Heidelberg
16// Germany
17// E-mail: T.Glebe@mpi-hd.mpg.de
18//
19//======================================================
20
21#include <cmath>
22
23#include "Math/Expression.h"
24
25namespace ROOT {
26
27 namespace Math {
28
29
30
31template <class T, unsigned int D> class SVector;
32template <class T, unsigned int D1, unsigned int D2, class R> class SMatrix;
33
34
35/**
36 Unary Minus Operation Class
37
38 @ingroup Expression
39 */
40//==============================================================================
41// Minus
42//==============================================================================
43template <class T>
44class Minus {
45public:
46 static inline T apply(const T& rhs) {
47 return -(rhs);
48 }
49};
50
51//==============================================================================
52// operator- (Expr, unary)
53//==============================================================================
54template <class A, class T, unsigned int D>
61
62
63/**
64 Unary - operator v2 = -v1 .
65 returning a vector expression
66
67 @ingroup VectFunction
68*/
69//==============================================================================
70// operator- (SVector, unary)
71//==============================================================================
72template <class T, unsigned int D>
79
80//==============================================================================
81// operator- (MatrixExpr, unary)
82//==============================================================================
83template <class A, class T, unsigned int D, unsigned int D2, class R>
90
91
92/**
93 Unary - operator B = - A
94 returning a matrix expression
95
96 @ingroup MatrixFunctions
97*/
98//==============================================================================
99// operator- (SMatrix, unary)
100//==============================================================================
101template <class T, unsigned int D, unsigned int D2, class R>
108
109
110//==============================================================================
111// Fabs
112//==============================================================================
113/**
114 Unary abs Operation Class
115
116 @ingroup Expression
117 */
118template <class T>
119class Fabs {
120public:
121 static inline T apply(const T& rhs) {
122 return std::abs(rhs);
123 }
124};
125
126//==============================================================================
127// fabs (Expr, unary)
128//==============================================================================
129template <class A, class T, unsigned int D>
136
137
138/**
139 abs of a vector : v2(i) = | v1(i) |
140 returning a vector expression
141
142 @ingroup VectFunction
143*/
144//==============================================================================
145// fabs (SVector, unary)
146//==============================================================================
147template <class T, unsigned int D>
148inline VecExpr<UnaryOp<Fabs<T>, SVector<T,D>, T>, T, D>
154
155//==============================================================================
156// fabs (MatrixExpr, unary)
157//==============================================================================
158template <class A, class T, unsigned int D, unsigned int D2, class R>
159inline Expr<UnaryOp<Fabs<T>, Expr<A,T,D,D2,R>, T>, T, D, D2, R>
165
166
167/**
168 abs of a matrix m2(i,j) = | m1(i,j) |
169 returning a matrix epression
170
171 @ingroup MatrixFunctions
172*/
173//==============================================================================
174// fabs (SMatrix, unary)
175//==============================================================================
176template <class T, unsigned int D, unsigned int D2, class R>
177inline Expr<UnaryOp<Fabs<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
183
184
185/**
186 Unary Square Operation Class
187
188 @ingroup Expression
189 */
190//==============================================================================
191// Sqr
192//==============================================================================
193template <class T>
194class Sqr {
195public:
196 static inline T apply(const T& rhs) {
197 return square(rhs);
198 }
199};
200
201//==============================================================================
202// sqr (Expr, unary)
203//==============================================================================
204template <class A, class T, unsigned int D>
205inline VecExpr<UnaryOp<Sqr<T>, VecExpr<A,T,D>, T>, T, D>
211
212
213/**
214 square of a vector v2(i) = v1(i)*v1(i) .
215 returning a vector expression
216
217 @ingroup VectFunction
218*/
219//==============================================================================
220// sqr (SVector, unary)
221//==============================================================================
222template <class T, unsigned int D>
223inline VecExpr<UnaryOp<Sqr<T>, SVector<T,D>, T>, T, D>
229
230//==============================================================================
231// sqr (MatrixExpr, unary)
232//==============================================================================
233template <class A, class T, unsigned int D, unsigned int D2, class R>
234inline Expr<UnaryOp<Sqr<T>, Expr<A,T,D,D2,R>, T>, T, D, D2, R>
240
241
242/**
243 square of a matrix B(i,j) = A(i,j)*A(i,j)
244 returning a matrix expression
245
246 @ingroup MatrixFunctions
247*/
248//==============================================================================
249// sqr (SMatrix, unary)
250//==============================================================================
251template <class T, unsigned int D, unsigned int D2, class R>
252inline Expr<UnaryOp<Sqr<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
258
259
260//==============================================================================
261// Sqrt
262//==============================================================================
263/**
264 Unary Square Root Operation Class
265
266 @ingroup Expression
267 */
268template <class T>
269class Sqrt {
270public:
271 static inline T apply(const T& rhs) {
272 return std::sqrt(rhs);
273 }
274};
275
276//==============================================================================
277// sqrt (VecExpr, unary)
278//==============================================================================
279template <class A, class T, unsigned int D>
286
287
288/**
289 square root of a vector (element by element) v2(i) = sqrt( v1(i) )
290 returning a vector expression
291
292 @ingroup VectFunction
293*/
294//==============================================================================
295// sqrt (SVector, unary)
296//==============================================================================
297template <class T, unsigned int D>
298inline VecExpr<UnaryOp<Sqrt<T>, SVector<T,D>, T>, T, D>
304
305//==============================================================================
306// sqrt (MatrixExpr, unary)
307//==============================================================================
308template <class A, class T, unsigned int D, unsigned int D2, class R>
309inline Expr<UnaryOp<Sqrt<T>, Expr<A,T,D,D2,R>, T>, T, D, D2, R>
315
316/**
317 square root of a matrix (element by element) m2(i,j) = sqrt ( m1(i,j) )
318 returning a matrix expression
319
320 @ingroup MatrixFunctions
321*/
322//==============================================================================
323// sqrt (SMatrix, unary)
324//==============================================================================
325template <class T, unsigned int D, unsigned int D2, class R>
326inline Expr<UnaryOp<Sqrt<T>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
332
333
334 } // namespace Math
335
336} // namespace ROOT
337
338
339
340#endif /* ROOT_Math_UnaryOperators */
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Unary abs Operation Class.
static T apply(const T &rhs)
Unary Minus Operation Class.
static T apply(const T &rhs)
Unary Square Operation Class.
static T apply(const T &rhs)
Unary Square Root Operation Class.
static T apply(const T &rhs)
Namespace for new Math classes and functions.
VecExpr< UnaryOp< Sqr< T >, VecExpr< A, T, D >, T >, T, D > sqr(const VecExpr< A, T, D > &rhs)
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...