20#define ROOT_MATH_ARCH MathSYCL
48#include <sycl/sycl.hpp>
68int compare(
double v1,
double v2,
double scale = 1.0)
73 double eps =
scale * std::numeric_limits<double>::epsilon();
75 double delta =
v2 -
v1;
79 if (
v1 == 0 ||
v2 == 0) {
91 if (delta /
d > eps && delta > eps)
98template <
class Transform>
99bool IsEqual(
const Transform &
t1,
const Transform &
t2,
unsigned int size)
102 std::vector<double>
x1(
size);
103 std::vector<double>
x2(
size);
104 t1.GetComponents(
x1.begin(),
x1.end());
105 t2.GetComponents(
x2.begin(),
x2.end());
111 std::abs(
x1[i] -
x2[i]) < std::numeric_limits<double>::epsilon() * (std::abs(
x1[i]) + std::abs(
x2[i]));
120 std::cout <<
"\n************************************************************************\n " <<
" Vector 3D Test"
121 <<
"\n************************************************************************\n";
123 sycl::buffer<int, 1>
ok_buf(&ok, sycl::range<1>(1));
128 queue.submit([&](sycl::handler &
cgh) {
160 std::cout <<
"\t\t OK " << std::endl;
167 std::cout <<
"\n************************************************************************\n " <<
" Point 3D Tests"
168 <<
"\n************************************************************************\n";
170 sycl::buffer<int, 1>
ok_buf(&ok, sycl::range<1>(1));
175 queue.submit([&](sycl::handler &
cgh) {
190 double r =
pg.Dot(
vg);
213 std::cout <<
"\t OK " << std::endl;
220 std::cout <<
"\n************************************************************************\n "
221 <<
" Lorentz Vector Tests"
222 <<
"\n************************************************************************\n";
224 sycl::buffer<int, 1>
ok_buf(&ok, sycl::range<1>(1));
228 std::cout <<
"sycl::queue check - selected device:\n"
229 << queue.get_device().get_info<sycl::info::device::name>() << std::endl;
232 queue.submit([&](sycl::handler &
cgh) {
246 std::cout <<
"\tOK\n";
248 std::cout <<
"\t FAILED\n";
260 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)