MCPcopy Create free account
hub / github.com/PX4/eigen / is_sorted

Function is_sorted

test/sparse_permutations.cpp:23–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22template<typename T>
23bool is_sorted(const T& mat) {
24 for(Index k = 0; k<mat.outerSize(); ++k)
25 {
26 Index prev = -1;
27 for(typename T::InnerIterator it(mat,k); it; ++it)
28 {
29 if(prev>=it.index())
30 return false;
31 prev = it.index();
32 }
33 }
34 return true;
35}
36
37template<typename T>
38typename internal::nested_eval<T,1>::type eval(const T &xpr)

Callers 1

sparse_permutationsFunction · 0.85

Calls 2

outerSizeMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected