| 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); |
no test coverage detected