MCPcopy Create free account
hub / github.com/apache/arrow / IsPermutationTrivial

Function IsPermutationTrivial

cpp/src/arrow/extension/tensor_internal.cc:44–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool IsPermutationTrivial(std::span<const int64_t> permutation) {
45 for (size_t i = 1; i < permutation.size(); ++i) {
46 if (permutation[i - 1] + 1 != permutation[i]) {
47 return false;
48 }
49 }
50 return true;
51}
52
53Status IsPermutationValid(std::span<const int64_t> permutation) {
54 const auto size = static_cast<int64_t>(permutation.size());

Callers 2

ExtensionEqualsMethod · 0.85
ExtensionEqualsMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected