Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
John Apostolakis
VecGeom
Commits
f6aaf19f
Commit
f6aaf19f
authored
Aug 18, 2021
by
Andrei Gheata
Committed by
Andrei Gheata
Aug 25, 2021
Browse files
Fixed formula for MakePlus/MinuTolerantSquare.
parent
d194a302
Changes
1
Hide whitespace changes
Inline
Side-by-side
VecGeom/volumes/kernel/GenericKernels.h
View file @
f6aaf19f
...
...
@@ -65,7 +65,7 @@ T MakePlusTolerantSquare(T const &x, T const &xsq, decltype(kTolerance) tol = kT
{
// calculate (x + halftol) * (x + halftol) which should always >= 0;
// in order to be fast, we neglect the + tol * tol term (since it should be negligible)
return
(
tolerant
)
?
xsq
+
tol
*
x
:
xsq
;
return
(
tolerant
)
?
xsq
+
2.
*
tol
*
x
:
xsq
;
}
template
<
bool
tolerant
,
typename
T
>
...
...
@@ -76,7 +76,7 @@ T MakeMinusTolerantSquare(T const &x, T const &xsq, decltype(kTolerance) tol = k
// calculate (x - halftol) * (x - halftol) which should always >= 0;
// in order to be fast, we neglect the + tol * tol term (since it should be negligible)
// but we make sure that there is never a negative sign (hence the Abs)
return
(
tolerant
)
?
Abs
(
xsq
-
tol
*
x
)
:
xsq
;
return
(
tolerant
)
?
Abs
(
xsq
-
2.
*
tol
*
x
)
:
xsq
;
}
template
<
bool
treatSurfaceT
,
class
Backend
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment