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
88a4ebf4
Commit
88a4ebf4
authored
Sep 24, 2014
by
BRAMAS Berenger
Browse files
Use move in the swap function of the quicksorts
parent
9b7d7536
Changes
2
Show whitespace changes
Inline
Side-by-side
Src/Utils/FQuickSort.hpp
View file @
88a4ebf4
...
...
@@ -22,6 +22,7 @@
#include
<cstdlib>
#include
<cstring>
#include
<vector>
// For parallel without task
#include
<utility>
// For move
#include
"FGlobal.hpp"
#include
"FMemUtils.hpp"
...
...
@@ -43,9 +44,9 @@ protected:
/** swap to value */
template
<
class
NumType
>
static
inline
void
Swap
(
NumType
&
value
,
NumType
&
other
){
NumType
temp
=
value
;
value
=
other
;
other
=
temp
;
const
NumType
temp
=
std
::
move
(
value
)
;
value
=
std
::
move
(
other
)
;
other
=
std
::
move
(
temp
)
;
}
////////////////////////////////////////////////////////////
...
...
Src/Utils/FQuickSortMpi.hpp
View file @
88a4ebf4
...
...
@@ -21,6 +21,7 @@
#include
"FLog.hpp"
#include
<memory>
#include
<utility>
template
<
class
SortType
,
class
CompareType
,
class
IndexType
>
class
FQuickSortMpi
:
public
FQuickSort
<
SortType
,
CompareType
,
IndexType
>
{
...
...
@@ -38,9 +39,9 @@ class FQuickSortMpi : public FQuickSort< SortType, CompareType, IndexType> {
static
void
Swap
(
SortType
&
value
,
SortType
&
other
){
SortType
temp
=
value
;
value
=
other
;
other
=
temp
;
const
SortType
temp
=
std
::
move
(
value
)
;
value
=
std
::
move
(
other
)
;
other
=
std
::
move
(
temp
)
;
}
/* A local iteration of qs */
...
...
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