mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Simplify assertions
This commit is contained in:
parent
5e5698249b
commit
997a572647
@ -421,7 +421,7 @@ pub fn tridag(a: &[f64], b: &[f64], c: &[f64], r: &[f64], u: &mut [f64], n: usiz
|
|||||||
|
|
||||||
gam = vec![Default::default(); n];
|
gam = vec![Default::default(); n];
|
||||||
|
|
||||||
assert!(b[0] != 0.0);
|
assert_ne!(b[0], 0.0);
|
||||||
/*
|
/*
|
||||||
|
|
||||||
! first pass
|
! first pass
|
||||||
@ -443,7 +443,7 @@ pub fn tridag(a: &[f64], b: &[f64], c: &[f64], r: &[f64], u: &mut [f64], n: usiz
|
|||||||
for j in 1..n {
|
for j in 1..n {
|
||||||
gam[j] = c[j - 1] / bet;
|
gam[j] = c[j - 1] / bet;
|
||||||
bet = b[j] - a[j] * gam[j];
|
bet = b[j] - a[j] * gam[j];
|
||||||
assert!(bet != 0.0);
|
assert_ne!(bet, 0.0);
|
||||||
// Round 0: u[0] = r[0] / b[0]
|
// Round 0: u[0] = r[0] / b[0]
|
||||||
// = r'[0] / b'[0]
|
// = r'[0] / b'[0]
|
||||||
// Round j: u[j] = (r[j] - a[j] * u'[j - 1]) / b'[j]
|
// Round j: u[j] = (r[j] - a[j] * u'[j - 1]) / b'[j]
|
||||||
|
@ -1063,9 +1063,9 @@ fn erode(
|
|||||||
let mut h_stack = vec![Zero::zero(); dh.len()];
|
let mut h_stack = vec![Zero::zero(); dh.len()];
|
||||||
let mut b_stack = vec![Zero::zero(); dh.len()];
|
let mut b_stack = vec![Zero::zero(); dh.len()];
|
||||||
let mut area_stack = vec![Zero::zero(); dh.len()];
|
let mut area_stack = vec![Zero::zero(); dh.len()];
|
||||||
assert!(mstack.len() == dh.len());
|
assert_eq!(mstack.len(), dh.len());
|
||||||
assert!(b.len() == dh.len());
|
assert_eq!(b.len(), dh.len());
|
||||||
assert!(h_t.len() == dh.len());
|
assert_eq!(h_t.len(), dh.len());
|
||||||
let mstack_inv = &mut *mstack_inv;
|
let mstack_inv = &mut *mstack_inv;
|
||||||
mstack.iter().enumerate().for_each(|(stacki, &posi)| {
|
mstack.iter().enumerate().for_each(|(stacki, &posi)| {
|
||||||
let posi = posi as usize;
|
let posi = posi as usize;
|
||||||
@ -1472,7 +1472,7 @@ fn erode(
|
|||||||
.into_par_iter()
|
.into_par_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.for_each(|(posi, (&stacki, h))| {
|
.for_each(|(posi, (&stacki, h))| {
|
||||||
assert!(posi == mstack[stacki] as usize);
|
assert_eq!(posi, mstack[stacki] as usize);
|
||||||
*h = h_stack[stacki];
|
*h = h_stack[stacki];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2270,7 +2270,7 @@ pub fn get_lakes<F: Float>(
|
|||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assert!(rcv != -1);
|
assert_ne!(rcv, -1);
|
||||||
downhill[node] = rcv;
|
downhill[node] = rcv;
|
||||||
tag[node] = Tag::WithRcv;
|
tag[node] = Tag::WithRcv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user