X-Git-Url: https://i11git.iti.kit.edu/anon-gitweb/?p=Mitarbeiter%2FTim-Zeitz%2Fstud-rust-base.git;a=blobdiff_plain;f=src%2Ftypes.rs;h=03d28f1c73fc2086070171a03632b24c4aad08b6;hp=b10ba13729e1571c2f518330c54359f230b85083;hb=b52fc015957bcfa65d2e8fbb8d4ea44f4923e3a8;hpb=56149781fe0423d57676003b7c42698d295bb279 diff --git a/src/types.rs b/src/types.rs index b10ba13..03d28f1 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,6 +1,12 @@ +//! This module contains a few basic type and constant definitions + use std; +/// Node ids are unsigned 32 bit integers pub type NodeId = u32; +/// Edge ids are unsigned 32 bit integers pub type EdgeId = u32; +/// Edge weights are unsigned 32 bit integers pub type Weight = u32; +/// The `INFINITY` weight is defined so that the check `INFINITY + INFINITY < INFINITY` does not cause any overflows pub const INFINITY: Weight = std::u32::MAX / 2;