Macaulay2 Engine
Loading...
Searching...
No Matches
◆
sort_partition()
template<typename Sorter>
long
QuickSorter
< Sorter >::sort_partition
(
long
lo
,
long
hi
)
private
Definition at line
80
of file
monsort.hpp
.
81
{
82
value
pivot
=
elems
[
lo
];
83
long
i
=
lo
- 1;
84
long
j
=
hi
+ 1;
85
for
(;;)
86
{
87
do
88
{
89
j
--;
90
}
91
while
(
M
->compare(
elems
[
j
],
pivot
) < 0);
92
do
93
{
94
i
++;
95
}
96
while
(
M
->compare(
elems
[
i
],
pivot
) > 0);
97
98
if
(
i
<
j
)
99
{
100
value
tmp
=
elems
[
j
];
101
elems
[
j
] =
elems
[
i
];
102
elems
[
i
] =
tmp
;
103
}
104
else
105
return
j
;
106
}
107
}
QuickSorter::M
Sorter * M
Definition
monsort.hpp:50
QuickSorter::elems
value * elems
Definition
monsort.hpp:51
QuickSorter::value
Sorter::value value
Definition
monsort.hpp:49
QuickSorter
Definition
monsort.hpp:48
References
elems
, and
M
.
Referenced by
sort()
.
QuickSorter
Generated on
for Macaulay2 Engine by
1.15.0