Commit Graph

29 Commits

Author SHA1 Message Date
Sébastien Crozet 4ffe274b03 Add mean and covariance computation for DMat.
This also fixes the transposition for rectangular DMat, and add scalar
addition/subtraction/multiplication/division for DMat.
2013-09-22 15:47:53 +02:00
Sébastien Crozet 1a08262f50 More unsafe indexing in inner loops and add some benchmarks. 2013-09-14 00:08:46 +02:00
Sébastien Crozet 1cf3506e06 Remove some useless #[test] tags. 2013-09-13 10:34:49 +02:00
Sébastien Crozet bdf82748dc Add a `Dot` and a `Norm` trait for vectors having a dot product and a norm.
Those methods are not part of the `Vec` and `AlgebraicVec` traits any more.
2013-09-08 18:20:06 +02:00
Sébastien Crozet 82ddda154f Update to work with the last compiler.
Because of the unfortunate changes on type parameters resolution:
        - the Dim trait now needs an useless parameter to infer the Self type.
        - ApproxEps::epsilon() is broken.
2013-08-28 14:22:12 +02:00
Sébastien Crozet 6999444575 Merge the Rotatable, Translatable, Transformable traits with their corresponding Rotation, Translation, Transformation. 2013-08-22 17:47:37 +02:00
Sébastien Crozet 347883caa1 Rework of the traits for Vectors.
The goal is to make traits less fine-grained for vectors, and reduce the amount of `use`.

- Scalar{Mul, Div} are removed, replaced by Mul<N, V> and Div<N, V>,
- Ring and DivisionRing are removed. Use Num instead.
- VectorSpace, Dot, and Norm are removed, replaced by the new, higher-level traits.

Add four traits:
- Vec: common operations on vectors. Replaces VectorSpace and Dot.
- AlgebraicVec: Vec + the old Norm trait.
- VecExt: Vec + every other traits vectors implement.
- AlgebraicVecExt: AlgebraicVec + VecExt.
2013-08-18 18:33:25 +02:00
Sébastien Crozet c59911168e Fix curly braces. 2013-08-05 10:13:44 +02:00
Sébastien Crozet 7b2dbb244e Fix `for` loops. 2013-08-02 10:50:04 +02:00
Sébastien Crozet 4ea1dd92e6 Fixed transposition. 2013-07-23 11:15:20 +02:00
Sébastien Crozet cf216f9b90 Removed occurences of copy/Copy + improved api.
Now, access to vector components are x, y, z, w, a, b, ... instead of at[i].
The method at(i) has the same (read only) effect as the old at[i].

Now, access to matrix components are m11, m12, ... instead of mij[offset(i, j)]...
The method at((i, j)) has the same effect as the old mij[offset(i, j)].

Automatic implementation of all traits the compiler supports has been added on the #[deriving]
clause for both matrices and vectors.
2013-07-20 15:07:49 +02:00
Sébastien Crozet 6f081b70b8 Add sphere sempling trait + Copy becomes Clone 2013-07-04 14:23:08 +00:00
Sébastien Crozet 6fd9696253 Fix bug when trying to create a rotation matrix with a zero angle. 2013-06-30 21:19:36 +00:00
Sébastien Crozet 429bcbf9c3 Fix Column implementation generating an ICE. 2013-06-29 15:19:21 +00:00
Sébastien Crozet c54eb562ec Refactor code for matrices. 2013-06-28 22:55:09 +00:00
Sébastien Crozet cd355dfb30 Refactor vec{1, 2, 3} implemenation + add some useful traits. 2013-06-28 21:03:40 +00:00
Sébastien Crozet 6723693b49 Refined traits for rotation/translation/transformation. 2013-06-27 16:16:07 +00:00
Sébastien Crozet 513d4d7b08 Add inlining pragmas. 2013-06-13 16:48:28 +00:00
Sébastien Crozet 4c65f793e8 Add flatten trait. 2013-06-10 00:09:36 +00:00
Sébastien Crozet bd5f1eae88 Codding style fix. 2013-06-09 14:04:54 +00:00
Sébastien Crozet 8a1b81f839 Primitive construction is more idiomatique using new. 2013-06-08 10:09:17 +00:00
Sébastien Crozet 0b8058e88f Adapted for the compiler 'incomming' branch. 2013-06-01 20:50:00 +02:00
Sébastien Crozet 4146385e09 Fix matrix inversion algorithm. 2013-05-31 18:35:48 +02:00
Sébastien Crozet 65b175b4a7 Refactored tests using macros. 2013-05-21 23:15:20 +00:00
Sébastien Crozet 3fa933d13f Add comments and adapted to new rust syntax. 2013-05-21 22:46:33 +00:00
Sébastien Crozet b2d17300d9 Add delta-transformation implementations. 2013-05-19 19:45:30 +00:00
Sébastien Crozet 52a769a431 Add a test for the 2d rotation. 2013-05-19 11:53:19 +00:00
Sébastien Crozet a0ada142a6 Removed useless use on the .rc. 2013-05-18 21:56:03 +00:00
Sébastien Crozet 890cdb73f2 Add tests and basis generation. 2013-05-18 17:04:03 +00:00