Singular value decomposition using Jacobi algorithm
[U,S,V] = svdj(A, tol)
[U,S,V] = svdj(A, tol) computes the quaternion singular value decomposition of A using a Jacobi algorithm, with tol as a tolerance to control the stopping point of the algorithm, which is iterative.
This function is primarily provided for test and verification purposes, since Jacobi algorithms are known to be accurate, although slow. For a faster computation use the svd function.
This function will work for real and complex matrices, as well as quaternion matrices. This makes possible verification of results using the adjoint function, since by this means a complex matrix may be constructed from a quaternion matrix and the singular values determined accurately. The code also exhibits specialised techniques that allow the same code to work on real, complex and quaternion data, which can be useful when developing experimental algorithms.
>> q = randq(4) q = 4x4 quaternion array >> svdj(q) ans = 2.9641 2.3497 1.2075 0.4849 >> svdj(adjoint(q)) ans = 2.9641 2.9641 2.3497 2.3497 1.2075 1.2075 0.4849 0.4849