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

Function cpm

tests/test_shortest_paths.rs:135–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133
134#[test]
135fn cpm() {
136 use std::convert::TryFrom;
137 let i = JOBS_PC;
138 let cpm = CPM::try_from(i).unwrap();
139 assert_eq!(173.0, cpm.finish_time());
140
141 /*
142 job start finish
143 --------------------
144 0 0.0 41.0
145 1 41.0 92.0
146 2 123.0 173.0
147 3 91.0 127.0
148 4 70.0 108.0
149 5 0.0 45.0
150 6 70.0 91.0
151 7 41.0 73.0
152 8 91.0 123.0
153 9 41.0 70.0
154 Finish time: 173.0
155 */
156 println!(" job start finish");
157 println!("--------------------");
158 let n = cpm.len();
159 for i in 0..n {
160 println!("{:>4} {:7.1} {:7.1}", i, cpm.dist_to(i), cpm.dist_to(i + n));
161 }
162 println!("Finish time: {:7.1}", cpm.finish_time());
163}
164
165#[allow(non_snake_case)]
166#[test]

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected