-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial work on a Vector
trait
#153
base: master
Are you sure you want to change the base?
Conversation
e48a6d3
to
daf1b44
Compare
Looks great to me! I'm not personally a user of this crate, so maybe try to check around you or in the community what they think about it? |
The code now triggers lots of “transmute used without annotations” which are unrelated to my changes. There is still quite a bit of work to do (there are still |
Can you use stride crate instead of Slice/SliceMut? |
@hugohp Not sure what you have in mind since, here, the strides need not be const — |
Added benefits to the additional generality: - all functions are bound checked; - the complex numbers are handled correctly and are compatible with their standard Rust representation.
As this trait will be requested to be brought into scope to set strides, it is good that the functions required to define its capabilities do not conflict with methods that the type may originally have.
An incorrect implementation of those traits may result in a out-of-bounds access in the C code, whence invalidating safety.
In doing so, remove many std::mem::transmute, all type unsafe conversions being handled in the "complex" module.
d1fca8e
to
766df07
Compare
d78eaf7
to
8d0701b
Compare
The benefit is that all examples are compiled with "cargo test" which avoids bit rotting (without the need for CI).
I've propagated the use of the I've also fixed documentation warnings and made the examples part of the crate (they thus are built with There is still work to do to make the API nicer but this is a first step. Let me know what you think. |
As discussed in #147, here is some preliminary work on the introduction of a
Vector
trait (forfit
andcblas::level1
). (It is better to have early feedback before doing more work! In particular aStride
trait must be developed to be able to add strides to anyVector
container.)Note that, as added benefits, the equality of lengths of inputs is now checked (no way of specifying a longer length than allocated) and complex numbers are handled correctly (and in a compatible way with their Rust standard representation).