From 1b6a44e8fbd6f2278a9f3b46cf948c964e36cc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Fri, 23 Jan 2015 21:46:49 +0100 Subject: [PATCH] Update to the last rust-nightly. Version of rustc: 1.0.0-nightly (4874ca36f 2015-01-23 00:18:57 +0000). --- Cargo.toml | 2 +- src/linalg/decompositions.rs | 6 +++--- src/structs/dmat.rs | 10 +++++----- src/structs/dvec.rs | 2 +- src/structs/dvec_macros.rs | 4 ++-- src/structs/mat_macros.rs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d2ce9d28..00e9396f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nalgebra" -version = "0.2.0" +version = "0.2.1" authors = [ "Sébastien Crozet " ] # FIXME: add the contributors. description = "Linear algebra library for computer physics, computer graphics and general low-dimensional linear algebra for Rust." diff --git a/src/linalg/decompositions.rs b/src/linalg/decompositions.rs index b4379ee0..fb1033c2 100644 --- a/src/linalg/decompositions.rs +++ b/src/linalg/decompositions.rs @@ -85,11 +85,11 @@ pub fn eigen_qr(m: &M, eps: &N, niter: usize) -> (M, V) // let mut shifter: M = Eye::new_identity(rows); let mut iter = 0us; - for _ in (0 .. niter) { + for _ in (0us .. niter) { let mut stop = true; - for j in (0 .. ::dim::()) { - for i in (0 .. j) { + for j in (0us .. ::dim::()) { + for i in (0us .. j) { if unsafe { eigenvalues.unsafe_at((i, j)) }.abs() >= *eps { stop = false; break; diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index a6241ac7..6046bb79 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -12,7 +12,7 @@ use std::mem; use structs::dvec::DVec; use traits::operations::{Inv, Transpose, Mean, Cov}; use traits::structure::{Cast, ColSlice, RowSlice, Diag, Eye, Indexable, Shape, Zero, One, BaseNum}; -use std::fmt::{Show, Formatter, Result, String}; +use std::fmt::{Show, Debug, Formatter, Result, String}; #[cfg(feature="arbitrary")] use quickcheck::{Arbitrary, Gen}; @@ -133,7 +133,7 @@ impl DMat { DMat { nrows: nrows, ncols: ncols, - mij: (0 .. nrows * ncols).map(|i| { let m = i / nrows; f(i - m * nrows, m) }).collect() + mij: (0us .. nrows * ncols).map(|i| { let m = i / nrows; f(i - m * nrows, m) }).collect() } } @@ -591,7 +591,7 @@ impl Diag> for DMat { assert!(diag.len() == smallest_dim); - for i in (0 .. smallest_dim) { + for i in (0us .. smallest_dim) { unsafe { self.unsafe_set((i, i), diag.unsafe_at(i)) } } } @@ -602,7 +602,7 @@ impl Diag> for DMat { let mut diag: DVec = DVec::new_zeros(smallest_dim); - for i in (0 .. smallest_dim) { + for i in (0us .. smallest_dim) { unsafe { diag.unsafe_set(i, self.unsafe_at((i, i))) } } @@ -634,7 +634,7 @@ impl> ApproxEq for DMat { } } -impl Show for DMat { +impl Debug for DMat { fn fmt(&self, form:&mut Formatter) -> Result { for i in (0us .. self.nrows()) { for j in (0us .. self.ncols()) { diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index e2deb970..fc8b239f 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -58,7 +58,7 @@ impl DVec { /// Builds a vector filled with the result of a function. #[inline(always)] pub fn from_fn N>(dim: usize, mut f: F) -> DVec { - DVec { at: (0 .. dim).map(|i| f(i)).collect() } + DVec { at: (0us .. dim).map(|i| f(i)).collect() } } #[inline] diff --git a/src/structs/dvec_macros.rs b/src/structs/dvec_macros.rs index b43c66e1..bae268c9 100644 --- a/src/structs/dvec_macros.rs +++ b/src/structs/dvec_macros.rs @@ -130,7 +130,7 @@ macro_rules! dvec_impl( fn axpy(&mut self, a: &N, x: &$dvec) { assert!(self.len() == x.len()); - for i in (0 .. x.len()) { + for i in (0us .. x.len()) { unsafe { let self_i = self.unsafe_at(i); self.unsafe_set(i, self_i + *a * x.unsafe_at(i)) @@ -486,7 +486,7 @@ macro_rules! small_dvec_from_impl ( let mut at: [N; $dim] = [ $( $zeros, )* ]; - for i in (0 .. dim) { + for i in (0us .. dim) { at[i] = f(i); } diff --git a/src/structs/mat_macros.rs b/src/structs/mat_macros.rs index 6bf7386d..3ef42886 100644 --- a/src/structs/mat_macros.rs +++ b/src/structs/mat_macros.rs @@ -419,7 +419,7 @@ macro_rules! diag_impl( #[inline] fn set_diag(&mut self, diag: &$tv) { - for i in (0 .. $dim) { + for i in (0us .. $dim) { unsafe { self.unsafe_set((i, i), diag.unsafe_at(i)) } } } @@ -428,7 +428,7 @@ macro_rules! diag_impl( fn diag(&self) -> $tv { let mut diag: $tv = ::zero(); - for i in (0 .. $dim) { + for i in (0us .. $dim) { unsafe { diag.unsafe_set(i, self.unsafe_at((i, i))) } }