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

Matrix object type: upper triangular matrices #5130

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d625c38
Start of new triangular matrices matrix obj type.
Oct 18, 2022
cd22d95
Name of new type.
Oct 18, 2022
3d27617
Finished constructor
Oct 18, 2022
84cb745
Remove errors
Oct 18, 2022
7717a51
MatObjTriangular: NewZeroMatrix
monschau Oct 18, 2022
52d2d43
finish unpack
Oct 18, 2022
7313631
All function bodies
Oct 19, 2022
d62f4c4
typo in constructor NewMatrix
monschau Oct 19, 2022
8dfad28
another typo in constructor NewMatrix
monschau Oct 19, 2022
82e6d7c
Modify entries
Oct 19, 2022
2345dcf
IsUpperTriangularMatrixRep: ShallowCopy and \=
monschau Oct 19, 2022
19b792d
Correct display function.
Oct 19, 2022
2f09040
MutableCopy, +, - and stuff (the easy things)
monschau Oct 19, 2022
d467db4
Merge branch 'MatrixObjUnipotentUpperTriangularMatrices' of https://g…
monschau Oct 19, 2022
e96290f
dimension and base domain checks for \+ and \-
monschau Oct 19, 2022
2f677e4
Adjust more functions
Oct 19, 2022
3ab9b45
Finish of selection of list operations.
Oct 19, 2022
8fe4319
Add multiplication.
Oct 19, 2022
b56edac
Start of multiplicitive inverse
Oct 19, 2022
aa6e7cf
Finished inverse mat.
Oct 19, 2022
1650f7a
Implement comments as PR #5121
Oct 20, 2022
3be636c
simplified [IsUpperTriangularMatrixRep, IsInt]
monschau Oct 20, 2022
9a47510
Merge branch 'MatrixObjUnipotentUpperTriangularMatrices' of https://g…
monschau Oct 20, 2022
0be15ad
Small improvement
Oct 20, 2022
1fab8a3
more NrCols in []
monschau Oct 20, 2022
8e77da6
Merge branch 'MatrixObjUnipotentUpperTriangularMatrices' of https://g…
monschau Oct 20, 2022
18b2adf
Simplify the code at some parts
Oct 20, 2022
1708e28
Unpack upper triangular using CopyListEntries
monschau Oct 20, 2022
f6907e9
Merge branch 'MatrixObjUnipotentUpperTriangularMatrices' of https://g…
monschau Oct 20, 2022
c25edc1
typo in CopySubMatrix: mat -> m
monschau Oct 20, 2022
f3b08fd
simplified Display
monschau Oct 20, 2022
82db578
speed improvements for *; still slower than traditional lists-of-lists
monschau Oct 20, 2022
4ba5cc5
Solve merge conflict
Oct 20, 2022
6759aa1
Adjust documentary
Oct 20, 2022
3f330dd
introduced the sum variable in multiplication again
monschau Oct 20, 2022
44524c3
Merge branch 'MatrixObjUnipotentUpperTriangularMatrices' of https://g…
monschau Oct 20, 2022
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
73 changes: 73 additions & 0 deletions lib/matobjtriangularmatrices.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#############################################################################
##
## 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.
##

############################################################################
#
# This is an implementation for nxn triangular matrices
# stored as a flat element list. In this
# file the representation, types and global
# functions are declared.


#############################################################################
##
## <#GAPDoc Label="IsUpperTriangularMatrixRep">
## <ManSection>
## <Filt Name="IsUpperTriangularMatrixRep" Arg='obj' Type="representation"/>
##
## <Description>
## An object <A>obj</A> in <Ref Filt="IsUpperTriangularMatrixRep"/> describes
## a matrix object that stores the matrix entries as a flat list of an
## upper triangular matrix, i.e. obj[i,j] = 0 for j < i. It is
## internally represented as a positional object
## (see <Ref Filt="IsPositionalObjectRep"/> that stores 4 entries:
## <Enum>
## <Item>
## its base domain
## (see <Ref Attr="BaseDomain" Label="for a matrix object"/>),
## </Item>
## <Item>
## the number of rows (see <Ref Attr="NumberRows" Label="for a matrix object"/>),
## </Item>
## <Item>
## the number of columns
## (see <Ref Attr="NumberColumns" Label="for a matrix object"/>), and
## </Item>
## <Item>
## a plain list (see <Ref Filt="IsPlistRep"/> of its entries.
## </Item>
## </Enum>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
# Here we declare the new representation and tell GAP which properties it
# implies. IsUpperTriangularMatrixRep e.g. are positional objects and so on.
DeclareRepresentation( "IsUpperTriangularMatrixRep",
IsMatrixObj and IsMatrixOrMatrixObj and IsPositionalObjectRep
and IsNoImmediateMethodsObject
and HasNumberRows and HasNumberColumns
and HasBaseDomain and HasOneOfBaseDomain and HasZeroOfBaseDomain,
[] );

# If we implement our object as a positional object we often have to access its
# properties in the code. To make that more readable we declare global
# variables. If you do this too make sure you use variables that are unique and
# unlikely to be used someplace else, even though that might mean using longer
# names. Here we prefixed the names with the name of the representation. See
# also Reference Manual Chapter 79 for more information about Objects.

# Some constants for matrix access:
# Position in the positional object of the base domain
BindConstant( "UPPERTRIANGULARMATREP_BDPOS", 1 );
# Position in the positional object of the number of rows and columns
BindConstant( "UPPERTRIANGULARMATREP_NRPOS", 2 );
# Position in the positional object of the list of entries
BindConstant( "UPPERTRIANGULARMATREP_ELSPOS", 3 );
Loading