Skip to content

It's possible to construct integer matrices that are not matrices #4885

@james-d-mitchell

Description

@james-d-mitchell

As the title suggests, it's possible to create matrices over the integers, which are non-rectangular (i.e. not matrices), which think they are:

Observed behaviour

gap> Matrix(Integers, [[1, 1], [2]]);
<2x2-matrix over Integers>
gap> Display(last);
<2x2-matrix over Integers:
[[ 1, 1 ]
 [ 2 ]
]>
gap> x[2, 2] := 4;
4
gap> Display(x);
<2x2-matrix over Integers:
[[ 1, 1 ]
 [ 2, 4 ]
]>
gap> x[2, 5] := 0;
0
gap> x;
<2x2-matrix over Integers>
gap> Display(x);
<2x2-matrix over Integers:
[[ 1, 1 ]
 [ 2, 4,,, 0 ]
]>
gap>

Expected behaviour

gap> Matrix(Integers, [[1, 1], [2]]);
Error,

Perhaps this is the intended behaviour, but at the very least the following should probably occur.

gap> x[2, 5] := 0;
Error,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions