Skip to content

Commit

Permalink
Fix abomonation integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Aug 15, 2017
1 parent afef662 commit 48f80d9
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ all:
cargo check --features "debug arbitrary serde-serialize"

doc:
cargo doc --no-deps --features "debug arbitrary serde-serialize"
cargo doc --no-deps --features "debug arbitrary serde-serialize abomonation"

bench:
cargo bench

test:
cargo test --features "debug arbitrary serde-serialize"
cargo test --features "debug arbitrary serde-serialize abomonation-serialize"
6 changes: 3 additions & 3 deletions src/geometry/isometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ pub struct Isometry<N: Real, D: DimName, R>
}

#[cfg(feature = "abomonation-serialize")]
impl<N, D, R> Abomonation for IsometryBase<N, D, R>
where N: Scalar,
impl<N, D, R> Abomonation for Isometry<N, D, R>
where N: Real,
D: DimName,
R: Abomonation,
TranslationBase<N, D>: Abomonation,
Translation<N, D>: Abomonation,
DefaultAllocator: Allocator<N, D>
{
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ where DefaultAllocator: Allocator<N, D>,


#[cfg(feature = "abomonation-serialize")]
impl<N, D> Abomonation for PointBase<N, D>
impl<N, D> Abomonation for Point<N, D>
where N: Scalar,
D: DimName,
ColumnVector<N, D>: Abomonation,
VectorN<N, D>: Abomonation,
DefaultAllocator: Allocator<N, D>
{
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Quaternion<N: Real> {
}

#[cfg(feature = "abomonation-serialize")]
impl<N: Real> Abomonation for QuaternionBase<N>
impl<N: Real> Abomonation for Quaternion<N>
where Vector4<N>: Abomonation
{
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<N: Scalar, D: DimName> Clone for Rotation<N, D>
}

#[cfg(feature = "abomonation-serialize")]
impl<N, D> Abomonation for RotationBase<N, D>
impl<N, D> Abomonation for Rotation<N, D>
where N: Scalar,
D: DimName,
MatrixN<N, D>: Abomonation,
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/similarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub struct Similarity<N: Real, D: DimName, R>
}

#[cfg(feature = "abomonation-serialize")]
impl<N: Scalar, D: DimName, R> Abomonation for SimilarityBase<N, D, R>
where IsometryBase<N, D, R>: Abomonation,
impl<N: Real, D: DimName, R> Abomonation for Similarity<N, D, R>
where Isometry<N, D, R>: Abomonation,
DefaultAllocator: Allocator<N, D>
{
unsafe fn entomb(&self, writer: &mut Vec<u8>) {
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<N: Scalar, D: DimName> Clone for Translation<N, D>
}

#[cfg(feature = "abomonation-serialize")]
impl<N, D> Abomonation for TranslationBase<N, D>
impl<N, D> Abomonation for Translation<N, D>
where N: Scalar,
D: DimName,
VectorN<N, D>: Abomonation,
Expand Down
6 changes: 1 addition & 5 deletions tests/abomonation.rs → tests/core/abomonation.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
extern crate rand;
extern crate nalgebra;
extern crate abomonation;

use rand::random;
use abomonation::{Abomonation, encode, decode};
use nalgebra::{
use na::{
DMatrix, Matrix3x4, Point3, Translation3, Rotation3, Isometry3, Quaternion,
IsometryMatrix3, Similarity3, SimilarityMatrix3
};
Expand Down
1 change: 1 addition & 0 deletions tests/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mod matrix;
mod matrix_slice;
mod blas;
mod serde;
mod abomonation;
2 changes: 1 addition & 1 deletion tests/geometry/quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ quickcheck!(

/*
*
* Quaterion * Vector == RotationBase * Vector
* Quaterion * Vector == Rotation * Vector
*
*/
fn unit_quaternion_mul_vector(q: UnitQuaternion<f64>, v: Vector3<f64>, p: Point3<f64>) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions tests/geometry/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ quickcheck!(

/*
*
* RotationBase matrix between vectors.
* Rotation matrix between vectors.
*
*/
fn rotation_between_is_anticommutative_2(a: Vector2<f64>, b: Vector2<f64>) -> bool {
Expand Down Expand Up @@ -132,7 +132,7 @@ quickcheck!(

/*
*
* RotationBase construction.
* Rotation construction.
*
*/
fn new_rotation_2(angle: f64) -> bool {
Expand All @@ -159,7 +159,7 @@ quickcheck!(

/*
*
* RotationBase pow.
* Rotation pow.
*
*/
fn powf_rotation_2(angle: f64, pow: f64) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion tests/geometry/unit_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ quickcheck!(

/*
*
* Quaterion * Vector == RotationBase * Vector
* Quaterion * Vector == Rotation * Vector
*
*/
fn unit_complex_mul_vector(c: UnitComplex<f64>, v: Vector2<f64>, p: Point2<f64>) -> bool {
Expand Down
1 change: 1 addition & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extern crate quickcheck;
extern crate approx;
extern crate num_traits as num;
extern crate serde_json;
extern crate abomonation;
extern crate rand;
extern crate alga;
extern crate nalgebra as na;
Expand Down

0 comments on commit 48f80d9

Please sign in to comment.