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