MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / degree_histogram_values

Function degree_histogram_values

nodedb-graph/src/csr/statistics.rs:261–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259
260 #[test]
261 fn degree_histogram_values() {
262 let mut csr = CsrIndex::new();
263 csr.add_edge("a", "L", "b").unwrap();
264 csr.add_edge("a", "L", "c").unwrap();
265 csr.add_edge("a", "L", "d").unwrap();
266 csr.add_edge("b", "L", "c").unwrap();
267 csr.compact().expect("no governor, cannot fail");
268
269 let stats = csr.compute_statistics().unwrap();
270 assert_eq!(stats.out_degree_histogram.min, 0);
271 assert_eq!(stats.out_degree_histogram.max, 3);
272 assert!(stats.out_degree_histogram.avg > 0.0);
273 }
274
275 #[test]
276 fn label_edge_count_direct() {

Callers

nothing calls this directly

Calls 4

add_edgeMethod · 0.80
compute_statisticsMethod · 0.80
expectMethod · 0.45
compactMethod · 0.45

Tested by

no test coverage detected