Commit graph

162 commits

Author SHA1 Message Date
Alex Butler
a3965d414d
Update approx -> 0.2 2018-05-23 12:43:52 +01:00
Richard Dodd
2a7e2ebda3 Fix simd 2018-04-29 17:04:49 +01:00
Richard Dodd
f8e92ed327 Add is_finite to array and quaternion 2018-04-29 14:21:42 +01:00
Richard Dodd
f82e421e2c Fix for simd 2018-04-28 15:09:45 +01:00
Richard Dodd
4fede94df5 Add is_finite method to vectors and matrices.
This method is useful in debug to error early when some kind of
singularity is encountered.
2018-04-28 11:34:45 +01:00
Osspial
def53ca371 Fix some documentation 2018-03-16 16:32:46 -04:00
Osspial
34da833e39 Add map functions to points and vectors 2018-01-20 23:54:59 -05:00
Brendan Zabarauskas
574dd3b972 Run rustfmt on most files 2018-01-03 13:16:40 +11:00
Brendan Zabarauskas
68b9052be1 Remove experimantal must_use annotations 2018-01-03 12:41:43 +11:00
Aceeri
fe8ec2beb9 Fix docs for unit_z on Vector3 2017-12-03 17:57:37 -08:00
Egor Larionov
76f00b7941 Extend swizzles to increase the dimension of a vector.
For example this is now valid:
```
let p2 = Point2::new(1.0, 2.0);
let p3 = p2.xyx(); // producing Point3 { x:1.0, y:2.0, z:1.0 }
```
2017-09-30 15:09:03 -07:00
Egor Larionov
cc7047555d Complete the list of generated swizzle operators. 2017-09-30 14:41:17 -07:00
Osspial
bd1b2667bd Fix building with SIMD enabled 2017-08-16 16:47:45 -04:00
Osspial
a6abd5bf02 Modify cast() functions to return Option 2017-08-16 16:21:51 -04:00
Osspial
1e98ef4dd4 Add Bounded impl for Vectors and Points 2017-08-08 19:11:14 -04:00
harrison
42cb73de8e fixed len for simd 2017-07-31 16:54:40 -04:00
harrison
9b84d804ae added len function to Array 2017-07-31 16:13:15 -04:00
Dzmitry Malyshau
d72fc08826 Mint flavour 2017-06-06 18:07:38 -04:00
Dzmitry Malyshau
7a21125c55 Refined serde dependencies 2017-06-06 16:48:55 -04:00
Dzmitry Malyshau
087336d0c0 Refinded simd feature 2017-06-06 16:44:13 -04:00
Brendan Zabarauskas
b6199ca702 Remove PartialOrd
Closes #396

This removes `PartialOrd` and makes `BaseNum` and `BaseFloat` simple trait aliases. This should allow more types to be used as parameters in the cgmath data types at the expense of removing `Array::min` and `Array::max`.
2017-05-06 17:12:52 +10:00
Brendan Zabarauskas
77260934a1 Clean up Sum and Product impls
This is for consistency with other impls
2017-04-26 21:56:02 +10:00
Ben Boeckel
240559b941 iter traits: impl iter::{Sum, Product}
This adds `Sum` trait for the `MatrixN`, `VectorN`, `Quaternion`
structures and the `Product` trait for `MatrixN`, `BasisN` and
`Quaternion`.

It also add constraints on the `Rotation` and `SquareMatrix` to require
the `Product` trait and `VectorSpace` to require `Sum`.
2017-04-25 11:01:18 -04:00
Brendan Zabarauskas
78555ec780 Drop rustc-serialize support
According to [Rust release milestone predictions](https://internals.rust-lang.org/t/rust-release-milestone-predictions/4591?u=dtolnay), rustc-serialize is scheduled to be deprecated in next month's beta release of Rust.

Closes #395
2017-04-16 16:35:24 +10:00
Dimitri Sabadie
06bf49eee5 Added dots at end of some phrases. 2017-03-21 00:10:38 +01:00
Luxko
194c4770e9 add basic SIMD support for Quaternion<f32> 2017-03-12 20:44:58 +08:00
Luxko
d45536f1bd Clean up a bit 2017-02-25 07:42:15 +08:00
Luxko
64924b954d [WIP]Add basic SIMD support
- Add an opt-in SIMD support for the module. The feature requires crate
`simd` and specialization, thus can only be enabled under nightly. Under
the given benchmark certain operations were able to be up to 60% faster.
Currently the supported types as well as operations are highly limited.
- Clean up some deadly tests. Also add new tests for SIMD.
2017-02-25 07:26:11 +08:00
Mark Hintz
f475822d9b Removes #[repr(packed)] from all structs where it was specified.
This is intended as a partial fix for #375. It doesn't also remove #[repr(C)],
since it's a bit unclear whether that's necessary.
2016-08-25 15:41:39 +02:00
Andrew Dudney
0f8a96d9b8 Changed over to the approx crate. Currently breaks rotation's doc tests. 2016-08-22 09:21:22 -06:00
Romain Vaillant
cdbb9294e0 Adds serde support 2016-05-16 14:16:59 +02:00
Romain Vaillant
f3673a1d4c makes rustc-serialize optional 2016-05-15 14:48:57 +02:00
Brendan Zabarauskas
6b48236cb6 Inherit Zero and One for core structural traits 2016-04-25 15:26:56 +10:00
Brendan Zabarauskas
54adacc2a8 Re-export Zero and One via structure module 2016-04-25 11:43:28 +10:00
Brendan Zabarauskas
4c2f301561 Add Vector1 and Point1 structs 2016-04-25 08:59:33 +10:00
Brendan Zabarauskas
8795b179d7 Add MetricSpace trait for calculating distances 2016-04-23 19:58:34 +10:00
Brendan Zabarauskas
86c13ca14f Switch to using num_traits crate from num
Fixes #336
2016-04-23 14:03:35 +10:00
Brendan Zabarauskas
8dd2874b59 Move traits into common module 2016-04-19 20:51:40 +10:00
Brendan Zabarauskas
07301eb4d0 Stabilise assignment operators
Assignment operators were stabilised in Rust 1.8.
2016-04-16 10:09:47 +10:00
Brendan Zabarauskas
23fce928c0 Module documentation updates 2016-04-09 14:22:30 +10:00
Brendan Zabarauskas
886e2fb240 Unify trait hierarchies for vectors, quaternions and matrices 2016-04-09 13:47:04 +10:00
Brendan Zabarauskas
2b36ea2ef9 Rename Vector trait to VectorSpace and EuclideanVector to InnerSpace 2016-04-08 08:46:35 +10:00
Brendan Zabarauskas
f82c8826a2 Add doc comments for vector axes 2016-04-05 08:52:27 +10:00
Brendan Zabarauskas
90dbd29f6d Make some documentation more succinct 2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
f766973a74 Remove neg_self methods
These are a weird methods... they aren't associated with any traits. I think they were left-over from before we moved to operator impls.
2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
019cac1f74 Add some links to wikipedia pages 2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
40a3ad3185 Add a default implementation for EuclideanVector::angle 2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
3b55ad5f70 Move Vector::from_value function to Array trait 2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
e0a5164967 Improve documentation for vector traits 2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
2cd6f402df Move the dot method onto EuclideanVector
The Vector and EuclideanVector traits roughly line up with the concept of vector spaces and inner spaces respectively. It makes more sense to group `dot` with the other methods that depend on it.
2016-04-04 20:45:37 +10:00