Last active
June 30, 2017 23:49
-
-
Save ryanrhymes/94ee2fb392062f64ee7794d09b052835 to your computer and use it in GitHub Desktop.
owl linalg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let x = Mat.uniform 4 4;; | |
let x = Mat.symmetric x;; | |
let v, w = Linalg.D.eig x;; | |
let w = Dense.Matrix.Z.re w;; | |
let v = Dense.Matrix.Z.re v;; | |
let v0 = Mat.col v 0;; | |
let a = Mat.(x *@ v0);; | |
let b = Mat.(v0 *$ w.{0,0});; | |
Mat.(a =~ b);; | |
let x = Mat.uniform 4 4;; | |
let v, w = Linalg.D.eig x;; | |
let k = 1;; | |
let vk = Dense.Matrix.Z.col v k;; | |
let x = Dense.Matrix.Z.complex x (Mat.zeros 4 4);; | |
let a = Dense.Matrix.Z.(x *@ vk);; | |
let b = Dense.Matrix.Z.(vk *$ w.{0,k});; | |
Mat.(a =~ b);; | |
let x = Mat.uniform 2000 2000;; | |
let f () = Linalg.D.eig x;; | |
Utils.time f;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment