ruby-numo / numo-linalg

Linear Algebra Library for Ruby/Numo::NArray
BSD 3-Clause "New" or "Revised" License
38 stars 9 forks source link

[Propose][Bugfix] Remove the disabled driver and uplo options from the LU factorization methods #16

Closed yoshoku closed 6 years ago

yoshoku commented 6 years ago

I would like to propose removing the driver and uplo options from the LU factorization methods since these options do not work.

> require 'numo/linalg/autoloader'
> a = Numo::DFloat.new(3, 3).rand
> a = 0.5 * (a + a.transpose)
> Numo::Linalg.lu_fact(a, driver: 'sym')
NoMethodError: undefined method `dsymtrf' for Numo::Linalg::Lapack:Module
...

I think that the method attempts to call the sytrf and hetrf functions in LAPACK. However, these functions perform not the LU factorization but the Bunch-Kaufman (or LDLt) factorization. In addition, the getrf functions, that are called when driver option is 'gen', can perform LU decomposition for symmetric matrix or Hermitian matrix.

From the above, I think that it is better to remove the driver option and associated uplo option from the LU factorization methods.