It's hard to post the code because the function that generates the matrix A
is quite involved.
However, I tracked down the error. In fact the problem was that whereas
before I had
*val = eigmin(full(A))*
I was now trying to do
*val = eigs(A, nev=1, which=:SM) *
Which of course fails because eigs does not return a single value. So now I
have come up with the "nice" construct
*real(eigs(A, nev=1, which=:SR, ritzvec=false)[1][1])*
which seems to give the same results as before.
However, I still see two issues here:
1. my matrix A is Hermitian, and I don't know if this info is used by eigs,
or weather indeed it would make any difference (performance-wise)
2. using eigs like this instead of eigmin on the full matrix seems to be a
few percent slower (i can provide timings if necessary). Is that to be
expected?
On Thursday, April 9, 2015 at 8:15:19 PM UTC+2, Viral Shah wrote:
>
> Could you post a self-sufficient code so that the errors can be reproduced?
>
> -viral
>
> On Thursday, April 9, 2015 at 11:40:00 PM UTC+5:30, Andrei Berceanu wrote:
>>
>> I now get
>>
>>
>>
>> *CHOLMOD warning: not positive definiteERROR: `-` has no method matching
>> -(::(Array{Complex{Float64},1},Array{Complex{Float64},2},Int64,Int64,Int64,Array{Complex{Float64},1}),
>>
>> ::Float64)*
>> I must probably mention that I generate my sparse matrix using this
>> constructor: *sparse(I,J,V)*, with
>>
>>
>>
>> * I = Array(Int64,N) J = Array(Int64,N) V =
>> Array(Complex{Float64},N)*
>> On Thursday, April 9, 2015 at 7:53:32 PM UTC+2, Alex wrote:
>>>
>>> Try
>>>
>>> eigs(A, nev=1, which=:SM)
>>>
>>> You might want to look into the docs to see the other keywords, for
>>> example if you need the eigenvector(s) as well.
>>>
>>> Best,
>>>
>>> Alex.
>>>
>>> On Thursday, 9 April 2015 19:34:40 UTC+2, Andrei Berceanu wrote:
>>> > How can I get the minimum eigenvalue of a sparse matrix?
>>> > I found eigmin(A), but it only seems to work on dense matrices.
>>> > ERROR: `eigmin` has no method matching
>>> eigmin(::SparseMatrixCSC{Complex{Float64},Int64})
>>>
>>>