Rust rustfmt
This commit is contained in:
parent
9ef1acacd8
commit
c1b4498a65
11
src/lib.rs
11
src/lib.rs
@ -538,10 +538,11 @@ fn test_step5() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_solve() {
|
fn test_solve() {
|
||||||
let c = vec![250, 400, 350, // row 1
|
let c = vec![
|
||||||
400, 600, 350, // row 2
|
250, 400, 350, // row 1
|
||||||
200, 400, 250 // row 3
|
400, 600, 350, // row 2
|
||||||
];
|
200, 400, 250, // row 3
|
||||||
|
];
|
||||||
|
|
||||||
let mut weights: WeightMatrix<i32> = WeightMatrix::from_row_vec(3, c);
|
let mut weights: WeightMatrix<i32> = WeightMatrix::from_row_vec(3, c);
|
||||||
let matching = solve_assignment(&mut weights).unwrap();
|
let matching = solve_assignment(&mut weights).unwrap();
|
||||||
@ -607,7 +608,7 @@ fn test_solve_equal_rows2() {
|
|||||||
fn test_solve_equal_rows5() {
|
fn test_solve_equal_rows5() {
|
||||||
const N: usize = 5;
|
const N: usize = 5;
|
||||||
let c = vec![
|
let c = vec![
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut weights: WeightMatrix<u32> = WeightMatrix::from_row_vec(N, c.clone());
|
let mut weights: WeightMatrix<u32> = WeightMatrix::from_row_vec(N, c.clone());
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
use crate::SquareMatrix;
|
||||||
use crate::WeightNum;
|
use crate::WeightNum;
|
||||||
use crate::Weights;
|
use crate::Weights;
|
||||||
use crate::SquareMatrix;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct WeightMatrix<T: WeightNum> {
|
pub struct WeightMatrix<T: WeightNum> {
|
||||||
|
Loading…
Reference in New Issue
Block a user