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

Method new

src/graph/mst/edge.rs:12–17  ·  view source on GitHub ↗
(v: usize, w: usize, weight: f32)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected