Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
0bf8296f
Commit
0bf8296f
authored
3 months ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
sqr_distance(): pass a and b by const&
parent
e293cdef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!292
M214003/develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcdi
+1
-1
1 addition, 1 deletion
libcdi
src/cdo_math.h
+2
-2
2 additions, 2 deletions
src/cdo_math.h
with
3 additions
and
3 deletions
libcdi
@
26fa6b8d
Compare
2702f10b
...
26fa6b8d
Subproject commit 2
702f10bd175963a0abdf3fa5239d2ebfc7ed95d
Subproject commit 2
6fa6b8dba31cd80dcbcaef2b4991837800567af
This diff is collapsed.
Click to expand it.
src/cdo_math.h
+
2
−
2
View file @
0bf8296f
...
...
@@ -7,11 +7,11 @@
namespace
cdo
{
constexpr
double
sqr
(
double
x
)
noexcept
{
return
x
*
x
;
}
constexpr
double
sqr_distance
(
const
std
::
array
<
double
,
3
>
&
a
,
const
std
::
array
<
double
,
3
>
&
b
)
noexcept
constexpr
double
sqr_distance
(
std
::
array
<
double
,
3
>
const
&
a
,
std
::
array
<
double
,
3
>
const
&
b
)
noexcept
{
return
sqr
(
a
[
0
]
-
b
[
0
])
+
sqr
(
a
[
1
]
-
b
[
1
])
+
sqr
(
a
[
2
]
-
b
[
2
]);
}
constexpr
double
sqr_distance
(
const
double
*
a
,
const
double
*
b
)
noexcept
constexpr
double
sqr_distance
(
double
const
(
&
a
)[
3
],
double
const
(
&
b
)[
3
]
)
noexcept
{
return
sqr
(
a
[
0
]
-
b
[
0
])
+
sqr
(
a
[
1
]
-
b
[
1
])
+
sqr
(
a
[
2
]
-
b
[
2
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment