MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / compare

Function compare

src/ifcgeom/taxonomy.cpp:26–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25 template <typename T>
26 bool compare(const eigen_base<T>& t, const eigen_base<T>& u) {
27 if (t.components_ == nullptr && u.components_ == nullptr) {
28 return false;
29 }
30 else if (t.components_ == nullptr && u.components_ != nullptr) {
31 return true;
32 }
33 else if (t.components_ != nullptr && u.components_ == nullptr) {
34 return false;
35 }
36
37 auto t_begin = t.components_->data();
38 auto t_end = t.components_->data() + t.components_->size();
39
40 auto u_begin = u.components_->data();
41 auto u_end = u.components_->data() + u.components_->size();
42
43 return std::lexicographical_compare(t_begin, t_end, u_begin, u_end);
44 }
45
46 bool compare(const line& a, const line& b) {
47 return compare(*a.matrix, *b.matrix);

Callers 3

less_to_orderFunction · 0.85
dispatchMethod · 0.85
compare_collectionFunction · 0.85

Calls 5

less_to_orderFunction · 0.85
dataMethod · 0.80
beginFunction · 0.70
endFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected