[Chapel Merge] LinearAlgebra.leastSquares()

Branch: refs/heads/master
Revision: 50284c3
Author: ben-albrecht
Log Message:

Merge pull request #15625 from ben-albrecht/LA-routines


Add LinearAlgebra.leastSquares based on numpy.linalg.lstsq.

Also in this PR:

  • Added tests for leastSquares()
  • Fixed a bug in LAPACK.gels{s,d,y} interface where the rank output variable was not available as a ref arg.
  • Added private machine epsilon helper functions to LinearAlgebra (work-around for https://github.com/chapel-lang/chapel/issues/14016)
  • Refactored some of LinearAlgebra/correctness/TestUtils.chpl
  • Added a vander function for generating Vandermonde matrices (useful for least squares user code)
    • Leaving undocumented for now, and will properly add it in a separate PR

Future work for this function:

  • Support overwrite=false argument
  • Support 2d b arrays
  • Make vander function public

[Reviewed by @e-kayrakli]

Modified Files:
A test/library/packages/LinearAlgebra/correctness/testLeastSquares.chpl
A test/library/packages/LinearAlgebra/correctness/testLeastSquares.good
M modules/packages/LAPACK.chpl
M modules/packages/LinearAlgebra.chpl
M test/library/packages/LinearAlgebra/correctness/TestUtils.chpl

Compare: https://github.com/chapel-lang/chapel/compare/01050429238e...50284c3953f3