From 2a4807262ad8ad6904eaba64bb8a126ba689a379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 8 Oct 2013 21:00:45 +0200 Subject: [PATCH] Re-export the Identity type properly. --- src/na.rs | 17 +++++++++++++++++ src/structs/mod.rs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/na.rs b/src/na.rs index 81d16a35..d96e7cb2 100644 --- a/src/na.rs +++ b/src/na.rs @@ -39,6 +39,7 @@ pub use traits::{ }; pub use structs::{ + Identity, DMat, DVec, Iso2, Iso3, Iso4, Mat1, Mat2, Mat3, Mat4, @@ -52,6 +53,15 @@ pub use structs::{ // Constructors // // + +/// Create a special identity object. +/// +/// Same as `Identity::new()`. +#[inline(always)] +pub fn identity() -> Identity { + Identity::new() +} + /// Create a zero-valued value. /// /// This is the same as `std::num::Zero::zero()`. @@ -746,6 +756,13 @@ pub fn orthonormal_subspace_basis(v: &V, f: &fn(V) -> bool) { /* * Dim */ +/// Gets the dimension an object lives in. +/// +/// Same as `Dim::dim::(None::)`. +#[inline(always)] +pub fn dim() -> uint { + Dim::dim(None::) +} /* * Indexable diff --git a/src/structs/mod.rs b/src/structs/mod.rs index b1628daa..e0edd39d 100644 --- a/src/structs/mod.rs +++ b/src/structs/mod.rs @@ -3,7 +3,7 @@ pub use self::dmat::DMat; pub use self::dvec::DVec; pub use self::vec::{Vec0, Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; -pub use self::mat::{Mat1, Mat2, Mat3, Mat4, Mat5, Mat6}; +pub use self::mat::{Identity, Mat1, Mat2, Mat3, Mat4, Mat5, Mat6}; pub use self::rot::{Rot2, Rot3, Rot4}; pub use self::iso::{Iso2, Iso3, Iso4};