From 0577f3e364270f90b0f76dc74b7b8ca461e9930a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Mon, 22 Jul 2013 13:44:08 +0200 Subject: [PATCH] Add type aliases. --- .gitignore | 1 + src/nalgebra.rc | 2 + src/types.rs | 130 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 src/types.rs diff --git a/.gitignore b/.gitignore index cc67d9ea..72e129b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp *.html lib +TODO diff --git a/src/nalgebra.rc b/src/nalgebra.rc index aa19932f..5c959b40 100644 --- a/src/nalgebra.rc +++ b/src/nalgebra.rc @@ -30,6 +30,8 @@ pub mod adaptors pub mod transform; } +pub mod types; + pub mod num { pub use traits::dim::*; diff --git a/src/types.rs b/src/types.rs new file mode 100644 index 00000000..52142663 --- /dev/null +++ b/src/types.rs @@ -0,0 +1,130 @@ +use vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; +use mat::{Mat1, Mat2, Mat3, Mat4, Mat5, Mat6}; +use adaptors::rotmat::Rotmat; +use adaptors::transform::Transform; + +// 1D +pub type Vec1f64 = Vec1; +pub type Vec1f32 = Vec1; +pub type Vec1flt = Vec1; + +pub type Mat1f64 = Mat1; +pub type Mat1f32 = Mat1; +pub type Mat1flt = Mat1; + +pub type Rot1f64 = Rotmat>; +pub type Rot1f32 = Rotmat>; +pub type Rot1flt = Rotmat>; + +pub type Iso1f64 = Transform; +pub type Iso1f32 = Transform; +pub type Iso1flt = Transform; + +pub type Aff1f64 = Transform; +pub type Aff1f32 = Transform; +pub type Aff1flt = Transform; + +// 2D +pub type Vec2f64 = Vec2; +pub type Vec2f32 = Vec2; +pub type Vec2flt = Vec2; + +pub type Mat2f64 = Mat2; +pub type Mat2f32 = Mat2; +pub type Mat2flt = Mat2; + +pub type Rot2f64 = Rotmat>; +pub type Rot2f32 = Rotmat>; +pub type Rot2flt = Rotmat>; + +pub type Iso2f64 = Transform; +pub type Iso2f32 = Transform; +pub type Iso2flt = Transform; + +pub type Aff2f64 = Transform; +pub type Aff2f32 = Transform; +pub type Aff2flt = Transform; + +// 3D +pub type Vec3f64 = Vec3; +pub type Vec3f32 = Vec3; +pub type Vec3flt = Vec3; + +pub type Mat3f64 = Mat3; +pub type Mat3f32 = Mat3; +pub type Mat3flt = Mat3; + +pub type Rot3f64 = Rotmat>; +pub type Rot3f32 = Rotmat>; +pub type Rot3flt = Rotmat>; + +pub type Iso3f64 = Transform; +pub type Iso3f32 = Transform; +pub type Iso3flt = Transform; + +pub type Aff3f64 = Transform; +pub type Aff3f32 = Transform; +pub type Aff3flt = Transform; + +// 4D +pub type Vec4f64 = Vec4; +pub type Vec4f32 = Vec4; +pub type Vec4flt = Vec4; + +pub type Mat4f64 = Mat4; +pub type Mat4f32 = Mat4; +pub type Mat4flt = Mat4; + +pub type Rot4f64 = Rotmat>; +pub type Rot4f32 = Rotmat>; +pub type Rot4flt = Rotmat>; + +pub type Iso4f64 = Transform; +pub type Iso4f32 = Transform; +pub type Iso4flt = Transform; + +pub type Aff4f64 = Transform; +pub type Aff4f32 = Transform; +pub type Aff4flt = Transform; + +// 5D +pub type Vec5f64 = Vec5; +pub type Vec5f32 = Vec5; +pub type Vec5flt = Vec5; + +pub type Mat5f64 = Mat5; +pub type Mat5f32 = Mat5; +pub type Mat5flt = Mat5; + +pub type Rot5f64 = Rotmat>; +pub type Rot5f32 = Rotmat>; +pub type Rot5flt = Rotmat>; + +pub type Iso5f64 = Transform; +pub type Iso5f32 = Transform; +pub type Iso5flt = Transform; + +pub type Aff5f64 = Transform; +pub type Aff5f32 = Transform; +pub type Aff5flt = Transform; + +// 6D +pub type Vec6f64 = Vec6; +pub type Vec6f32 = Vec6; +pub type Vec6flt = Vec6; + +pub type Mat6f64 = Mat6; +pub type Mat6f32 = Mat6; +pub type Mat6flt = Mat6; + +pub type Rot6f64 = Rotmat>; +pub type Rot6f32 = Rotmat>; +pub type Rot6flt = Rotmat>; + +pub type Iso6f64 = Transform; +pub type Iso6f32 = Transform; +pub type Iso6flt = Transform; + +pub type Aff6f64 = Transform; +pub type Aff6f32 = Transform; +pub type Aff6flt = Transform;