1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
impl<V, HE> Hypergraph<V, HE>
where
V: VertexTrait,
HE: HyperedgeTrait,
{
pub(crate) fn get_hyperedge(
&self,
hyperedge_index: usize,
) -> Result<HyperedgeIndex, HypergraphError<V, HE>> {
match self.hyperedges_mapping.left.get(&hyperedge_index) {
Some(index) => Ok(*index),
None => Err(HypergraphError::InternalHyperedgeIndexNotFound(
hyperedge_index,
)),
}
}
}