Simplex_comparator.h
1 /* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2  * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3  * Author(s): Siargey Kachanovich
4  *
5  * Copyright (C) 2019 Inria
6  *
7  * Modification(s):
8  * - YYYY/MM Author: Description of the modification
9  */
10 
11 #ifndef PERMUTAHEDRAL_REPRESENTATION_SIMPLEX_COMPARATOR_H_
12 #define PERMUTAHEDRAL_REPRESENTATION_SIMPLEX_COMPARATOR_H_
13 
14 namespace Gudhi {
15 
16 namespace coxeter_triangulation {
17 
30 template <class Permutahedral_representation_>
36  bool operator()(const Permutahedral_representation_& lhs, const Permutahedral_representation_& rhs) const {
37  if (lhs.vertex() < rhs.vertex()) return true;
38  if (lhs.vertex() > rhs.vertex()) return false;
39 
40  if (lhs.partition().size() > rhs.partition().size()) return true;
41  if (lhs.partition().size() < rhs.partition().size()) return false;
42 
43  if (lhs.partition() < rhs.partition()) return true;
44  if (lhs.partition() > rhs.partition()) return false;
45 
46  return false;
47  }
48 };
49 
50 } // namespace coxeter_triangulation
51 
52 } // namespace Gudhi
53 
54 #endif
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
A comparator class for Permutahedral_representation. The comparison is in lexicographic order first o...
Definition: Simplex_comparator.h:31
bool operator()(const Permutahedral_representation_ &lhs, const Permutahedral_representation_ &rhs) const
Comparison between two permutahedral representations. Both permutahedral representations need to be v...
Definition: Simplex_comparator.h:36