Wherever sensible the geometric traits now take `&self` arguments, so that
implementations can be invoked as instance methods instead of static methods.
This makes some idioms easier to express and generally allows for greater
flexibility as the restructured methods can still be invoked like static
methods.
Fixes#39.
This is just a quick-fix so that nalgebra compiles.
This does not fix the deprecation warnings!
Version of rustc: 0.13.0-nightly (d91a015ab 2014-11-14 23:37:27 +0000).
This adds the Pnt{1,2,3,4,5,6} structures.
This adds the traits:
− AnyPnt
− FloatPnt
− PntExt
− FloatPntExt
− Orig (to return the zero point)
− PntAsVec
− VecAsPnt
This adds operator overloading:
− Pnt + Vec
− Pnt - Vec
− Pnt * Scalar
− Pnt / Scalar
− Pnt + Scalar
− Pnt - Scalar
− Iso * Pnt
− Rot * Pnt
− Pnt * Iso
− Pnt * Rot
This changes some behavior:
− Iso multiplication with a Vec does not translate the vector any more.
− ToHomogeneous adds a 0.0 at the end of a Vec and a 1.0 at the end of a Pnt.
− FromHomogeneous performs w-normalization on a Pnt, but not on a Vec.
− The Translate<Vec> trait is never implemented (i-e. a Vec is not to be translated).
cc #25
Version of rustc: 0.11.0-pre-nightly (faa7ba7 2014-05-31 01:06:40 -0700).
Main changes:
* `cmp::Ord` -> `cmp::PartialOrd`
* `cmp::Eq` -> `cmp::PartialEq`
Note that `na::PartialOrd` is not the same as `cmp::PartialOrd`
(which lacks a lot of partial ordering operators).
This allows the implementation of householder reflection without relying
on knowledge of DVec. This required a new member in the Indexable trait:
the shape() function, which returns the maximum index available.
The `Vec` trait is renamed `AnyVec`.
The `Less`, `Greater`, `Equal` variants are renamed `PartialLess`, `PartialGreater`,
`PartialEqual`.
Those new names are not very good, so they might change in the future.
Version of rustc: 0.10-pre (b0ce960 2014-02-17 22:16:51 -0800)
This replaces uses of the `Orderable` trait by a `PartialOrd` trait: the `min` and `max` methods
are replaced by `inf` and `sup` methods.
Vectors do not implement the `Ord` trait any more.
Fix#4
This is to make people prefer the functional style.
Things like `a.dot(b)` dont make sense per se (there is no reason for `a` to have a different
status than `b`). Using static methods avoid this.
In-place methods are left unchanged.
Before, it was too easy to use an out of place method instead of the inplace one since they name
were pretty mutch the same. This kind of confusion may lead to silly bugs very hard to understand.
Thus the following changes have been made when a method is available both inplace and out-of-place:
* inplace version keep a short name.
* out-of-place version are suffixed by `_cpy` (meaning `copy`), and are static methods.
Methods applying transformations (rotation, translation or general transform) are now prefixed by
`append`, and a `prepend` version is available too.
Also, free functions doing in-place modifications dont really make sense. They have been removed.
Here are the naming changes:
* `invert` -> `inv`
* `inverted` -> `Inv::inv_cpy`
* `transpose` -> `transpose`
* `transposed` -> `Transpose::transpose_cpy`
* `transform_by` -> `append_transformation`
* `transformed` -> `Transform::append_transformation_cpy`
* `rotate_by` -> `apppend_rotation`
* `rotated` -> `Rotation::append_rotation_cpy`
* `translate_by` -> `apppend_translation`
* `translate` -> `Translation::append_translation_cpy`
* `normalized` -> `Norm::normalize_cpy`
* `rotated_wrt_point` -> `RotationWithTranslation::append_rotation_wrt_point_cpy`
* `rotated_wrt_center` -> `RotationWithTranslation::append_rotation_wrt_center_cpy`
Note that using those static methods is very verbose, and using in-place methods require an
explicit import of the related trait.
This is a way to convince the user to use free functions most of the time.
Everything changed, hopefully for the best.
* everything is accessible from the `na` module. It re-export
everything and provides free functions (i-e: na::dot(a, b) instead of
a.dot(b)) for most functionalities.
* matrix/vector adaptors (Rotmat, Transform) are replaced by plain
types: Rot{2, 3, 4} for rotation matrices and Iso{2, 3, 4} for
isometries (rotation + translation). This old adaptors system was to
hard to understand and to document.
* each file related to data structures moved to the `structs` folder.
This makes the doc a lot more readable and make people prefer the
`na` module instead of individual small modules.
* Because `na` exists now, the modules `structs::vec` and
`structs::mat` dont re-export anything now.
As a side effect, this makes the documentation more readable.
Trait failes are merged in three files:
* operations.rs - for low-level matrix/vector operations
* geometry.rs - for operations with a clear, broadly known geometric meaning.
* structure.rs - for operations to access/alter the object inner structures.
Specialisations are moved to the `spec` folder.
Those traits are not really removed since rust cannot handle those multiple operator overloading
very well yet, making them sometimes unuseable on generic code.
Traits like `AbsoluteRotate` and `RotationWithTranslation` have been moved to a `comp` folder
containing any trait providing operations which are combination of several traits.
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.
CrossMatrix is a trait for vectors having a cross product representable as a matrix.
Row is a trait for Matrixces and Vectors, to access (by index) their rows.
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.
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.