Removed useless iterator usage.

This commit is contained in:
Sébastien Crozet 2013-06-09 12:12:18 +00:00
parent 965601d4e0
commit ffc24de9e0
1 changed files with 3 additions and 9 deletions

View File

@ -49,9 +49,7 @@ macro_rules! test_basis_impl(
|(e1, e2)| { e1 == e2 || e1.dot(e2).approx_eq(&Zero::zero()) }
);
// check vectors form an orthonormal basis
assert!(
do basis.iter().all |e| { e.norm().approx_eq(&One::one()) }
);
assert!(basis.all(|e| e.norm().approx_eq(&One::one())));
}
);
)
@ -65,18 +63,14 @@ macro_rules! test_subspace_basis_impl(
let subbasis = v1.orthogonal_subspace_basis();
// check vectors are orthogonal to v1
assert!(
do subbasis.iter().all |e| { v1.dot(e).approx_eq(&Zero::zero()) }
);
assert!(subbasis.all(|e| v1.dot(e).approx_eq(&Zero::zero())));
// check vectors form an ortogonal basis
assert!(
do subbasis.iter().zip(subbasis.iter()).all
|(e1, e2)| { e1 == e2 || e1.dot(e2).approx_eq(&Zero::zero()) }
);
// check vectors form an orthonormal basis
assert!(
do subbasis.iter().all |e| { e.norm().approx_eq(&One::one()) }
);
assert!(subbasis.all(|e| e.norm().approx_eq(&One::one())));
}
);
)