Implement Default for MatrixMN.
This commit is contained in:
parent
049957ff55
commit
e6265da980
|
@ -48,6 +48,19 @@ where
|
|||
/// Renamed to [ArrayStorage].
|
||||
pub type MatrixArray<N, R, C> = ArrayStorage<N, R, C>;
|
||||
|
||||
impl<N, R, C> Default for ArrayStorage<N, R, C>
|
||||
where
|
||||
R: DimName,
|
||||
C: DimName,
|
||||
R::Value: Mul<C::Value>,
|
||||
Prod<R::Value, C::Value>: ArrayLength<N>,
|
||||
N: Default,
|
||||
{
|
||||
fn default() -> Self {
|
||||
ArrayStorage { data: Default::default() }
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, R, C> Hash for ArrayStorage<N, R, C>
|
||||
where
|
||||
N: Hash,
|
||||
|
|
|
@ -90,6 +90,21 @@ impl<N: Scalar, R: Dim, C: Dim, S: fmt::Debug> fmt::Debug for Matrix<N, R, C, S>
|
|||
}
|
||||
}
|
||||
|
||||
impl<N, R, C, S> Default for Matrix<N, R, C, S>
|
||||
where
|
||||
N: Scalar,
|
||||
R: Dim,
|
||||
C: Dim,
|
||||
S: Default,
|
||||
{
|
||||
fn default() -> Self {
|
||||
Matrix {
|
||||
data: Default::default(),
|
||||
_phantoms: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serde-serialize")]
|
||||
impl<N, R, C, S> Serialize for Matrix<N, R, C, S>
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue