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

add a nice short interesting example to README #127

Open
stylewarning opened this issue Mar 21, 2021 · 1 comment
Open

add a nice short interesting example to README #127

stylewarning opened this issue Mar 21, 2021 · 1 comment

Comments

@stylewarning
Copy link
Member

Add a nice, short, interesting computation using MAGICL to the very front of the README.

@stylewarning
Copy link
Member Author

One simple idea would be the power iteration:

(defun power-iteration (M &optional (n 15))
  (loop :with v := (magicl:rand (list (magicl:nrows M)))
        :repeat n
        :for w := (magicl:@ M v)
        :do (setf v (magicl:scale! w (/ (magicl:norm w))))
        :finally (return v)))

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

1 participant