Merged the {vec, mat} and {vec, mat}_impl modules.

This commit is contained in:
Sébastien Crozet 2013-07-22 11:35:36 +02:00
parent ff24f70332
commit 3a64e05c62
4 changed files with 52 additions and 63 deletions

View File

@ -5,7 +5,7 @@ use traits::dim::Dim;
use traits::inv::Inv;
use traits::rotation::{Rotation, Rotate, Rotatable};
use traits::translation::{Translation, Translate, Translatable};
use traits::transformation;
use Ts = traits::transformation::Transform;
use traits::transformation::{Transformation, Transformable};
use traits::rlmul::{RMul, LMul};
use traits::homogeneous::{ToHomogeneous, FromHomogeneous};
@ -192,8 +192,8 @@ Transformation<Transform<M, V>> for Transform<M, V>
{ *self = other * *self; }
}
impl<M: transformation::Transform<V>, V: Add<V, V> + Sub<V, V>>
transformation::Transform<V> for Transform<M, V>
impl<M: Ts<V>, V: Add<V, V> + Sub<V, V>>
Ts<V> for Transform<M, V>
{
#[inline]
fn transform_vec(&self, v: &V) -> V

View File

@ -17,6 +17,14 @@ use traits::indexable::Indexable;
use traits::column::Column;
use traits::iterable::{Iterable, IterableMut};
pub use traits::column::*;
pub use traits::inv::*;
pub use traits::rlmul::*;
pub use traits::rotation::*;
pub use traits::transformation::*;
pub use traits::translation::*;
pub use traits::transpose::*;
mod mat_macros;
#[deriving(Eq, Ord, Encodable, Decodable, Clone, DeepClone, IterBytes, Rand, Zero, ToStr)]

View File

@ -15,8 +15,8 @@ extern mod extra;
mod dmat;
mod dvec;
mod vec_impl;
mod mat_impl;
pub mod vec;
pub mod mat;
// specialization for some 1d, 2d and 3d operations
pub mod mat_spec;
@ -30,64 +30,39 @@ pub mod adaptors
pub mod transform;
}
pub mod vec
pub mod num
{
pub use vec_impl::*;
pub use dvec::*;
pub use traits::sample::*;
pub use traits::dot::*;
pub use traits::cross::*;
pub use traits::basis::*;
pub use traits::norm::*;
pub use traits::vector_space::*;
pub use traits::sub_dot::*;
pub use traits::scalar_op::*;
}
pub mod mat
{
pub use mat_impl::*;
pub use dmat::*;
pub use traits::column::*;
pub use traits::inv::*;
pub use traits::transpose::*;
pub use traits::rotation::*;
pub use traits::translation::*;
pub use traits::transformation::*;
}
/// Useful linear-algebra related traits.
pub mod traits
{
pub use traits::indexable::*;
pub use traits::iterable::*;
pub use traits::dim::*;
pub use traits::homogeneous::*;
pub use traits::ring::*;
pub use traits::division_ring::*;
pub use traits::rlmul::*;
pub use traits::homogeneous::*;
}
pub mod sample;
pub mod indexable;
pub mod column;
pub mod iterable;
pub mod dot;
pub mod cross;
pub mod inv;
pub mod transpose;
pub mod dim;
pub mod basis;
pub mod norm;
pub mod rotation;
pub mod translation;
pub mod transformation;
pub mod vector_space;
pub mod ring;
pub mod division_ring;
pub mod sub_dot;
pub mod rlmul;
pub mod scalar_op;
pub mod homogeneous;
// FIXME: it would be better to hide all those from the outside!
/// Useful linear-algebra related traits.
mod traits
{
mod sample;
mod indexable;
mod column;
mod iterable;
mod dot;
mod cross;
mod inv;
mod transpose;
mod dim;
mod basis;
mod norm;
mod rotation;
mod translation;
mod transformation;
mod vector_space;
mod ring;
mod division_ring;
mod sub_dot;
mod rlmul;
mod scalar_op;
mod homogeneous;
}
#[cfg(test)]

View File

@ -5,19 +5,25 @@ use std::vec::{VecIterator, VecMutIterator};
use std::iterator::{Iterator, IteratorUtil, FromIterator};
use std::cmp::ApproxEq;
use std::uint::iterate;
use traits::iterable::{Iterable, IterableMut};
use traits::basis::Basis;
use traits::dim::Dim;
use traits::dot::Dot;
use traits::sub_dot::SubDot;
use traits::norm::Norm;
use traits::translation::{Translation, Translatable};
use traits::scalar_op::{ScalarMul, ScalarDiv, ScalarAdd, ScalarSub};
use traits::ring::Ring;
use traits::division_ring::DivisionRing;
use traits::homogeneous::{FromHomogeneous, ToHomogeneous};
use traits::indexable::Indexable;
pub use traits::basis::*;
pub use traits::cross::*;
pub use traits::dot::*;
pub use traits::indexable::*;
pub use traits::iterable::*;
pub use traits::norm::*;
pub use traits::sample::*;
pub use traits::sub_dot::*;
pub use traits::vector_space::*;
pub use traits::scalar_op::*;
mod vec_macros;
#[deriving(Eq, Ord, Encodable, Decodable, Clone, DeepClone, Rand, Zero, ToStr)]