Fix compilation errors when the serde-serialize feature is enabled.

Fix #369.
This commit is contained in:
sebcrozet 2018-09-13 06:55:58 +02:00 committed by Sébastien Crozet
parent 7615212e85
commit b272f3ba76
29 changed files with 153 additions and 153 deletions

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Zero; use num::Zero;
use num_complex::Complex; use num_complex::Complex;
@ -18,7 +18,7 @@ use lapack;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D>, serialize = "DefaultAllocator: Allocator<N, D>,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -27,7 +27,7 @@ use lapack;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D>, deserialize = "DefaultAllocator: Allocator<N, D>,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Zero; use num::Zero;
use num_complex::Complex; use num_complex::Complex;
@ -21,8 +21,8 @@ use lapack;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>, serialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -31,8 +31,8 @@ use lapack;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>, deserialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -17,8 +17,8 @@ use lapack;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + serialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Serialize, MatrixN<N, D>: Serialize,
VectorN<N, DimDiff<D, U1>>: serde::Serialize" VectorN<N, DimDiff<D, U1>>: Serialize"
) )
) )
)] )]
@ -28,8 +28,8 @@ use lapack;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + deserialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Deserialize<'de>, MatrixN<N, D>: Deserialize<'de>,
VectorN<N, DimDiff<D, U1>>: serde::Deserialize<'de>" VectorN<N, DimDiff<D, U1>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -24,8 +24,8 @@ use lapack;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, R, C> + serialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<i32, DimMinimum<R, C>>, Allocator<i32, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
PermutationSequence<DimMinimum<R, C>>: serde::Serialize" PermutationSequence<DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -35,8 +35,8 @@ use lapack;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, R, C> + deserialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<i32, DimMinimum<R, C>>, Allocator<i32, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
PermutationSequence<DimMinimum<R, C>>: serde::Deserialize<'de>" PermutationSequence<DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Zero; use num::Zero;
use num_complex::Complex; use num_complex::Complex;
@ -20,8 +20,8 @@ use lapack;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, R, C> + serialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>>, Allocator<N, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
VectorN<N, DimMinimum<R, C>>: serde::Serialize" VectorN<N, DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -31,8 +31,8 @@ use lapack;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, R, C> + deserialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>>, Allocator<N, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
VectorN<N, DimMinimum<R, C>>: serde::Deserialize<'de>" VectorN<N, DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Zero; use num::Zero;
use num_complex::Complex; use num_complex::Complex;
@ -21,8 +21,8 @@ use lapack;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>, serialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -31,8 +31,8 @@ use lapack;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>, deserialize = "DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Signed; use num::Signed;
use std::cmp; use std::cmp;
@ -20,9 +20,9 @@ use lapack;
serialize = "DefaultAllocator: Allocator<N, DimMinimum<R, C>> + serialize = "DefaultAllocator: Allocator<N, DimMinimum<R, C>> +
Allocator<N, R, R> + Allocator<N, R, R> +
Allocator<N, C, C>, Allocator<N, C, C>,
MatrixN<N, R>: serde::Serialize, MatrixN<N, R>: Serialize,
MatrixN<N, C>: serde::Serialize, MatrixN<N, C>: Serialize,
VectorN<N, DimMinimum<R, C>>: serde::Serialize" VectorN<N, DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -33,9 +33,9 @@ use lapack;
serialize = "DefaultAllocator: Allocator<N, DimMinimum<R, C>> + serialize = "DefaultAllocator: Allocator<N, DimMinimum<R, C>> +
Allocator<N, R, R> + Allocator<N, R, R> +
Allocator<N, C, C>, Allocator<N, C, C>,
MatrixN<N, R>: serde::Deserialize<'de>, MatrixN<N, R>: Deserialize<'de>,
MatrixN<N, C>: serde::Deserialize<'de>, MatrixN<N, C>: Deserialize<'de>,
VectorN<N, DimMinimum<R, C>>: serde::Deserialize<'de>" VectorN<N, DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num::Zero; use num::Zero;
use std::ops::MulAssign; use std::ops::MulAssign;
@ -22,8 +22,8 @@ use lapack;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + serialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, D>, Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -33,8 +33,8 @@ use lapack;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + deserialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, D>, Allocator<N, D>,
VectorN<N, D>: serde::Deserialize<'de>, VectorN<N, D>: Deserialize<'de>,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -6,7 +6,7 @@ use std::io::{Result as IOResult, Write};
use std::marker::PhantomData; use std::marker::PhantomData;
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
use abomonation::Abomonation; use abomonation::Abomonation;
@ -28,9 +28,9 @@ use geometry::{Point, Translation};
feature = "serde-serialize", feature = "serde-serialize",
serde( serde(
bound( bound(
serialize = "R: serde::Serialize, serialize = "R: Serialize,
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Serialize" Owned<N, D>: Serialize"
) )
) )
)] )]
@ -38,9 +38,9 @@ use geometry::{Point, Translation};
feature = "serde-serialize", feature = "serde-serialize",
serde( serde(
bound( bound(
deserialize = "R: serde::Deserialize<'de>, deserialize = "R: Deserialize<'de>,
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Deserialize<'de>" Owned<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -3,7 +3,7 @@ use quickcheck::{Arbitrary, Gen};
use rand::distributions::{Distribution, Standard}; use rand::distributions::{Distribution, Standard};
use rand::Rng; use rand::Rng;
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
use std::fmt; use std::fmt;
use alga::general::Real; use alga::general::Real;
@ -43,20 +43,20 @@ impl<N: Real> PartialEq for Orthographic3<N> {
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Real + serde::Serialize> serde::Serialize for Orthographic3<N> { impl<N: Real + Serialize> Serialize for Orthographic3<N> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.matrix.serialize(serializer) self.matrix.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Real + serde::Deserialize<'a>> serde::Deserialize<'a> for Orthographic3<N> { impl<'a, N: Real + Deserialize<'a>> Deserialize<'a> for Orthographic3<N> {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let matrix = Matrix4::<N>::deserialize(deserializer)?; let matrix = Matrix4::<N>::deserialize(deserializer)?;

View File

@ -4,7 +4,7 @@ use rand::distributions::{Distribution, Standard};
use rand::Rng; use rand::Rng;
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
use std::fmt; use std::fmt;
use alga::general::Real; use alga::general::Real;
@ -44,20 +44,20 @@ impl<N: Real> PartialEq for Perspective3<N> {
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Real + serde::Serialize> serde::Serialize for Perspective3<N> { impl<N: Real + Serialize> Serialize for Perspective3<N> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.matrix.serialize(serializer) self.matrix.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Real + serde::Deserialize<'a>> serde::Deserialize<'a> for Perspective3<N> { impl<'a, N: Real + Deserialize<'a>> Deserialize<'a> for Perspective3<N> {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let matrix = Matrix4::<N>::deserialize(deserializer)?; let matrix = Matrix4::<N>::deserialize(deserializer)?;

View File

@ -7,7 +7,7 @@ use std::hash;
use std::io::{Result as IOResult, Write}; use std::io::{Result as IOResult, Write};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
use abomonation::Abomonation; use abomonation::Abomonation;
@ -57,28 +57,28 @@ where
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Scalar, D: DimName> serde::Serialize for Point<N, D> impl<N: Scalar, D: DimName> Serialize for Point<N, D>
where where
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
<DefaultAllocator as Allocator<N, D>>::Buffer: serde::Serialize, <DefaultAllocator as Allocator<N, D>>::Buffer: Serialize,
{ {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.coords.serialize(serializer) self.coords.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Scalar, D: DimName> serde::Deserialize<'a> for Point<N, D> impl<'a, N: Scalar, D: DimName> Deserialize<'a> for Point<N, D>
where where
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
<DefaultAllocator as Allocator<N, D>>::Buffer: serde::Deserialize<'a>, <DefaultAllocator as Allocator<N, D>>::Buffer: Deserialize<'a>,
{ {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let coords = VectorN::<N, D>::deserialize(deserializer)?; let coords = VectorN::<N, D>::deserialize(deserializer)?;

View File

@ -8,7 +8,7 @@ use std::io::{Result as IOResult, Write};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use base::storage::Owned; use base::storage::Owned;
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
use abomonation::Abomonation; use abomonation::Abomonation;
@ -74,26 +74,26 @@ impl<N: Real> Clone for Quaternion<N> {
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Real> serde::Serialize for Quaternion<N> impl<N: Real> Serialize for Quaternion<N>
where where
Owned<N, U4>: serde::Serialize, Owned<N, U4>: Serialize,
{ {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.coords.serialize(serializer) self.coords.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Real> serde::Deserialize<'a> for Quaternion<N> impl<'a, N: Real> Deserialize<'a> for Quaternion<N>
where where
Owned<N, U4>: serde::Deserialize<'a>, Owned<N, U4>: Deserialize<'a>,
{ {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let coords = Vector4::<N>::deserialize(deserializer)?; let coords = Vector4::<N>::deserialize(deserializer)?;

View File

@ -6,7 +6,7 @@ use std::hash;
use std::io::{Result as IOResult, Write}; use std::io::{Result as IOResult, Write};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use base::storage::Owned; use base::storage::Owned;
@ -80,28 +80,28 @@ where
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Scalar, D: DimName> serde::Serialize for Rotation<N, D> impl<N: Scalar, D: DimName> Serialize for Rotation<N, D>
where where
DefaultAllocator: Allocator<N, D, D>, DefaultAllocator: Allocator<N, D, D>,
Owned<N, D, D>: serde::Serialize, Owned<N, D, D>: Serialize,
{ {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.matrix.serialize(serializer) self.matrix.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Scalar, D: DimName> serde::Deserialize<'a> for Rotation<N, D> impl<'a, N: Scalar, D: DimName> Deserialize<'a> for Rotation<N, D>
where where
DefaultAllocator: Allocator<N, D, D>, DefaultAllocator: Allocator<N, D, D>,
Owned<N, D, D>: serde::Deserialize<'a>, Owned<N, D, D>: Deserialize<'a>,
{ {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let matrix = MatrixN::<N, D>::deserialize(deserializer)?; let matrix = MatrixN::<N, D>::deserialize(deserializer)?;

View File

@ -5,7 +5,7 @@ use std::hash;
use std::io::{Result as IOResult, Write}; use std::io::{Result as IOResult, Write};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
use abomonation::Abomonation; use abomonation::Abomonation;
@ -27,10 +27,10 @@ use geometry::{Isometry, Point, Translation};
feature = "serde-serialize", feature = "serde-serialize",
serde( serde(
bound( bound(
serialize = "N: serde::Serialize, serialize = "N: Serialize,
R: serde::Serialize, R: Serialize,
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Serialize" Owned<N, D>: Serialize"
) )
) )
)] )]
@ -38,10 +38,10 @@ use geometry::{Isometry, Point, Translation};
feature = "serde-serialize", feature = "serde-serialize",
serde( serde(
bound( bound(
deserialize = "N: serde::Deserialize<'de>, deserialize = "N: Deserialize<'de>,
R: serde::Deserialize<'de>, R: Deserialize<'de>,
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Deserialize<'de>" Owned<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -3,7 +3,7 @@ use std::fmt::Debug;
use std::marker::PhantomData; use std::marker::PhantomData;
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
use alga::general::Real; use alga::general::Real;
@ -191,28 +191,28 @@ where
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Real, D: DimNameAdd<U1>, C: TCategory> serde::Serialize for Transform<N, D, C> impl<N: Real, D: DimNameAdd<U1>, C: TCategory> Serialize for Transform<N, D, C>
where where
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
Owned<N, DimNameSum<D, U1>, DimNameSum<D, U1>>: serde::Serialize, Owned<N, DimNameSum<D, U1>, DimNameSum<D, U1>>: Serialize,
{ {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.matrix.serialize(serializer) self.matrix.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Real, D: DimNameAdd<U1>, C: TCategory> serde::Deserialize<'a> for Transform<N, D, C> impl<'a, N: Real, D: DimNameAdd<U1>, C: TCategory> Deserialize<'a> for Transform<N, D, C>
where where
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
Owned<N, DimNameSum<D, U1>, DimNameSum<D, U1>>: serde::Deserialize<'a>, Owned<N, DimNameSum<D, U1>, DimNameSum<D, U1>>: Deserialize<'a>,
{ {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let matrix = MatrixN::<N, DimNameSum<D, U1>>::deserialize(deserializer)?; let matrix = MatrixN::<N, DimNameSum<D, U1>>::deserialize(deserializer)?;

View File

@ -6,7 +6,7 @@ use std::hash;
use std::io::{Result as IOResult, Write}; use std::io::{Result as IOResult, Write};
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize, Serializer, Deserializer};
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
use abomonation::Abomonation; use abomonation::Abomonation;
@ -80,28 +80,28 @@ where
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<N: Scalar, D: DimName> serde::Serialize for Translation<N, D> impl<N: Scalar, D: DimName> Serialize for Translation<N, D>
where where
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Serialize, Owned<N, D>: Serialize,
{ {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: serde::Serializer, S: Serializer,
{ {
self.vector.serialize(serializer) self.vector.serialize(serializer)
} }
} }
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
impl<'a, N: Scalar, D: DimName> serde::Deserialize<'a> for Translation<N, D> impl<'a, N: Scalar, D: DimName> Deserialize<'a> for Translation<N, D>
where where
DefaultAllocator: Allocator<N, D>, DefaultAllocator: Allocator<N, D>,
Owned<N, D>: serde::Deserialize<'a>, Owned<N, D>: Deserialize<'a>,
{ {
fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error> fn deserialize<Des>(deserializer: Des) -> Result<Self, Des::Error>
where where
Des: serde::Deserializer<'a>, Des: Deserializer<'a>,
{ {
let matrix = VectorN::<N, D>::deserialize(deserializer)?; let matrix = VectorN::<N, D>::deserialize(deserializer)?;

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use allocator::Allocator; use allocator::Allocator;
@ -21,9 +21,9 @@ use linalg::householder;
DefaultAllocator: Allocator<N, R, C> + DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>> + Allocator<N, DimMinimum<R, C>> +
Allocator<N, DimDiff<DimMinimum<R, C>, U1>>, Allocator<N, DimDiff<DimMinimum<R, C>, U1>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
VectorN<N, DimMinimum<R, C>>: serde::Serialize, VectorN<N, DimMinimum<R, C>>: Serialize,
VectorN<N, DimDiff<DimMinimum<R, C>, U1>>: serde::Serialize" VectorN<N, DimDiff<DimMinimum<R, C>, U1>>: Serialize"
) )
) )
)] )]
@ -35,9 +35,9 @@ use linalg::householder;
DefaultAllocator: Allocator<N, R, C> + DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>> + Allocator<N, DimMinimum<R, C>> +
Allocator<N, DimDiff<DimMinimum<R, C>, U1>>, Allocator<N, DimDiff<DimMinimum<R, C>, U1>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
VectorN<N, DimMinimum<R, C>>: serde::Deserialize<'de>, VectorN<N, DimMinimum<R, C>>: Deserialize<'de>,
VectorN<N, DimDiff<DimMinimum<R, C>, U1>>: serde::Deserialize<'de>" VectorN<N, DimDiff<DimMinimum<R, C>, U1>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
@ -16,7 +16,7 @@ use storage::{Storage, StorageMut};
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D>, serialize = "DefaultAllocator: Allocator<N, D>,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -25,7 +25,7 @@ use storage::{Storage, StorageMut};
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D>, deserialize = "DefaultAllocator: Allocator<N, D>,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use num_complex::Complex; use num_complex::Complex;
@ -24,8 +24,8 @@ use linalg::RealSchur;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D>, serialize = "DefaultAllocator: Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -34,8 +34,8 @@ use linalg::RealSchur;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D>, deserialize = "DefaultAllocator: Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use allocator::Allocator; use allocator::Allocator;
@ -19,8 +19,8 @@ use linalg::PermutationSequence;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, R, C> + serialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<(usize, usize), DimMinimum<R, C>>, Allocator<(usize, usize), DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
PermutationSequence<DimMinimum<R, C>>: serde::Serialize" PermutationSequence<DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -30,8 +30,8 @@ use linalg::PermutationSequence;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, R, C> + deserialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<(usize, usize), DimMinimum<R, C>>, Allocator<(usize, usize), DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
PermutationSequence<DimMinimum<R, C>>: serde::Deserialize<'de>" PermutationSequence<DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use allocator::Allocator; use allocator::Allocator;
@ -18,8 +18,8 @@ use linalg::householder;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + serialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Serialize, MatrixN<N, D>: Serialize,
VectorN<N, DimDiff<D, U1>>: serde::Serialize" VectorN<N, DimDiff<D, U1>>: Serialize"
) )
) )
)] )]
@ -29,8 +29,8 @@ use linalg::householder;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + deserialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Deserialize<'de>, MatrixN<N, D>: Deserialize<'de>,
VectorN<N, DimDiff<D, U1>>: serde::Deserialize<'de>" VectorN<N, DimDiff<D, U1>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::{Field, Real}; use alga::general::{Field, Real};
use allocator::{Allocator, Reallocator}; use allocator::{Allocator, Reallocator};
@ -19,8 +19,8 @@ use linalg::PermutationSequence;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, R, C> + serialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<(usize, usize), DimMinimum<R, C>>, Allocator<(usize, usize), DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
PermutationSequence<DimMinimum<R, C>>: serde::Serialize" PermutationSequence<DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -30,8 +30,8 @@ use linalg::PermutationSequence;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, R, C> + deserialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<(usize, usize), DimMinimum<R, C>>, Allocator<(usize, usize), DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
PermutationSequence<DimMinimum<R, C>>: serde::Deserialize<'de>" PermutationSequence<DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::ClosedNeg; use alga::general::ClosedNeg;
use num::One; use num::One;
@ -18,7 +18,7 @@ use storage::StorageMut;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<(usize, usize), D>, serialize = "DefaultAllocator: Allocator<(usize, usize), D>,
VectorN<(usize, usize), D>: serde::Serialize" VectorN<(usize, usize), D>: Serialize"
) )
) )
)] )]
@ -27,7 +27,7 @@ use storage::StorageMut;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<(usize, usize), D>, deserialize = "DefaultAllocator: Allocator<(usize, usize), D>,
VectorN<(usize, usize), D>: serde::Deserialize<'de>" VectorN<(usize, usize), D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use base::{DefaultAllocator, Matrix, MatrixMN, MatrixN, Unit, VectorN}; use base::{DefaultAllocator, Matrix, MatrixMN, MatrixN, Unit, VectorN};
@ -16,13 +16,13 @@ use geometry::Reflection;
#[cfg_attr(feature = "serde-serialize", #[cfg_attr(feature = "serde-serialize",
serde(bound(serialize = "DefaultAllocator: Allocator<N, R, C> + serde(bound(serialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>>, Allocator<N, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Serialize, MatrixMN<N, R, C>: Serialize,
VectorN<N, DimMinimum<R, C>>: serde::Serialize")))] VectorN<N, DimMinimum<R, C>>: Serialize")))]
#[cfg_attr(feature = "serde-serialize", #[cfg_attr(feature = "serde-serialize",
serde(bound(deserialize = "DefaultAllocator: Allocator<N, R, C> + serde(bound(deserialize = "DefaultAllocator: Allocator<N, R, C> +
Allocator<N, DimMinimum<R, C>>, Allocator<N, DimMinimum<R, C>>,
MatrixMN<N, R, C>: serde::Deserialize<'de>, MatrixMN<N, R, C>: Deserialize<'de>,
VectorN<N, DimMinimum<R, C>>: serde::Deserialize<'de>")))] VectorN<N, DimMinimum<R, C>>: Deserialize<'de>")))]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct QR<N: Real, R: DimMin<C>, C: Dim> pub struct QR<N: Real, R: DimMin<C>, C: Dim>
where where

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use num_complex::Complex; use num_complex::Complex;
@ -22,7 +22,7 @@ use linalg::Hessenberg;
serde( serde(
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D>, serialize = "DefaultAllocator: Allocator<N, D, D>,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -31,7 +31,7 @@ use linalg::Hessenberg;
serde( serde(
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D>, deserialize = "DefaultAllocator: Allocator<N, D, D>,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num_complex::Complex; use num_complex::Complex;
use std::ops::MulAssign; use std::ops::MulAssign;
@ -26,9 +26,9 @@ use linalg::Bidiagonal;
Allocator<N, DimMinimum<R, C>> + Allocator<N, DimMinimum<R, C>> +
Allocator<N, DimMinimum<R, C>, C> + Allocator<N, DimMinimum<R, C>, C> +
Allocator<N, R, DimMinimum<R, C>>, Allocator<N, R, DimMinimum<R, C>>,
MatrixMN<N, R, DimMinimum<R, C>>: serde::Serialize, MatrixMN<N, R, DimMinimum<R, C>>: Serialize,
MatrixMN<N, DimMinimum<R, C>, C>: serde::Serialize, MatrixMN<N, DimMinimum<R, C>, C>: Serialize,
VectorN<N, DimMinimum<R, C>>: serde::Serialize" VectorN<N, DimMinimum<R, C>>: Serialize"
) )
) )
)] )]
@ -40,9 +40,9 @@ use linalg::Bidiagonal;
Allocator<N, DimMinimum<R, C>> + Allocator<N, DimMinimum<R, C>> +
Allocator<N, DimMinimum<R, C>, C> + Allocator<N, DimMinimum<R, C>, C> +
Allocator<N, R, DimMinimum<R, C>>, Allocator<N, R, DimMinimum<R, C>>,
MatrixMN<N, R, DimMinimum<R, C>>: serde::Deserialize<'de>, MatrixMN<N, R, DimMinimum<R, C>>: Deserialize<'de>,
MatrixMN<N, DimMinimum<R, C>, C>: serde::Deserialize<'de>, MatrixMN<N, DimMinimum<R, C>, C>: Deserialize<'de>,
VectorN<N, DimMinimum<R, C>>: serde::Deserialize<'de>" VectorN<N, DimMinimum<R, C>>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use num_complex::Complex; use num_complex::Complex;
use std::ops::MulAssign; use std::ops::MulAssign;
@ -22,8 +22,8 @@ use linalg::SymmetricTridiagonal;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + serialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, D>, Allocator<N, D>,
VectorN<N, D>: serde::Serialize, VectorN<N, D>: Serialize,
MatrixN<N, D>: serde::Serialize" MatrixN<N, D>: Serialize"
) )
) )
)] )]
@ -33,8 +33,8 @@ use linalg::SymmetricTridiagonal;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + deserialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, D>, Allocator<N, D>,
VectorN<N, D>: serde::Deserialize<'de>, VectorN<N, D>: Deserialize<'de>,
MatrixN<N, D>: serde::Deserialize<'de>" MatrixN<N, D>: Deserialize<'de>"
) )
) )
)] )]

View File

@ -1,5 +1,5 @@
#[cfg(feature = "serde-serialize")] #[cfg(feature = "serde-serialize")]
use serde; use serde::{Serialize, Deserialize};
use alga::general::Real; use alga::general::Real;
use allocator::Allocator; use allocator::Allocator;
@ -17,8 +17,8 @@ use linalg::householder;
bound( bound(
serialize = "DefaultAllocator: Allocator<N, D, D> + serialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Serialize, MatrixN<N, D>: Serialize,
VectorN<N, DimDiff<D, U1>>: serde::Serialize" VectorN<N, DimDiff<D, U1>>: Serialize"
) )
) )
)] )]
@ -28,8 +28,8 @@ use linalg::householder;
bound( bound(
deserialize = "DefaultAllocator: Allocator<N, D, D> + deserialize = "DefaultAllocator: Allocator<N, D, D> +
Allocator<N, DimDiff<D, U1>>, Allocator<N, DimDiff<D, U1>>,
MatrixN<N, D>: serde::Deserialize<'de>, MatrixN<N, D>: Deserialize<'de>,
VectorN<N, DimDiff<D, U1>>: serde::Deserialize<'de>" VectorN<N, DimDiff<D, U1>>: Deserialize<'de>"
) )
) )
)] )]