Skip to content

Commit

Permalink
Feature-gate the VecN structure.
Browse files Browse the repository at this point in the history
`rustc` is has a hard time compiling it from time to time.
  • Loading branch information
sebcrozet committed Mar 24, 2016
1 parent b4c6c99 commit 60c0f32
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased] [0.6.0]
### Added
* Dependency to [generic-array](https://crates.io/crates/generic-array)
* Staticly sized vectors with user-defined sizes: `VecN`.
* (feature=generic_sizes): Dependency to [generic-array](https://crates.io/crates/generic-array)
* (feature=ganedic_sizes): Staticly sized vectors with user-defined sizes: `VecN`.
* Similarity transformations (an uniform scale followed by a rotation followed
by a translation): `Sim2`, `Sim3`.

Expand Down
15 changes: 11 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ path = "src/lib.rs"
[features]
# Generate arbitrary instances of nalgebra types for testing with quickcheck
arbitrary = [ "quickcheck" ]
generic_sizes = [ "generic-array", "typenum" ]

[dependencies]
rustc-serialize = "0.3.*"
rand = "0.3.*"
num = "0.1.*"
generic-array = "0.2.*"
typenum = "1.3.*"
num = "0.1.*"

[dependencies.generic-array]
optional = true
version = "0.2.*"

[dependencies.typenum]
optional = true
version = "1.3.*"

[dependencies.quickcheck]
optional = true
version = "0.2.*"
version = "0.2.*"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn main() {
an optimized set of tools for computer graphics and physics. Those features include:

* Vectors with predefined static sizes: `Vec1`, `Vec2`, `Vec3`, `Vec4`, `Vec5`, `Vec6`.
* Vector with a user-defined static size: `VecN`.
* Vector with a user-defined static size: `VecN` (available only with the `generic_sizes` feature).
* Points with static sizes: `Pnt1`, `Pnt2`, `Pnt3`, `Pnt4`, `Pnt5`, `Pnt6`.
* Square matrices with static sizes: `Mat1`, `Mat2`, `Mat3`, `Mat4`, `Mat5`, `Mat6 `.
* Rotation matrices: `Rot2`, `Rot3`
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() {
an optimized set of tools for computer graphics and physics. Those features include:
* Vectors with predefined static sizes: `Vec1`, `Vec2`, `Vec3`, `Vec4`, `Vec5`, `Vec6`.
* Vector with a user-defined static size: `VecN`.
* Vector with a user-defined static size: `VecN` (available only with the `generic_sizes` feature).
* Points with static sizes: `Pnt1`, `Pnt2`, `Pnt3`, `Pnt4`, `Pnt5`, `Pnt6`.
* Square matrices with static sizes: `Mat1`, `Mat2`, `Mat3`, `Mat4`, `Mat5`, `Mat6 `.
* Rotation matrices: `Rot2`, `Rot3`
Expand Down Expand Up @@ -78,6 +78,8 @@ Feel free to add your project to this list if you happen to use **nalgebra**!
extern crate rustc_serialize;
extern crate rand;
extern crate num;

#[cfg(feature="generic_sizes")]
extern crate generic_array;

#[cfg(feature="arbitrary")]
Expand Down Expand Up @@ -136,6 +138,9 @@ pub use traits::{
UniformSphereSample
};

#[cfg(feature="generic_sizes")]
pub use structs::VecN;

pub use structs::{
Identity,
DMat, DMat1, DMat2, DMat3, DMat4, DMat5, DMat6,
Expand All @@ -145,7 +150,7 @@ pub use structs::{
Mat1, Mat2, Mat3, Mat4,
Mat5, Mat6,
Rot2, Rot3,
VecN, Vec1, Vec2, Vec3, Vec4, Vec5, Vec6,
Vec1, Vec2, Vec3, Vec4, Vec5, Vec6,
Pnt1, Pnt2, Pnt3, Pnt4, Pnt5, Pnt6,
Persp3, PerspMat3,
Ortho3, OrthoMat3,
Expand Down
5 changes: 4 additions & 1 deletion src/structs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pub use self::dmat::{DMat, DMat1, DMat2, DMat3, DMat4, DMat5, DMat6};
pub use self::dvec::{DVec, DVec1, DVec2, DVec3, DVec4, DVec5, DVec6};
pub use self::vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6};
pub use self::vecn::VecN;
pub use self::pnt::{Pnt1, Pnt2, Pnt3, Pnt4, Pnt5, Pnt6};
pub use self::mat::{Identity, Mat1, Mat2, Mat3, Mat4, Mat5, Mat6};
pub use self::rot::{Rot2, Rot3};
Expand All @@ -13,9 +12,13 @@ pub use self::persp::{Persp3, PerspMat3};
pub use self::ortho::{Ortho3, OrthoMat3};
pub use self::quat::{Quat, UnitQuat};

#[cfg(feature="generic_sizes")]
pub use self::vecn::VecN;

mod dmat_macros;
mod dmat;
mod vecn_macros;
#[cfg(feature="generic_sizes")]
mod vecn;
mod dvec_macros;
mod dvec;
Expand Down

0 comments on commit 60c0f32

Please sign in to comment.