use indexmap::IndexMap;
use super::Stat;
use crate::DiHypergraph;
pub fn di_edge_size<N, E, M>(d: &DiHypergraph<N, E, M>) -> Stat<usize> {
let mut out: IndexMap<String, usize> = IndexMap::new();
for eid in d.edge_ids() {
let sz = d.size(&eid);
out.insert(eid, sz);
}
Stat::new(out)
}
pub fn di_edge_order<N, E, M>(d: &DiHypergraph<N, E, M>) -> Stat<usize> {
let mut out: IndexMap<String, usize> = IndexMap::new();
for eid in d.edge_ids() {
let ord = d.order(&eid);
out.insert(eid, ord);
}
Stat::new(out)
}
pub fn di_head_size<N, E, M>(d: &DiHypergraph<N, E, M>) -> Stat<usize> {
let mut out: IndexMap<String, usize> = IndexMap::new();
for eid in d.edge_ids() {
let sz = d.head_size(&eid);
out.insert(eid, sz);
}
Stat::new(out)
}
pub fn di_tail_size<N, E, M>(d: &DiHypergraph<N, E, M>) -> Stat<usize> {
let mut out: IndexMap<String, usize> = IndexMap::new();
for eid in d.edge_ids() {
let sz = d.tail_size(&eid);
out.insert(eid, sz);
}
Stat::new(out)
}