Project
Loading...
Searching...
No Matches
CartesianGPU.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ALICEO2_CARTESIANGPU_H
16#define ALICEO2_CARTESIANGPU_H
17
18#include "GPUCommonDef.h"
19
20namespace o2::math_utils
21{
22
23namespace detail
24{
25template <typename T, int I>
26struct GPUPoint2D {
27 GPUdDefault() GPUPoint2D() = default;
28 GPUhd() GPUPoint2D(T a, T b) : xx(a), yy(b) {}
29 GPUhd() float X() const { return xx; }
30 GPUhd() float Y() const { return yy; }
31 GPUd() float R() const { return o2::gpu::CAMath::Sqrt(xx * xx + yy * yy); }
32 GPUd() void SetX(float v) { xx = v; }
33 GPUd() void SetY(float v) { yy = v; }
36};
37
38template <typename T, int I>
39struct GPUPoint3D : public GPUPoint2D<T, I> {
40 GPUdDefault() GPUPoint3D() = default;
41 GPUhd() GPUPoint3D(T a, T b, T c) : GPUPoint2D<T, I>(a, b), zz(c) {}
42 GPUhd() float Z() const { return zz; }
43 GPUd() float R() const { return o2::gpu::CAMath::Sqrt(GPUPoint2D<T, I>::xx * GPUPoint2D<T, I>::xx + GPUPoint2D<T, I>::yy * GPUPoint2D<T, I>::yy + zz * zz); }
44 GPUd() void SetZ(float v) { zz = v; }
46};
47} // namespace detail
48
49} // end namespace o2::math_utils
50
51#endif
const GLdouble * v
Definition glcorearb.h:832
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GPUdDefault() GPUPoint2D()=default
GPUdDefault() GPUPoint3D()=default