Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
O
openfpm_data
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_data
Compare Revisions
master...point-norm2
Source
point-norm2
Select Git revision
...
Target
master
Select Git revision
Compare
View open merge request
Commits (1)
Add the squared 2-norm of a Point, with the norm2() method.
· 984cd2d1
bianucci
authored
Apr 01, 2019
984cd2d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/Space/Shape/Point.hpp
src/Space/Shape/Point.hpp
+15
-0
No files found.
src/Space/Shape/Point.hpp
Edit
View file @
984cd2d1
...
...
@@ -232,6 +232,21 @@ template<unsigned int dim ,typename T> class Point
return
sqrt
(
n
);
}
/*! \brief Compute the squared 2-norm of the vector
*
* \return the squared 2-norm of the vector
*
*/
__device__
__host__
T
norm2
()
{
T
n
=
0.0
;
for
(
size_t
i
=
0
;
i
<
dim
;
i
++
)
n
+=
get
(
i
)
*
get
(
i
);
return
n
;
}
/*! \brief It calculate the distance between 2 points
*
* The distance between itself (p) and the other point (q)
...
...