Mentions légales du service

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

Minor changes about hermitian prop. checking (eigtj) and doc.

parent d57ff3f3
Branches
Tags
No related merge requests found
......@@ -15,7 +15,7 @@
%> &nbsp;&nbsp;&nbsp; @b eigtj(M, J, 'nGivens_per_fac', t, 'tol', 0.01, 'relerr', true) Uses a stopping criterion based on relative squared error norm(V*D*V'-M, 'fro')^2/norm(M, 'fro')^2. This criterion is concurrent to maxiter (here J).<br/>
%> &nbsp;&nbsp;&nbsp; @b eigtj(M, J, 'nGivens_per_fac', t, 'tol', 0.01, 'relerr', true) Uses a stopping criterion based on absolute squared error norm(V*D*V'-M, 'fro')^2. This criterion is concurrent to maxiter (here J).<br/>
%>
%> @param M the matrix to diagonalize. Must be real and symmetric.
%> @param M the matrix to diagonalize. Must be real and symmetric or hermitian.
%> @param maxiter defines the number of Givens rotations that are computed in eigenvector transform V. The number of rotations per factor of V is defined by nGivens_per_fac.
%> @param 'nGivens_per_fac', integer the number of Givens rotations per factor of V, must be an integer between 1 to floor(size(M, 1)/2) which is the default value.
%> @param 'tol', number (optional) the tolerance error under what the algorithm stops. By default, it's zero for not stopping on error criterion.
......
......@@ -5,7 +5,7 @@
%> @b Usage
%> &nbsp;&nbsp;&nbsp; @b See fact.eigtj
%>
%> @param Lap the Laplacian matrix (which is symmetric).
%> @param Lap the Laplacian matrix (which is symmetric or hermitian).
%> @param maxiter see fact.eigtj
%> @param 'nGivens_per_fac', integer see fact.eigtj
%> @param 'tol', number see fact.eigtj
......
......@@ -183,7 +183,7 @@ def fgft_givens(Lap, maxiter, tol=0.0, relerr=True, nGivens_per_fac=None,
eigtj, fgft_palm
"""
if(nGivens_per_fac == None): nGivens_per_fac = int(Lap.shape[0]/2)
if((isinstance(Lap, np.ndarray) and (Lap.T != Lap).any()) or Lap.shape[0] != Lap.shape[1]):
if((isinstance(Lap, np.ndarray) and (np.matrix(Lap).H != Lap).any()) or Lap.shape[0] != Lap.shape[1]):
raise ValueError(" the matrix/array must be square and should be symmetric.")
if(not isinstance(maxiter, int)): raise TypeError("maxiter must be a int")
if(maxiter < 1): raise ValueError("maxiter must be >= 1")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment