Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
9ea05f83
Commit
9ea05f83
authored
Jun 25, 2009
by
mattijs
Browse files
moved sort from List to UList
parent
7df47610
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/List/List.C
View file @
9ea05f83
...
...
@@ -35,8 +35,6 @@ License
#include
"BiIndirectList.H"
#include
"contiguous.H"
#include
<algorithm>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
...
...
@@ -442,34 +440,6 @@ void Foam::List<T>::transfer(SortableList<T>& a)
}
template
<
class
T
>
void
Foam
::
sort
(
List
<
T
>&
a
)
{
std
::
sort
(
a
.
begin
(),
a
.
end
());
}
template
<
class
T
,
class
Cmp
>
void
Foam
::
sort
(
List
<
T
>&
a
,
const
Cmp
&
cmp
)
{
std
::
sort
(
a
.
begin
(),
a
.
end
(),
cmp
);
}
template
<
class
T
>
void
Foam
::
stableSort
(
List
<
T
>&
a
)
{
std
::
stable_sort
(
a
.
begin
(),
a
.
end
());
}
template
<
class
T
,
class
Cmp
>
void
Foam
::
stableSort
(
List
<
T
>&
a
,
const
Cmp
&
cmp
)
{
std
::
stable_sort
(
a
.
begin
(),
a
.
end
(),
cmp
);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// Assignment to UList operator. Takes linear time.
...
...
src/OpenFOAM/containers/Lists/List/List.H
View file @
9ea05f83
...
...
@@ -248,18 +248,6 @@ public:
template
<
class
T
>
List
<
T
>
readList
(
Istream
&
);
template
<
class
T
>
void
sort
(
List
<
T
>&
);
template
<
class
T
,
class
Cmp
>
void
sort
(
List
<
T
>&
,
const
Cmp
&
);
template
<
class
T
>
void
stableSort
(
List
<
T
>&
);
template
<
class
T
,
class
Cmp
>
void
stableSort
(
List
<
T
>&
,
const
Cmp
&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/containers/Lists/UList/UList.C
View file @
9ea05f83
...
...
@@ -30,6 +30,8 @@ License
#include
"ListLoopM.H"
#include
"contiguous.H"
#include
<algorithm>
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
T
>
...
...
@@ -116,6 +118,34 @@ Foam::label Foam::UList<T>::byteSize() const
}
template
<
class
T
>
void
Foam
::
sort
(
UList
<
T
>&
a
)
{
std
::
sort
(
a
.
begin
(),
a
.
end
());
}
template
<
class
T
,
class
Cmp
>
void
Foam
::
sort
(
UList
<
T
>&
a
,
const
Cmp
&
cmp
)
{
std
::
sort
(
a
.
begin
(),
a
.
end
(),
cmp
);
}
template
<
class
T
>
void
Foam
::
stableSort
(
UList
<
T
>&
a
)
{
std
::
stable_sort
(
a
.
begin
(),
a
.
end
());
}
template
<
class
T
,
class
Cmp
>
void
Foam
::
stableSort
(
UList
<
T
>&
a
,
const
Cmp
&
cmp
)
{
std
::
stable_sort
(
a
.
begin
(),
a
.
end
(),
cmp
);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template
<
class
T
>
...
...
src/OpenFOAM/containers/Lists/UList/UList.H
View file @
9ea05f83
...
...
@@ -320,6 +320,18 @@ public:
);
};
template
<
class
T
>
void
sort
(
UList
<
T
>&
);
template
<
class
T
,
class
Cmp
>
void
sort
(
UList
<
T
>&
,
const
Cmp
&
);
template
<
class
T
>
void
stableSort
(
UList
<
T
>&
);
template
<
class
T
,
class
Cmp
>
void
stableSort
(
UList
<
T
>&
,
const
Cmp
&
);
// Reverse the first n elements of the list
template
<
class
T
>
inline
void
reverse
(
UList
<
T
>&
,
const
label
n
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment