commit
bbf5ed17e4
|
@ -12,7 +12,7 @@ use std::mem;
|
||||||
use structs::dvec::DVec;
|
use structs::dvec::DVec;
|
||||||
use traits::operations::{Inv, Transpose, Mean, Cov};
|
use traits::operations::{Inv, Transpose, Mean, Cov};
|
||||||
use traits::structure::{Cast, ColSlice, RowSlice, Diag, Eye, Indexable, Shape, Zero, One, BaseNum};
|
use traits::structure::{Cast, ColSlice, RowSlice, Diag, Eye, Indexable, Shape, Zero, One, BaseNum};
|
||||||
use std::fmt::{Show, Debug, Formatter, Result, String};
|
use std::fmt::{Debug, Display, Formatter, Result};
|
||||||
#[cfg(feature="arbitrary")]
|
#[cfg(feature="arbitrary")]
|
||||||
use quickcheck::{Arbitrary, Gen};
|
use quickcheck::{Arbitrary, Gen};
|
||||||
|
|
||||||
|
@ -634,7 +634,7 @@ impl<N: ApproxEq<N>> ApproxEq<N> for DMat<N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<N: Show + Copy + String> Debug for DMat<N> {
|
impl<N: Debug + Copy + Display> Debug for DMat<N> {
|
||||||
fn fmt(&self, form:&mut Formatter) -> Result {
|
fn fmt(&self, form:&mut Formatter) -> Result {
|
||||||
for i in (0us .. self.nrows()) {
|
for i in (0us .. self.nrows()) {
|
||||||
for j in (0us .. self.ncols()) {
|
for j in (0us .. self.ncols()) {
|
||||||
|
|
|
@ -127,7 +127,7 @@ fn test_inv_mat6() {
|
||||||
fn test_rotation2() {
|
fn test_rotation2() {
|
||||||
for _ in (0us .. 10000) {
|
for _ in (0us .. 10000) {
|
||||||
let randmat: na::Rot2<f64> = na::one();
|
let randmat: na::Rot2<f64> = na::one();
|
||||||
let ang = Vec1::new(na::abs(&random::<f64>()) % BaseFloat::pi());
|
let ang = Vec1::new(na::abs(&random::<f64>()) % <f64 as BaseFloat>::pi());
|
||||||
|
|
||||||
assert!(na::approx_eq(&na::rotation(&na::append_rotation(&randmat, &ang)), &ang));
|
assert!(na::approx_eq(&na::rotation(&na::append_rotation(&randmat, &ang)), &ang));
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ fn test_inv_rotation3() {
|
||||||
for _ in (0us .. 10000) {
|
for _ in (0us .. 10000) {
|
||||||
let randmat: Rot3<f64> = na::one();
|
let randmat: Rot3<f64> = na::one();
|
||||||
let dir: Vec3<f64> = random();
|
let dir: Vec3<f64> = random();
|
||||||
let ang = na::normalize(&dir) * (na::abs(&random::<f64>()) % BaseFloat::pi());
|
let ang = na::normalize(&dir) * (na::abs(&random::<f64>()) % <f64 as BaseFloat>::pi());
|
||||||
let rot = na::append_rotation(&randmat, &ang);
|
let rot = na::append_rotation(&randmat, &ang);
|
||||||
|
|
||||||
assert!(na::approx_eq(&(na::transpose(&rot) * rot), &na::one()));
|
assert!(na::approx_eq(&(na::transpose(&rot) * rot), &na::one()));
|
||||||
|
|
Loading…
Reference in New Issue