I am trying to parameterize my Node
type with an nalgebra::dimension::Dim
trait. However, after getting an error, I changed the Dim
trait to DimName
. The following code is now giving a new error.
Here is the code and a link to run it.
use nalgebra::{
base::dimension::DimName,
base::VectorN,
RealField
};
struct Node<T: RealField, D: DimName> {
location: VectorN<T, D>,
}
The error:
error[E0277]: cannot multiply `typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>` to `<D as nalgebra::DimName>::Value`
--> src/lib.rs:8:15
|
8 | location: VectorN<T, D>,
| ^^^^^^^^^^^^^ no implementation for `<D as nalgebra::DimName>::Value * typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>`
|
= help: the trait `std::ops::Mul<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>>` is not implemented for `<D as nalgebra::DimName>::Value`
= note: required because of the requirements on the impl of `nalgebra::allocator::Allocator<T, D>` for `nalgebra::DefaultAllocator`
How might I resolve this or is there a more appropriate dimension trait to use?