Open martindeegan opened 6 years ago
Not sure if it helps for the completely general Matrix
type, but for arbitrarily sized MatrixMN
types, I use something like this:
pub fn tanh<R:DimName,C:DimName>(x:MatrixMN<f64,R,C>) -> MatrixMN<f64,R,C>
where DefaultAllocator:Allocator<f64,R,C> {
x.map(approx_tanh)
}
The alga traits don't seem to be implemented for nalgebra::Matrix ?
I just wrote a generic function over alga::linear::Matrix
... but it seems I can't use this with an nalgebra::MatrixMN
type.
I've been trying for a few hours to create a simple generic function for arbitrary matrices, but nothing seems to work. I've been looking at this guide from the documentation.
I get the error:
When trying the
alga
crate way:I get the following errors:
The
alga
traits don't seem to be implemented fornalgebra::Matrix
?