20#define ROOT_MATH_ARCH MathSYCL
47#include <sycl/sycl.hpp>
67int compare(
double v1,
double v2,
double scale = 1.0)
72 double eps =
scale * std::numeric_limits<double>::epsilon();
74 double delta =
v2 -
v1;
78 if (
v1 == 0 ||
v2 == 0) {
90 if (delta /
d > eps && delta > eps)
97template <
class Transform>
98bool IsEqual(
const Transform &
t1,
const Transform &
t2,
unsigned int size)
101 std::vector<double>
x1(
size);
102 std::vector<double>
x2(
size);
103 t1.GetComponents(
x1.begin(),
x1.end());
104 t2.GetComponents(
x2.begin(),
x2.end());
110 std::abs(
x1[i] -
x2[i]) < std::numeric_limits<double>::epsilon() * (std::abs(
x1[i]) + std::abs(
x2[i]));
119 std::cout <<
"\n************************************************************************\n " <<
" Vector 3D Test"
120 <<
"\n************************************************************************\n";
122 sycl::buffer<int, 1>
ok_buf(&ok, sycl::range<1>(1));
127 queue.submit([&](sycl::handler &
cgh) {
159 std::cout <<
"\t\t OK " << std::endl;
166 std::cout <<
"\n************************************************************************\n " <<
" Point 3D Tests"
167 <<
"\n************************************************************************\n";
169 sycl::buffer<int, 1>
ok_buf(&ok, sycl::range<1>(1));
174 queue.submit([&](sycl::handler &
cgh) {
189 double r =
pg.Dot(
vg);
212 std::cout <<
"\t OK " << std::endl;
219 std::cout <<
"\n************************************************************************\n "
220 <<
" Lorentz Vector Tests"
221 <<
"\n************************************************************************\n";
225 ok += compare(
v1.DeltaR(
v2), 4.60575f);
232 std::cout <<
"\t OK " << std::endl;
244 std::cout <<
"\n\nNumber of tests " <<
ntest <<
" failed = " <<
nfail << std::endl;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Tag for identifying vectors based on a global coordinate system.
Tag for identifying vectors based on a local coordinate system.
Global Helper functions for generic Vector classes.
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
3D Vector based on the cartesian coordinates x,y,z in double precision
bool areEqual(const RULE *r1, const RULE *r2, bool moduloNameOrPattern=false)