Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
2208d28c
Commit
2208d28c
authored
Jan 29, 2014
by
COULAUD Olivier
Browse files
Add norm2 function
parent
f925edbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Src/Utils/FPoint.hpp
View file @
2208d28c
// ===================================================================================
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, B
é
renger Bramas.
// Propri
é
taires : INRIA.
// Copyright
©
2011-2012, diffus
é
sous les termes et conditions d
’
une licence propri
é
taire.
// Co-auteurs : Olivier Coulaud, B
��
renger Bramas.
// Propri
��
taires : INRIA.
// Copyright
��
2011-2012, diffus
��
sous les termes et conditions d
���
une licence propri
��
taire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, B
é
renger Bramas.
// Co-authors: Olivier Coulaud, B
��
renger Bramas.
// Owners: INRIA.
// Copyright
©
2011-2012, spread under the terms and conditions of a proprietardata[1] license.
// Copyright
��
2011-2012, spread under the terms and conditions of a proprietardata[1] license.
// ===================================================================================
#ifndef FPOINT_HPP
#define FPOINT_HPP
...
...
@@ -62,7 +62,7 @@ public:
}
/**
* Assign
e
ment operator
* Assignment operator
* @param other the source class to copy
*/
FPoint
(
const
FPoint
&
other
,
const
FReal
addset
)
{
...
...
@@ -172,14 +172,23 @@ public:
FReal
*
getDataValue
(){
return
this
->
data
;
}
/**
*Compute the distance to the origin
* @return the norm of the Fpoint
*/
FReal
norm
()
const
{
return
FMath
::
Sqrt
(
this
->
data
[
0
]
*
this
->
data
[
0
]
+
this
->
data
[
1
]
*
this
->
data
[
1
]
+
this
->
data
[
2
]
*
this
->
data
[
2
])
;
}
/**
*Compute the distance to the origin
* @return the norm of the Fpoint
*/
FReal
norm
()
const
{
return
FMath
::
Sqrt
(
this
->
data
[
0
]
*
this
->
data
[
0
]
+
this
->
data
[
1
]
*
this
->
data
[
1
]
+
this
->
data
[
2
]
*
this
->
data
[
2
])
;
}
/**
*Compute the distance to the origin
* @return the square norm of the Fpoint
*/
FReal
norm2
()
const
{
return
(
this
->
data
[
0
]
*
this
->
data
[
0
]
+
this
->
data
[
1
]
*
this
->
data
[
1
]
+
this
->
data
[
2
]
*
this
->
data
[
2
])
;
}
/**
* Subtract to all dim the inValue
...
...
@@ -195,7 +204,7 @@ public:
/**
* Affect to all dim the inValue
* @param inValue the value to afect
* @param inValue the value to af
f
ect
* @return the current object after being affected
*/
FPoint
&
operator
+=
(
const
FReal
inValue
){
...
...
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