Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Extracting floating point values from coefficients #100

Open
mw95710 opened this issue May 5, 2022 · 2 comments
Open

Question: Extracting floating point values from coefficients #100

mw95710 opened this issue May 5, 2022 · 2 comments

Comments

@mw95710
Copy link

mw95710 commented May 5, 2022

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

@chakravala
Copy link
Owner

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.

@Orbots
Copy link

Orbots commented May 11, 2022

@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])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants