@@ -66,13 +66,13 @@ function Base.show(io::IO, r::LOBPCGResults)
66
66
@printf io " Results of LOBPCG Algorithm\n "
67
67
@printf io " * Algorithm: LOBPCG - CholQR\n "
68
68
69
- if length (join (r. λ, " ," )) < 40
69
+ if length (join (r. λ, " ," )) < 40 || length (r . λ) <= 2
70
70
@printf io " * λ: [%s]\n " join (r. λ, " ," )
71
71
else
72
72
@printf io " * λ: [%s, ...]\n " join (first_two (r. λ), " ," )
73
73
end
74
74
75
- if length (join (r. residual_norms, " ," )) < 40
75
+ if length (join (r. residual_norms, " ," )) < 40 || length (r . residual_norms) <= 2
76
76
@printf io " * Residual norm(s): [%s]\n " join (r. residual_norms, " ," )
77
77
else
78
78
@printf io " * Residual norm(s): [%s, ...]\n " join (first_two (r. residual_norms), " ," )
@@ -81,7 +81,6 @@ function Base.show(io::IO, r::LOBPCGResults)
81
81
@printf io " * Iterations: %s\n " r. iterations
82
82
@printf io " * Converged: %s\n " r. converged
83
83
@printf io " * Iterations limit: %s\n " r. maxiter
84
- @printf io " * Reached Maximum Number of Iterations: %s\n " r. iterations >= r. maxiter
85
84
86
85
return
87
86
end
@@ -686,6 +685,12 @@ Finds the k extremal eigenvalues and their corresponding eigenvectors satisfying
686
685
function lobpcg (A, largest:: Bool , X0:: Union{AbstractMatrix, AbstractVector} ; kwargs... )
687
686
lobpcg (A, nothing , largest, X0; kwargs... )
688
687
end
688
+ function lobpcg (A, largest:: Bool , nev:: Int = 1 ; kwargs... )
689
+ lobpcg (A, nothing , largest, nev; kwargs... )
690
+ end
691
+ function lobpcg (A, B, largest:: Bool , nev:: Int = 1 ; kwargs... )
692
+ lobpcg (A, B, largest, rand (size (A, 1 ), nev); kwargs... )
693
+ end
689
694
function lobpcg (A, B, largest, X0;
690
695
log= false , P= nothing , C= nothing ,
691
696
tol= nothing , maxiter= 200 )
0 commit comments