[Chapel Merge] Improve LinearAlgebra.Matrix() for heterogeneous v

Branch: refs/heads/main
Revision: dbfcb68
Author: bradcray
Link: Improve LinearAlgebra.Matrix() for heterogeneous varargs arrays by bradcray · Pull Request #20718 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20718 from bradcray/fix-lin-alg-het-matrix

Improve LinearAlgebra.Matrix() for heterogeneous varargs arrays

[reviewed by @benharsh — thanks!]

In Determine eltType from "most general type" for all array elements · Issue #8196 · chapel-lang/chapel · GitHub
@ghbrown provided some compelling examples that did not compile today
even once we added better support for heterogeneous array literals as
requested in Determine eltType from "most general type" for all array elements · Issue #8196 · chapel-lang/chapel · GitHub and provided in Richer array literal element type inference by bradcray · Pull Request #20563 · chapel-lang/chapel · GitHub. This PR attempts to improve
the signatures and implementations of these routines to support more
general matrix specifications.

One downside of enabling this heterogeneity is that it turns a parallel loop that initializes
the matrix with the arrays representing the rows into a param loop. That said, this only
happens if the arrays themselves are heterogeneous. Which is to say, if you have a
bunch of heterogeneous arrays that mix ints/reals, but they all unify to "array of real",
you'll stay in the parallel loop case.

While here, I also noticed and fixed a case where we hadn't updated from 1-based
to 0-based indices for tuple indexing. :%

Modified Files:
A test/library/packages/LinearAlgebra/correctness/matrices/issue8196-comment5.chpl

A test/library/packages/LinearAlgebra/correctness/matrices/issue8196-comment5.good
A test/library/packages/LinearAlgebra/correctness/matrices/issue8196-op.chpl
A test/library/packages/LinearAlgebra/correctness/matrices/issue8196-op.good
M modules/packages/LinearAlgebra.chpl

Compare: https://github.com/chapel-lang/chapel/compare/739321635a05...dbfcb6876b5c