Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d016277f authored by hhakim's avatar hhakim
Browse files

Add doctested example for pyfaust.fact.svdtj.

parent 35a385a1
Branches
Tags 3.37.3
No related merge requests found
Pipeline #834144 skipped
......@@ -131,8 +131,13 @@ def svdtj(M, nGivens=None, tol=0, order='ascend', relerr=True,
Examples:
>>> from pyfaust.fact import svdtj
>>> from numpy.random import rand
>>> M = rand(128,128)
>>> U,S,V = svdtj(M, 1024, nGivens_per_fac=64)
>>> import numpy as np
>>> from scipy.sparse import spdiags
>>> M = rand(16, 32)
>>> U, S, V = svdtj(M, 4096, enable_large_Faust=True)
>>> S_ = spdiags(S, [0], U.shape[0], V.shape[0])
>>> np.allclose(U@S_@V.H, M)
True
If we call svdtj on the matrix M, it makes two internal calls to eigtj.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment