Skip to content

Commit

Permalink
Autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
No Author authored and texodus committed Feb 24, 2024
1 parent a926d93 commit fb83443
Show file tree
Hide file tree
Showing 178 changed files with 17,164 additions and 11,835 deletions.
274 changes: 194 additions & 80 deletions cpp/perspective/src/cpp/aggregate.cpp

Large diffs are not rendered by default.

852 changes: 436 additions & 416 deletions cpp/perspective/src/cpp/aggspec.cpp

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions cpp/perspective/src/cpp/arg_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ namespace perspective {

void
argsort(std::vector<t_index>& output, const t_multisorter& sorter) {
if (output.empty())
if (output.empty()) {
return;
}
// Output should be the same size is v
for (t_index i = 0, loop_end = output.size(); i != loop_end; ++i)
for (t_index i = 0, loop_end = output.size(); i != loop_end; ++i) {
output[i] = i;
}
std::sort(output.begin(), output.end(), sorter);
}

t_argsort_comparator::t_argsort_comparator(
const std::vector<t_tscalar>& v, const t_sorttype& sort_type)
: m_v(v)
, m_sort_type(sort_type) {}
const std::vector<t_tscalar>& v, const t_sorttype& sort_type
) :
m_v(v),
m_sort_type(sort_type) {}

bool
t_argsort_comparator::operator()(t_index a, t_index b) const {
Expand Down Expand Up @@ -61,11 +64,15 @@ t_argsort_comparator::operator()(t_index a, t_index b) const {
}

void
simple_argsort(std::vector<t_tscalar>& v, std::vector<t_index>& output,
const t_sorttype& sort_type) {
simple_argsort(
std::vector<t_tscalar>& v,
std::vector<t_index>& output,
const t_sorttype& sort_type
) {
// Output should be the same size is v
for (t_index i = 0, loop_end = output.size(); i != loop_end; ++i)
for (t_index i = 0, loop_end = output.size(); i != loop_end; ++i) {
output[i] = i;
}
t_argsort_comparator cmp(v, sort_type);

std::sort(output.begin(), output.end(), cmp);
Expand Down
Loading

0 comments on commit fb83443

Please sign in to comment.