Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ab613e3
Add IsFlatPlistMatrixRep matrix object type
fingolfin Apr 12, 2026
c7ce377
hook up documentation
fingolfin Apr 14, 2026
cd615d8
Fix gaplint warnings
fingolfin Apr 14, 2026
20cb5d9
Make tst/testspecial/method-not-found-where.g more robust
fingolfin Apr 14, 2026
bfeea74
address some review comments
fingolfin Apr 14, 2026
4c8e15a
Remove CopyFlatPlistMatrixRow
fingolfin Apr 14, 2026
ec0d2fe
Rename IsFlatPlistMatrixRep to IsGenericMatrixRep
fingolfin Apr 16, 2026
ce80685
Rename files matobjflatplist -> matobjgeneric
fingolfin Apr 16, 2026
d3850ea
Inline InverseRowsForFlatPlistMatrix
fingolfin Apr 17, 2026
ec8d4ea
MakeIsGenericMatrixRep requires plist
fingolfin Apr 17, 2026
779cd77
Tighten MakeIsGenericMatrixRep
fingolfin Apr 17, 2026
9b59c1a
Inverse should error, not return fail
fingolfin Apr 17, 2026
9021a26
Generalize vec*mat and mat*vec
fingolfin Apr 17, 2026
3b20fa9
More tests
fingolfin Apr 17, 2026
8a2fe0c
Unify matobj family code
fingolfin Apr 17, 2026
33779c5
More tests
fingolfin Apr 17, 2026
0cac33b
Simplify code
fingolfin Apr 17, 2026
7f2e2a4
Yet more filter/family code simplification
fingolfin Apr 17, 2026
f246b18
more test coverage
fingolfin Apr 17, 2026
a7ea309
oops
fingolfin Apr 17, 2026
6abd94f
cleanup
fingolfin Apr 17, 2026
1ba59c4
some tweaks
fingolfin Apr 20, 2026
a2ea205
revert a family change
fingolfin Apr 20, 2026
66b8073
Inverse: return fail if matrix is square but not invertible
fingolfin Apr 26, 2026
1251b9a
Remove MakeImmutable call from NewMatrix method.
fingolfin Apr 26, 2026
b1ec800
fixup! Inverse: return fail if matrix is square but not invertible
fingolfin Apr 26, 2026
e462642
adjust test output
fingolfin Apr 26, 2026
b188d8b
Adjust ChangedBaseDomain result mutability
fingolfin Apr 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions benchmark/matobj/bench-matelm-access.g
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,23 @@ RunMatTest := function(desc, m)
TestWritingMatrix(m);
end;

m:=IdentityMat(10);;
RunMatTest("integer matrix", m);
m:=IdentityMat(10,GF(257));; # plain list of plain lists
RunMatTest("GF(257) plist-of-plist matrix", m);

m:=IdentityMat(10,GF(2));;
m:=IdentityMatrix(GF(257), 10); # IsPlistMatrixRep
RunMatTest("GF(257) IsPlistMatrixRep", m);

m:=IdentityMatrix(GF(257), 10); # IsFlatPlistMatrixRep
RunMatTest("GF(257) IsFlatPlistMatrixRep", m);

m:=IdentityMat(10,GF(2));; # plain list of IsGF2VectorRep
RunMatTest("GF(2) rowlist", m);

m:=IdentityMat(10,GF(2));; ConvertToMatrixRep(m);;
m:=IdentityMatrix(GF(2), 10); # IsGF2MatrixRep
RunMatTest("GF(2) compressed matrix", m);

m:=IdentityMat(10,GF(7));;
m:=IdentityMat(10,GF(7));; # plain list of Is8BitVectorRep
RunMatTest("GF(7) rowlist", m);

m:=IdentityMat(10,GF(7));; ConvertToMatrixRep(m);;
m:=IdentityMatrix(GF(7), 10); # Is8BitMatrixRep
RunMatTest("GF(7) compressed matrix", m);
13 changes: 9 additions & 4 deletions benchmark/matobj/bench-matobj-creation.g
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,23 @@ RunMatTest := function(desc, ring)
TestCreatingMatrix(ring);
end;

RunMatTest("GF(2)", GF(2));
RunMatTest("Rationals", Rationals);

RunMatObjTest := function(desc, filter, ring)
Print("\n");
PrintBoxed(Concatenation("Testing ", desc));
TestCreatingMatrixObj(filter, ring);
end;

RunMatObjTest("GF(2) IsPlistMatrixRep", IsPlistMatrixRep, GF(2));
RunMatTest("GF(257)", GF(257));
RunMatObjTest("GF(257) IsPlistMatrixRep", IsPlistMatrixRep, GF(257));
RunMatObjTest("GF(257) IsFlatPlistMatrixRep", IsFlatPlistMatrixRep, GF(257));

RunMatTest("Integers", Integers);
RunMatObjTest("integer IsPlistMatrixRep", IsPlistMatrixRep, Integers);
RunMatObjTest("integer IsFlatPlistMatrixRep", IsFlatPlistMatrixRep, Integers);

RunMatTest("Rationals", Rationals);
RunMatObjTest("rational IsPlistMatrixRep", IsPlistMatrixRep, Rationals);
RunMatObjTest("rational IsFlatPlistMatrixRep", IsFlatPlistMatrixRep, Rationals);

# TODO: other reps
# TODO: other compare with creating plist-of-plist
1 change: 1 addition & 0 deletions doc/ref/matobj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ described in this chapter is supported.
<#Include Label="IsGF2MatrixRep">
<#Include Label="Is8BitMatrixRep">
<#Include Label="IsPlistMatrixRep">
<#Include Label="IsFlatPlistMatrixRep">
<#Include Label="IsZmodnZMatrixRep">

</Section>
Expand Down
46 changes: 46 additions & 0 deletions lib/matobjflatplist.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#############################################################################
##
## This file is part of GAP, a system for computational discrete algebra.
##
## SPDX-License-Identifier: GPL-2.0-or-later
##
## Copyright of GAP belongs to its developers, whose names are too numerous
## to list here. Please refer to the COPYRIGHT file for details.
##

############################################################################
#
# Dense matrix objects backed by plain lists of plain row lists.
#

#############################################################################
##
## <#GAPDoc Label="IsFlatPlistMatrixRep">
Comment thread
fingolfin marked this conversation as resolved.
Outdated
## <ManSection>
## <Filt Name="IsFlatPlistMatrixRep" Arg='obj' Type="Representation"/>
##
## <Description>
## An object <A>obj</A> in <Ref Filt="IsFlatPlistMatrixRep"/> describes
## a matrix object (see <Ref Filt="IsMatrixObj"/>) whose entries are stored
## as a dense plain list of dense plain row lists.
## <P/>
## This representation is optimized for efficient entry access via
## <M>M[i,j]</M>. Unlike <Ref Filt="IsPlistMatrixRep"/>, it is not a row
## list matrix, so direct row access via <M>M[i]</M> is not supported.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareRepresentation( "IsFlatPlistMatrixRep",
IsMatrixObj and IsPositionalObjectRep
and IsCopyable
and IsNoImmediateMethodsObject
and HasNumberRows and HasNumberColumns
and HasBaseDomain and HasOneOfBaseDomain and HasZeroOfBaseDomain,
[] );


# Internal positions for flat plist matrices.
BindConstant( "FBDPOS", 1 );
BindConstant( "FCOLSPOS", 2 );
BindConstant( "FROWSPOS", 3 );
Loading
Loading