Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatObj: inconsistent ordering of parameters in Matrix and NewMatrix #4549

Open
cdwensley opened this issue Jun 8, 2021 · 1 comment
Open
Assignees
Labels
kind: quirk Issues that are not bugs, but a discrepancy between user expectation and system behavior

Comments

@cdwensley
Copy link
Contributor

The two methods in matobj.gi have the following form:
NewMatrix( filt, R, ncols, list ) and Matrix( filt, R, list, ncols ).
This inconsistency is unacceptable in the long run.
Since the former is the order used by Print, the Matrix method needs to be redefined.
If this is agreed I'm happy to attempt a PR.

@fingolfin fingolfin added the kind: quirk Issues that are not bugs, but a discrepancy between user expectation and system behavior label Jun 10, 2021
@fingolfin
Copy link
Member

Indeed that's bad. So we should pick one order, and implement & document that for both. The "other" variant should ideally be left in to provide backwards compatibility.

Thing is, there are actually more related variants to consider:

  • Matrix( R, list, ncols )
  • Matrix( list, ncols, M )
  • Matrix( list, ncols )

Given this, the natural thing would be to adjust NewMatrix. Unfortunately, we then can't provide a "default backwards compatibility method" (see also issue #4366 for background and a potential path forward). However, right now only the GAP library plus one package (cvec) provide NewMatrix methods, and I can at any time make a new cvec release, so I think we are good here.

Some more data to support all this: I looked at all distributed packages using NewMatrix and Matrix. Here are my findings:

First, for NewMatrix:

  • cvec installs methods for NewMatrix so of course also this kind; it also uses Matrix (but as I mentioned, I can always make a new release of it, so no problem there)
  • fining extensively uses NewMatrix, including the variant listed here
  • nothing else uses NewMatrix, yay (but of course people can have private, unpublished code)

Next, Matrix:

  • YangBaxter installs methods for Matrix, but they are unrelated to MatrixObj, so this can be ignored
  • cvec installs a few Matrix methods (but unrelated to this issue), but that's fine; it also uses some alls with the list, ncols order
  • semigroups uses Matrix extensively and provides a several methods for it (it actually does not provide a NewMatrix method, which it really should; but that's on us for not providing clear docs on this for far too long)
  • orb contains one call: Matrix([],NrCols(inv),inv)
  • recog contains a few commented out calls

Anyway, this data also supports that we should change NewMatrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: quirk Issues that are not bugs, but a discrepancy between user expectation and system behavior
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants