Lift `DimName` requirement on `MatrixMN::zero()`

Interpret dynamic dimensions as 0.
This commit is contained in:
Jack Wrenn 2018-12-29 12:39:47 -05:00
parent ccdd393700
commit 1dd762d174
1 changed files with 2 additions and 2 deletions

View File

@ -681,14 +681,14 @@ impl_constructors!(Dynamic, Dynamic;
* Zero, One, Rand traits.
*
*/
impl<N, R: DimName, C: DimName> Zero for MatrixMN<N, R, C>
impl<N, R: Dim, C: Dim> Zero for MatrixMN<N, R, C>
where
N: Scalar + Zero + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
{
#[inline]
fn zero() -> Self {
Self::from_element(N::zero())
Self::zeros_generic(R::default(), C::default())
}
#[inline]