Loading...
Searching...
No Matches
Simplex_comparator.h
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Siargey Kachanovich
*
* Copyright (C) 2019 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/
#ifndef PERMUTAHEDRAL_REPRESENTATION_SIMPLEX_COMPARATOR_H_
#define PERMUTAHEDRAL_REPRESENTATION_SIMPLEX_COMPARATOR_H_
namespace Gudhi {
namespace coxeter_triangulation {
template <class Permutahedral_representation_>
struct Simplex_comparator {
bool operator()(const Permutahedral_representation_& lhs, const Permutahedral_representation_& rhs) const {
if (lhs.vertex() < rhs.vertex()) return true;
if (lhs.vertex() > rhs.vertex()) return false;
if (lhs.partition().size() > rhs.partition().size()) return true;
if (lhs.partition().size() < rhs.partition().size()) return false;
if (lhs.partition() < rhs.partition()) return true;
if (lhs.partition() > rhs.partition()) return false;
return false;
}
};
} // namespace coxeter_triangulation
} // namespace Gudhi
#endif
Gudhi
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Gudhi::coxeter_triangulation::Simplex_comparator
A comparator class for Permutahedral_representation. The comparison is in lexicographic order first o...
Definition Simplex_comparator.h:31
Gudhi::coxeter_triangulation::Simplex_comparator::operator()
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