Lift `DimName` requirement on `MatrixMN::zero()`
Interpret dynamic dimensions as 0.
This commit is contained in:
parent
ccdd393700
commit
1dd762d174
|
@ -681,14 +681,14 @@ impl_constructors!(Dynamic, Dynamic;
|
||||||
* Zero, One, Rand traits.
|
* 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
|
where
|
||||||
N: Scalar + Zero + ClosedAdd,
|
N: Scalar + Zero + ClosedAdd,
|
||||||
DefaultAllocator: Allocator<N, R, C>,
|
DefaultAllocator: Allocator<N, R, C>,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn zero() -> Self {
|
fn zero() -> Self {
|
||||||
Self::from_element(N::zero())
|
Self::zeros_generic(R::default(), C::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in New Issue