public static void GetSymmetricSvd(ref SMat3 a, ref SMat3 vtav, ref Mat3 v, float tol, int max_sweeps) { vtav.SetSymmetric(a); v.Set(1, 0, 0, 0, 1, 0, 0, 0, 1); float delta = tol * vtav.Fnorm(); for (int i = 0; i < max_sweeps && vtav.Off() > delta; i++) { Rotate01(ref vtav, ref v); Rotate02(ref vtav, ref v); Rotate12(ref vtav, ref v); } }