Grassmann.jl icon indicating copy to clipboard operation
Grassmann.jl copied to clipboard

Question: Extracting floating point values from coefficients

Open mw95710 opened this issue 2 years ago • 2 comments

Is there a function or a way to extract a scalar as a floating point number for further linear algebra computations? For instance, if I have a diagonal matrix [2.3v 0.0v; 0.0v 2.3v], is there a way to extract the matrix [2.3 0.0; 0.0 2.3] with type Float64 so I can use built-in functions in LinearAlgebra package such as eig() or inv()?

Thank you

mw95710 avatar May 05 '22 19:05 mw95710

Yes, I have some functionality like that built-in and some that's private and not comitted officially. If you or your company or research grant pays me for support, then we might be able to work something out. I'm not a public servant.

chakravala avatar May 07 '22 16:05 chakravala

@mw95710

you can access the .v property directly. Use broadcasting to get what you want.

(x->x.v).([2.3v 0.0v; 0.0v 2.3v])

Orbots avatar May 11 '22 20:05 Orbots