Update to the last Rust.

Version of rustc: 0.10-pre (b8ef9fd 2014-03-31 15:51:33 -0700)

struct fields are now public by default.
This commit is contained in:
Sébastien Crozet 2014-04-01 22:58:06 +02:00
parent 1edecbcee4
commit 06e18d214a
14 changed files with 76 additions and 76 deletions

View File

@ -98,16 +98,16 @@ Feel free to add your project to this list if you happen to use **nalgebra**!
* [frog](https://github.com/natal/frog): a machine learning library.
*/
#[crate_id = "nalgebra#0.1"];
#[crate_type = "lib"];
#[deny(non_camel_case_types)];
#[deny(unnecessary_parens)];
#[deny(non_uppercase_statics)];
#[deny(unnecessary_qualification)];
#[deny(unused_result)];
#[warn(missing_doc)];
#[feature(macro_rules)];
#[doc(html_root_url = "http://www.rust-ci.org/sebcrozet/nalgebra/doc")];
#![crate_id = "nalgebra#0.1"]
#![crate_type = "lib"]
#![deny(non_camel_case_types)]
#![deny(unnecessary_parens)]
#![deny(non_uppercase_statics)]
#![deny(unnecessary_qualification)]
#![deny(unused_result)]
#![warn(missing_doc)]
#![feature(macro_rules)]
#![doc(html_root_url = "http://www.rust-ci.org/sebcrozet/nalgebra/doc")]
extern crate std;
extern crate rand;

View File

@ -1,6 +1,6 @@
//! Matrix with dimensions unknown at compile-time.
#[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait.
#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait.
use rand::Rand;
use rand;
@ -17,9 +17,9 @@ mod metal;
/// Matrix with dimensions unknown at compile-time.
#[deriving(TotalEq, Eq, Clone)]
pub struct DMat<N> {
priv nrows: uint,
priv ncols: uint,
priv mij: Vec<N>
nrows: uint,
ncols: uint,
mij: Vec<N>
}
double_dispatch_binop_decl_trait!(DMat, DMatMulRhs)

View File

@ -1,6 +1,6 @@
//! Vector with dimensions unknown at compile-time.
#[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait.
#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait.
use std::num::{Zero, One, Float};
use rand::Rand;
@ -18,7 +18,7 @@ mod metal;
#[deriving(TotalEq, Eq, Show, Clone)]
pub struct DVec<N> {
/// Components of the vector. Contains as much elements as the vector dimension.
at: Vec<N>
pub at: Vec<N>
}
double_dispatch_binop_decl_trait!(DVec, DVecMulRhs)
@ -161,7 +161,7 @@ impl<N> IterableMut<N> for DVec<N> {
impl<N> FromIterator<N> for DVec<N> {
#[inline]
fn from_iterator<I: Iterator<N>>(mut param: I) -> DVec<N> {
fn from_iter<I: Iterator<N>>(mut param: I) -> DVec<N> {
let mut res = DVec { at: Vec::new() };
for e in param {

View File

@ -1,6 +1,6 @@
//! Isometric transformations.
#[allow(missing_doc)];
#![allow(missing_doc)]
use std::num::{Zero, One};
use rand::{Rand, Rng};

View File

@ -1,4 +1,4 @@
#[macro_escape];
#![macro_escape]
macro_rules! iso_impl(
($t: ident, $submat: ident, $subvec: ident, $subrotvec: ident) => (

View File

@ -1,6 +1,6 @@
//! Matrices with dimensions known at compile-time.
#[allow(missing_doc)]; // we allow missing to avoid having to document the mij components.
#![allow(missing_doc)] // we allow missing to avoid having to document the mij components.
use std::cast;
use std::num::{One, Zero};
@ -31,7 +31,7 @@ impl Identity {
/// Square matrix of dimension 1.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat1<N> {
m11: N
pub m11: N
}
double_dispatch_binop_decl_trait!(Mat1, Mat1MulRhs)
@ -123,8 +123,8 @@ outer_impl!(Vec1, Mat1)
/// Square matrix of dimension 2.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat2<N> {
m11: N, m21: N,
m12: N, m22: N
pub m11: N, pub m21: N,
pub m12: N, pub m22: N
}
double_dispatch_binop_decl_trait!(Mat2, Mat2MulRhs)
@ -220,9 +220,9 @@ outer_impl!(Vec2, Mat2)
/// Square matrix of dimension 3.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat3<N> {
m11: N, m21: N, m31: N,
m12: N, m22: N, m32: N,
m13: N, m23: N, m33: N
pub m11: N, pub m21: N, pub m31: N,
pub m12: N, pub m22: N, pub m32: N,
pub m13: N, pub m23: N, pub m33: N
}
double_dispatch_binop_decl_trait!(Mat3, Mat3MulRhs)
@ -331,10 +331,10 @@ outer_impl!(Vec3, Mat3)
/// Square matrix of dimension 4.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat4<N> {
m11: N, m21: N, m31: N, m41: N,
m12: N, m22: N, m32: N, m42: N,
m13: N, m23: N, m33: N, m43: N,
m14: N, m24: N, m34: N, m44: N
pub m11: N, pub m21: N, pub m31: N, pub m41: N,
pub m12: N, pub m22: N, pub m32: N, pub m42: N,
pub m13: N, pub m23: N, pub m33: N, pub m43: N,
pub m14: N, pub m24: N, pub m34: N, pub m44: N
}
double_dispatch_binop_decl_trait!(Mat4, Mat4MulRhs)
@ -494,11 +494,11 @@ outer_impl!(Vec4, Mat4)
/// Square matrix of dimension 5.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat5<N> {
m11: N, m21: N, m31: N, m41: N, m51: N,
m12: N, m22: N, m32: N, m42: N, m52: N,
m13: N, m23: N, m33: N, m43: N, m53: N,
m14: N, m24: N, m34: N, m44: N, m54: N,
m15: N, m25: N, m35: N, m45: N, m55: N
pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N,
pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N,
pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N,
pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N,
pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N
}
double_dispatch_binop_decl_trait!(Mat5, Mat5MulRhs)
@ -673,12 +673,12 @@ outer_impl!(Vec5, Mat5)
/// Square matrix of dimension 6.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Mat6<N> {
m11: N, m21: N, m31: N, m41: N, m51: N, m61: N,
m12: N, m22: N, m32: N, m42: N, m52: N, m62: N,
m13: N, m23: N, m33: N, m43: N, m53: N, m63: N,
m14: N, m24: N, m34: N, m44: N, m54: N, m64: N,
m15: N, m25: N, m35: N, m45: N, m55: N, m65: N,
m16: N, m26: N, m36: N, m46: N, m56: N, m66: N
pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N, pub m61: N,
pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N, pub m62: N,
pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N, pub m63: N,
pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N, pub m64: N,
pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N, pub m65: N,
pub m16: N, pub m26: N, pub m36: N, pub m46: N, pub m56: N, pub m66: N
}
double_dispatch_binop_decl_trait!(Mat6, Mat6MulRhs)

View File

@ -1,4 +1,4 @@
#[macro_escape];
#![macro_escape]
macro_rules! mat_impl(
($t: ident, $comp0: ident $(,$compN: ident)*) => (

View File

@ -1,6 +1,6 @@
#[macro_escape];
#![macro_escape]
#[doc(hidden)]; // we hide doc to not have to document the $trhs double dispatch trait.
#![doc(hidden)] // we hide doc to not have to document the $trhs double dispatch trait.
// Create the traits needed to do fancy operator oveloading.
// This is a meta version of

View File

@ -1,6 +1,6 @@
//! Rotations matrices.
#[allow(missing_doc)];
#![allow(missing_doc)]
use std::num::{Zero, One};
use rand::{Rand, Rng};
@ -17,7 +17,7 @@ mod rot_macros;
/// Two dimensional rotation matrix.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)]
pub struct Rot2<N> {
priv submat: Mat2<N>
submat: Mat2<N>
}
impl<N: Clone + Float + Neg<N>> Rot2<N> {
@ -95,7 +95,7 @@ impl<N: Signed> AbsoluteRotate<Vec2<N>> for Rot2<N> {
/// Three dimensional rotation matrix.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)]
pub struct Rot3<N> {
priv submat: Mat3<N>
submat: Mat3<N>
}
@ -266,7 +266,7 @@ impl<N: Signed> AbsoluteRotate<Vec3<N>> for Rot3<N> {
/// Four dimensional rotation matrix.
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)]
pub struct Rot4<N> {
priv submat: Mat4<N>
submat: Mat4<N>
}
// impl<N> Rot4<N> {

View File

@ -1,4 +1,4 @@
#[macro_escape];
#![macro_escape]
macro_rules! submat_impl(
($t: ident, $submat: ident) => (

View File

@ -1,7 +1,7 @@
//! nalgebra trait implementation for primitive types.
#[allow(missing_doc)];
#[allow(non_camel_case_types)];
#![allow(missing_doc)]
#![allow(non_camel_case_types)]
use traits::structure::Cast;

View File

@ -207,7 +207,7 @@ impl<N: One> One for vec::Vec0<N> {
impl<N> FromIterator<N> for vec::Vec0<N> {
#[inline]
fn from_iterator<I: Iterator<N>>(_: I) -> vec::Vec0<N> {
fn from_iter<I: Iterator<N>>(_: I) -> vec::Vec0<N> {
vec::Vec0
}
}

View File

@ -1,6 +1,6 @@
//! Vectors with dimensions known at compile-time.
#[allow(missing_doc)]; // we allow missing to avoid having to document the vector components.
#![allow(missing_doc)] // we allow missing to avoid having to document the vector components.
use std::cast;
use std::num::{Zero, One, Float, Bounded};
@ -23,7 +23,7 @@ pub struct Vec0<N>;
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec1<N> {
/// First component of the vector.
x: N
pub x: N
}
double_dispatch_binop_decl_trait!(Vec1, Vec1MulRhs)
@ -119,9 +119,9 @@ transform_impl!(Vec1)
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec2<N> {
/// First component of the vector.
x: N,
pub x: N,
/// Second component of the vector.
y: N
pub y: N
}
double_dispatch_binop_decl_trait!(Vec2, Vec2MulRhs)
@ -217,11 +217,11 @@ transform_impl!(Vec2)
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec3<N> {
/// First component of the vector.
x: N,
pub x: N,
/// Second component of the vector.
y: N,
pub y: N,
/// Third component of the vector.
z: N
pub z: N
}
double_dispatch_binop_decl_trait!(Vec3, Vec3MulRhs)
@ -321,13 +321,13 @@ transform_impl!(Vec3)
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec4<N> {
/// First component of the vector.
x: N,
pub x: N,
/// Second component of the vector.
y: N,
pub y: N,
/// Third component of the vector.
z: N,
pub z: N,
/// Fourth component of the vector.
w: N
pub w: N
}
double_dispatch_binop_decl_trait!(Vec4, Vec4MulRhs)
@ -423,15 +423,15 @@ transform_impl!(Vec4)
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec5<N> {
/// First component of the vector.
x: N,
pub x: N,
/// Second component of the vector.
y: N,
pub y: N,
/// Third component of the vector.
z: N,
pub z: N,
/// Fourth component of the vector.
w: N,
pub w: N,
/// Fifth of the vector.
a: N
pub a: N
}
double_dispatch_binop_decl_trait!(Vec5, Vec5MulRhs)
@ -527,17 +527,17 @@ transform_impl!(Vec5)
#[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)]
pub struct Vec6<N> {
/// First component of the vector.
x: N,
pub x: N,
/// Second component of the vector.
y: N,
pub y: N,
/// Third component of the vector.
z: N,
pub z: N,
/// Fourth component of the vector.
w: N,
pub w: N,
/// Fifth of the vector.
a: N,
pub a: N,
/// Sixth component of the vector.
b: N
pub b: N
}
double_dispatch_binop_decl_trait!(Vec6, Vec6MulRhs)

View File

@ -1,4 +1,4 @@
#[macro_escape];
#![macro_escape]
macro_rules! new_impl(
($t: ident, $comp0: ident $(,$compN: ident)*) => (
@ -560,7 +560,7 @@ macro_rules! from_iterator_impl(
($t: ident, $param0: ident $(, $paramN: ident)*) => (
impl<N> FromIterator<N> for $t<N> {
#[inline]
fn from_iterator<I: Iterator<N>>(mut $param0: I) -> $t<N> {
fn from_iter<I: Iterator<N>>(mut $param0: I) -> $t<N> {
$t::new($param0.next().unwrap() $(, $paramN.next().unwrap())*)
}
}