Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clang-format, clang-tidy and clangd support for C++ development #2541

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Autofix
  • Loading branch information
No Author authored and texodus committed Feb 24, 2024
commit 764094660c8ac2c5e1d554470d0dd8a19bb7aa60
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
Loading