viennacl / viennacl-dev

Developer repository for ViennaCL. Visit http://viennacl.sourceforge.net/ for the latest releases.
Other
281 stars 89 forks source link

Iterative Solvers - Matrix Output? #274

Open cdeterman opened 5 years ago

cdeterman commented 5 years ago

It seems that almost all the solvers (i.e. A = xB) in ViennaCL return a vector result. The exception being the use of LU decomposition (example here). Whereas all the iterative solvers show a vector result see here. If I want the solution matrix of a real matrix with respect to the corresponding identity matrix I am currently using the combination of lu_factorize and lu_substitute. Is that currently the only option for the full matrix result or is there another way to use the functions or to use the returned vector result?

karlrupp commented 5 years ago

The LU factorization alters the input matrix, whereas the iterative solvers don't alter the matrix.

Conceivably one could add an overload of solve() with e.g. a lu_tag that carries out an LU factorization. However, I'm a bit concerned about potential misuses of such an interface (dense matrices used with iterative solvers, or sparse matrices used with lu_tag, for which there is no implementation).

cdeterman commented 5 years ago

@karlrupp wouldn't it be feasible to have a restriction on template types using something like static_assert or enable_if? That way an informed error could be thrown for the non-implemented sparse matrix type until such a time that one does exist?