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

MatrixObj doesn't check the ncols - while creating #5135

Open
mihalova opened this issue Oct 19, 2022 · 0 comments
Open

MatrixObj doesn't check the ncols - while creating #5135

mihalova opened this issue Oct 19, 2022 · 0 comments
Labels
gapdays2022-summer Issues and PRs that arose at https://www.gapdays.de/gapdays2022-summer kind: bug Issues describing general bugs, and PRs fixing them

Comments

@mihalova
Copy link
Contributor

Observed behaviour

I created the MatrixObj with the command Matrix( R, list, ncols ). As list I put an 1x3 matrix, but for the ncols parameter I put 4. However, the MatrixObj was created. I tried to access the element (1,4) and GAP gave me an error.

Expected behaviour

I would expect either change in the ncols parameter or adding an empty elements to the matrix.

GAP example

gap> mat:=Matrix(Integers, [[1,2,3]], 4); 
<1x4-matrix over Integers>
gap> Print(mat);
NewMatrix(IsPlistMatrixRep,Integers,4,[ [ 1, 2, 3 ] ])
gap> mat[1,4];
Error, List Element: <list>[4] must have an assigned value in
  return m![ROWSPOS][row]![ELSPOS][col]
 ; at /Users/dominika/gap-4.12.0/lib/matobjplist.gi:824 called from 
<function "MatElm for a plist matrix and two positions">( <arguments> )
 called from read-eval loop at *stdin*:129
type 'quit;' to quit to outer loop
@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them gapdays2022-summer Issues and PRs that arose at https://www.gapdays.de/gapdays2022-summer labels Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gapdays2022-summer Issues and PRs that arose at https://www.gapdays.de/gapdays2022-summer kind: bug Issues describing general bugs, and PRs fixing them
Projects
None yet
Development

No branches or pull requests

2 participants