2 Commits

Author SHA1 Message Date
7644177398 1.0.0-rc.3. 2019-04-25 11:37:49 +02:00
3d0a0c570e Fix nalgebra implementor.
Point must be removed because it is not additive.
2019-04-25 11:37:49 +02:00
3 changed files with 9 additions and 23 deletions

View File

@ -21,3 +21,9 @@ script:
- cargo test --verbose --features serialization
- echo "Building without std"
- cargo build --verbose --no-default-features
- echo "Testing with cgmath"
- cargo build --verbose --features impl-cgmath
- cargo test --verbose --features impl-cgmath
- echo "Testing with nalgebra"
- cargo build --verbose --features impl-nalgebra
- cargo test --verbose --features impl-nalgebra

View File

@ -1,6 +1,6 @@
[package]
name = "splines"
version = "1.0.0-rc.2"
version = "1.0.0-rc.3"
license = "BSD-3-Clause"
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
description = "Spline interpolation made easy"

View File

@ -1,9 +1,5 @@
use alga::general::{ClosedAdd, ClosedDiv, ClosedMul, ClosedSub};
use nalgebra::{
DefaultAllocator, DimName, Point, Scalar, Vector, Vector1, Vector2, Vector3, Vector4, Vector5,
Vector6
};
use nalgebra::allocator::Allocator;
use nalgebra::{Scalar, Vector, Vector1, Vector2, Vector3, Vector4, Vector5, Vector6};
use num_traits as nt;
use std::ops::Mul;
@ -12,7 +8,7 @@ use crate::interpolate::{Interpolate, Linear, Additive, One, cubic_hermite_def};
macro_rules! impl_interpolate_vector {
($($t:tt)*) => {
// implement Linear
impl<T> Linear<T> for $($t)*<T> where T: Scalar + ClosedMul + ClosedDiv {
impl<T> Linear<T> for $($t)*<T> where T: Scalar + ClosedAdd + ClosedSub + ClosedMul + ClosedDiv {
#[inline(always)]
fn outer_mul(self, t: T) -> Self {
self * t
@ -54,19 +50,3 @@ impl_interpolate_vector!(Vector3);
impl_interpolate_vector!(Vector4);
impl_interpolate_vector!(Vector5);
impl_interpolate_vector!(Vector6);
impl<T, D> Linear<T> for Point<T, D>
where D: DimName,
DefaultAllocator: Allocator<T, D>,
<DefaultAllocator as Allocator<T, D>>::Buffer: Copy,
T: Scalar + ClosedDiv + ClosedMul {
#[inline(always)]
fn outer_mul(self, t: T) -> Self {
self * t
}
#[inline(always)]
fn outer_div(self, t: T) -> Self {
self / t
}
}