public static void GetSymmetricSvd(SMat3 a, SMat3 vtav, Mat3 v, double tol, int max_sweeps) { vtav.SetSymmetric(a); v.Set(1, 0, 0, 0, 1, 0, 0, 0, 1); double delta = tol * MatUtils.Norm(vtav); for (int i = 0; i < max_sweeps && MatUtils.off(vtav) > delta; ++i) { Rotate01(vtav, v); Rotate02(vtav, v); Rotate12(vtav, v); } }
public static void getSymmetricSvd(SMat3 a, SMat3 vtav, Mat3 v, float tol, int max_sweeps) { vtav.setSymmetric(a); v.set(1, 0, 0, 0, 1, 0, 0, 0, 1); float delta = tol * MatUtils.fnorm(vtav); for (int i = 0; i < max_sweeps && MatUtils.off(vtav) > delta; ++i) { rotate01(vtav, v); rotate02(vtav, v); rotate12(vtav, v); } }
public static void getSymmetricSvd(SMat3 a, out SMat3 vtav, out Mat3 v, float tol, int max_sweeps) { vtav = new SMat3(); v = new Mat3(); vtav.setSymmetric(a); v.set(1, 0, 0, 0, 1, 0, 0, 0, 1); float delta = tol * MatUtils.fnorm(vtav); for (int i = 0; i < max_sweeps && MatUtils.off(vtav) > delta; ++i) { Schur2.rotate01(out vtav, out v, vtav, v); Schur2.rotate02(out vtav, out v, vtav, v); Schur2.rotate12(out vtav, out v, vtav, v); } }