|
@ -34,9 +34,9 @@ namespace gp { |
|
|
size_t pivot; |
|
|
size_t pivot; |
|
|
|
|
|
|
|
|
if(value_workspace.size()%2) { |
|
|
if(value_workspace.size()%2) { |
|
|
pivot = value_workspace.size()/2 + 1; |
|
|
|
|
|
} else { |
|
|
|
|
|
pivot = value_workspace.size()/2; |
|
|
pivot = value_workspace.size()/2; |
|
|
|
|
|
} else { |
|
|
|
|
|
pivot = value_workspace.size()/2 + 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
destination_space[idx] = gp::move(value_workspace[pivot]); |
|
|
destination_space[idx] = gp::move(value_workspace[pivot]); |
|
@ -140,7 +140,7 @@ namespace gp { |
|
|
|
|
|
|
|
|
if(!ok) return false; |
|
|
if(!ok) return false; |
|
|
|
|
|
|
|
|
gp::sort(workspace.begin(), workspace.end(), [](const node_t& lhs, const node_t& rhs){ return lhs.has_value() > rhs.has_value(); }); |
|
|
|
|
|
|
|
|
gp::sort(workspace.begin(), workspace.end(), [](const node_t& lhs, const node_t& rhs){ return lhs.has_value() < rhs.has_value(); }); |
|
|
|
|
|
|
|
|
size_t cnt = 0; |
|
|
size_t cnt = 0; |
|
|
for(auto& elem : workspace) { |
|
|
for(auto& elem : workspace) { |
|
|