viennacl / pyviennacl-dev

Developer repository for PyViennaCL. Visit http://viennacl.sourceforge.net/ for latest releases.
MIT License
32 stars 6 forks source link

Trouble with eigenvalues and lanczos-tag #11

Closed wolfgangp closed 10 years ago

wolfgangp commented 10 years ago

When I do:

import pyviennacl as cl
gpuA = cl.Matrix( np.diag((1.,2.,3.)) )
tag = cl.linalg.lanczos_tag(num_eig=3)
EigVals = cl.linalg.eig(gpuA, tag)

I get:

ArgumentError: Python argument types in
    pyviennacl._viennacl.eig(matrix_row_float, lanczos_tag)
did not match C++ signature:
    eig(viennacl::matrix<float, viennacl::column_major, 1u>, viennacl::linalg::power_iter_tag)
    eig(viennacl::matrix<double, viennacl::column_major, 1u>, viennacl::linalg::power_iter_tag)
    eig(viennacl::matrix<float, viennacl::row_major, 1u>, viennacl::linalg::power_iter_tag)
    eig(viennacl::matrix<double, viennacl::row_major, 1u>, viennacl::linalg::power_iter_tag)

I tried with power_iter_tag, too, and it works. But it's not what I need. Please advise.

Thanks for your effort! This is very promising stuff. Cheers, wolfgangp

tsmithe commented 10 years ago

Hi there,

thanks for the report. It looks like I had accidentally left that code path disabled during some testing earlier. I've re-enabled it now in the git master branch -- could you try that and see if it works?

I really ought to have a unit test for these bits; I'm surprised I missed it!

Cheers,

Toby

wolfgangp commented 10 years ago

Hi Toby, It's working fine now. wolfgangp

tsmithe commented 10 years ago

Great. I'll include the fix (and a unit test!) in the next release; for now, keep using the git version (it won't change much, if at all, over the next few months), and do report any more issues you encounter.

tsmithe commented 10 years ago

Hi wolfgangp -- just FYI: I realised that I had also failed to enable eigenvalue computations for sparse (compressed/coordinate) matrices, and I've now fixed that, too. If you need that functionality, you'll have to pull from git again!