-
Notifications
You must be signed in to change notification settings - Fork 32
Release notes
This release has two features:
- Merged PR #55 (Reenable caret versions instead of tilde versions);
- Introduced the (super experimental!)
platform_intrinsics
feature, which is obviously disabled by default.
The platform_intrinsics
feature enables the use of LLVM SIMD intrinsics for common vector operations such as Add Mul, etc, for repr_simd
vectors, using RFC 1199.
Since this is based on an unstable and not-well-documented feature, expect possible internal compiler errors or runtime issues when trying it for the first time.
In most cases however, it should be fine, and could provide good performance boosts in specific scenarios, both in debug and release builds.
The minor version was increased from 0.10 due to a breaking change in the trait requirements for sum()
(and product()
), which in turn impacts dot()
, which impacts many other functions.
The changes in this version were motivated by unacceptably low performance in debug builds, as reported in #53. It does turn out that I've been a bit too "iterator-happy".
Breaking changes :
- The requirement for
VecX::sum()
is nowT: Add<Output=T>
instead ofT: std::iter::Sum
. - The requirement for
VecX::product()
is nowT: Mul<Output=T>
instead ofT: std::iter::Product
.
New features:
-
map3()
andapply3()
. They are likemap2()
andapply2()
but with yet an extra argument, which is supposedly useful for operations such as fused-multiply add;mul_add()
could be implemented withmap3()
, but does not actually use it.
Improvements:
-
All reduction operations on vectors have been made as fast as possible, thanks to
advanced hacker techniquesmacro magic, at least for therepr_c
case (I mean, therepr_simd
module does not yet try to be more clever). The optimization applies to:- Approximate equality between two vectors;
- Vector comparisons which return a boolean vector of the same dimension;
-
sum()
, which improves the performance ofdot()
, which in turn improves the performance ofmagnitude()
, etc; -
product()
; -
hadd()
; -
is_any_negative()
,are_all_positive()
; -
reduce_xxx()
-style functions; - ... and probably some others I have missed.
The optimization consists of:
- Preventing the use of iterators entirely;
- Directly using struct members, without any unneded transform;
- Directly using the required operator, instead of possibly using
map()
ormap2()
which could introduce some overhead. - Taking advantage of short-circuit semantics for logical operators such as
&&
and||
.
Fixed unfortunate #![missing_docs]
warnings in geom.rs
since the additions of as_()
; I was using double-slash comments instead of triple-slash.
Fixed issue #52, by adding an implementation of as_()
using AsPrimitive
for vector types, as well as matrices and most geometric shapes.
Merged PR #50, fixing an issue where the column_major
matrix module used crate
instead of self
, meaning that e.g vek::mat::repr_simd::Mat3
would actually use repr_c
. Thanks @Veykril!
Merged PR #49, adding support for Aabb::projected_point()
and Aabb::distance_from_point()
. Thanks @zesterer!
The minor version was increased from 0.9 because this version introduces minor breaking changes, due to updated dependencies, and minor changes to the API. Please note that this is to be expected from a crate which major version is 0.
cargo fix
is great!
Also fixed warnings about deprecated use of mem::uninitialized()
.
A new no_std
target was added to the Travis CI script as well, to test for regressions.
To compile on no_std
, specify the vek
dependency in Cargo.toml
like so :
[dependencies]
vek = { version = "0.10.0", default-features = false, features = ["libm"] }
In particular, the approx
crate, with new traits, which is a breaking change.
Added Clamp::clamped_minus1_1()
, and used it before calling .acos()
on a value.
Improved is_normalized()
, courtesy of @Imberflur, see PR #48.
Also added a is_magnitude_close_to()
helper method.
The best example is CubicBezier::unit_circle() which returned 4 curves approximating a circle.
Returning a tuple is convenient for deconstructing the result, but makes less sense than an array because what we're really returning is a collection of curves, something one could easily iterate on, and arrays are simply a better fit.
There are no release notes for the previous versions, sorry!