JuliaLinearAlgebra / NonNegLeastSquares.jl

Some nonnegative least squares solvers in Julia
MIT License
46 stars 11 forks source link

Potential Logic Issue in nonneg_lsq() #35

Open hayakb95 opened 1 year ago

hayakb95 commented 1 year ago

If you try to call nonneg_lsq() with "gram = true" and "alg = pivot" then the logic will set "alg = pivot_cache". This will then force an error in the next logic block "throw(ArgumentError("Specified algorithm $alg not recognized."))" as "alg == :pivot_cache" doesn't appear anywhere. I think a simple fix for this is to have the first portion set "alg = pivot" (already done) and "variant = cache".

JeffFessler commented 1 year ago

Would you like to submit a PR that addresses it? Ideally with a test case that confirms that the fix works and doesn't break any other tests?