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: eigenvalue problem #27

Closed
wkwkes opened this issue Apr 5, 2017 · 2 comments
Closed

Question: eigenvalue problem #27

wkwkes opened this issue Apr 5, 2017 · 2 comments

Comments

@wkwkes
Copy link

wkwkes commented Apr 5, 2017

Hi, I searched this repository for a function to the solve the eigenvalue problem, but could not find a suitable one.
Is there any way to solve it using Owl? If not, will Owl provide it in future? Or Do I miss somthing?

@ryanrhymes
Copy link
Member

ryanrhymes commented Apr 5, 2017

Hi @wkwkes

you are right, there wasn't any yet, but it is very easy to add actually. I added four functions a moment ago and you can try them out if you are using docker image or build from master branch yourself.

The four functions in Linalg module are

val eigen_symm : mat_d -> mat_d    (* real symmetric, returns eigenvalues *)
val eigen_symmv : mat_d -> mat_d * mat_d    (* real symmetric, returns eigenvalues and vectors *)
val eigen_nonsymm : mat_d -> mat_z    (* real asymmetric, returns eigenvalues *)
val eigen_nonsymmv : mat_d -> mat_z * mat_z    (* real symmetric, returns eigenvalues and vectors *)

Here is an example:

let x = Mat.semidef 4;;
let v, z = Linalg.eigen_symmv x;;

let z' = Linalg.inv z;;
Mat.(z' $@ x $@ z);;

I hope this suits your need for the time being. The linalg module will be redesigned soon in the future to provide better apis :)

@wkwkes
Copy link
Author

wkwkes commented Apr 5, 2017

This is what I wanted.
Thank you for the so quick response!

@wkwkes wkwkes closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants