MCPcopy Create free account
hub / github.com/douchuan/algorithm / new

Method new

src/graph/shortest/directed_edge.rs:11–16  ·  view source on GitHub ↗
(v: usize, w: usize, weight: f32)

Source from the content-addressed store, hash-verified

9
10impl DirectedEdge {
11 pub fn new(v: usize, w: usize, weight: f32) -> Self {
12 if weight.is_nan() {
13 panic!("Weight is NaN");
14 }
15 Self { v, w, weight }
16 }
17
18 pub fn weight(&self) -> f32 {
19 self.weight

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected