Goto Chapter: Top 1 2 3 4 A Bib Ind

### 3 GaussForHomalg methods and functions

#### 3.1 The Tools

Please note that there are more tool functions you can define, GaussForHomalg just provides homalg with a sufficient subset. This varies with the type and complexity of the rings you want to define. On the other hand, ImportMatrix (3.1-4) is a function specifically designed for GaussForHomalg.

##### 3.1-1 ZeroMatrix
 ‣ ZeroMatrix( C ) ( function )

Returns: a sparse matrix

This returns a sparse matrix with the same dimensions and base ring as the homalg matrix C.

##### 3.1-2 IdentityMatrix
 ‣ IdentityMatrix( C ) ( function )

Returns: a sparse matrix

This returns a sparse $$n \times n$$ identity matrix with the same ring as the homalg matrix C, $$n$$ being the number of rows of C.

##### 3.1-3 CopyMatrix
 ‣ CopyMatrix( C ) ( function )

Returns: a sparse matrix

This returns a sparse matrix which is a shallow copy of the sparse matrix stored in the Eval attribute of the homalg matrix C.

##### 3.1-4 ImportMatrix
 ‣ ImportMatrix( M, R ) ( function )

Returns: a sparse matrix

This returns the sparse version of the GAP matrix M over the ring R. It prevents homalg from calling sparse matrix algorithms on dense GAP matrices. Note that this is not a "standard" tool but neccessary because of the new data type.

##### 3.1-5 Involution
 ‣ Involution( M ) ( function )

Returns: a sparse matrix

This returns a sparse matrix which is the transpose of the sparse matrix stored in the Eval attribute of the homalg matrix M.

##### 3.1-6 CertainRows
 ‣ CertainRows( M, plist ) ( function )

Returns: a sparse matrix

This returns the rows in plist of the sparse matrix stored in the Eval attribute of the homalg matrix M as a new matrix.

##### 3.1-7 CertainColumns
 ‣ CertainColumns( M, plist ) ( function )

Returns: a sparse matrix

This returns the columns in plist of the sparse matrix stored in the Eval attribute of the homalg matrix M as a new matrix.

##### 3.1-8 UnionOfRows
 ‣ UnionOfRows( A, B ) ( function )

Returns: a sparse matrix

This returns the sparse matrix created by concatenating the rows of the sparse matrices stored in the Eval attributes of the homalg matrices A and B.

##### 3.1-9 UnionOfColumns
 ‣ UnionOfColumns( A, B ) ( function )

Returns: a sparse matrix

This returns the sparse matrix created by concatenating the columns of the sparse matrices stored in the Eval attributes of the homalg matrices A and B.

##### 3.1-10 DiagMat
 ‣ DiagMat( e ) ( function )

Returns: a sparse matrix

This method takes a list e of homalg matrices and returns the sparse block matrix of the matrices stored in the Eval attributes of the matrices in e.

##### 3.1-11 KroneckerMat
 ‣ KroneckerMat( A, B ) ( function )

Returns: a sparse matrix

This returns the sparse Kronecker matrix of the matrices stored in the Eval attributes of the homalg matrices A and B.

##### 3.1-12 Compose
 ‣ Compose( A, B ) ( function )

Returns: a sparse matrix

This returns the matrix product of the sparse matrices stored in the Eval attributes of the homalg matrices A and B.

##### 3.1-13 NrRows
 ‣ NrRows( C ) ( function )

Returns: an integer

This returns the number of rows of the sparse matrix stored in the Eval attribute of the homalg matrix C.

##### 3.1-14 NrColumns
 ‣ NrColumns( C ) ( function )

Returns: an integer

This returns the number of columns of the sparse matrix stored in the Eval attribute of the homalg matrix C.

##### 3.1-15 IsZeroMatrix
 ‣ IsZeroMatrix( C ) ( function )

Returns: or

This returns if the sparse matrix stored in the Eval attribute of the homalg matrix C is a zero matrix, and otherwise.

##### 3.1-16 IsDiagonalMatrix
 ‣ IsDiagonalMatrix( C ) ( function )

Returns: or

This returns if the sparse matrix stored in the Eval attribute of the homalg matrix C is a diagonal matrix, and otherwise.

##### 3.1-17 ZeroRows
 ‣ ZeroRows( C ) ( function )

Returns: a list

This returns the list of zero rows of the sparse matrix stored in the Eval attribute of the homalg matrix C.

##### 3.1-18 ZeroColumns
 ‣ ZeroColumns( C ) ( function )

Returns: a list

This returns the list of zero columns of the sparse matrix stored in the Eval attribute of the homalg matrix C.

#### 3.2 The Basic Functions and homalg table creation

##### 3.2-1 DecideZeroRows
 ‣ DecideZeroRows( A, B ) ( function )

Returns: a homalg matrix

This returns the homalg matrix you get by row reducing the homalg matrix A with the homalg matrix B.

##### 3.2-2 DecideZeroRowsEffectively
 ‣ DecideZeroRowsEffectively( A, B, T ) ( function )

Returns: a homalg matrix M

This returns the homalg matrix M you get by row reducing the homalg matrix A with the homalg matrix B. The transformation matrix is stored in the void homalg matrix T as a side effect. The matrices satisfy $$M = A + T * B$$.

##### 3.2-3 SyzygiesGeneratorsOfRows
 ‣ SyzygiesGeneratorsOfRows( M ) ( function )

Returns: a homalg matrix

This returns the row syzygies of the homalg matrix M, again as a homalg matrix.

##### 3.2-4 RelativeSyzygiesGeneratorsOfRows
 ‣ RelativeSyzygiesGeneratorsOfRows( M, N ) ( function )

Returns: a homalg matrix

The row syzygies of M are returned, but now the computation interpretes the rows of the homalg matrix N as additional zero relations.

##### 3.2-5 RowReducedEchelonForm
 ‣ RowReducedEchelonForm( M[, U] ) ( function )

Returns: a homalg matrix N

If one argument is given, this returns the triangular basis (reduced row echelon form) of the homalg matrix M, again as a homalg matrix. In case of two arguments, still only the triangular basis of M is returned, but the transformation matrix is stored in the void homalg matrix U as a side effect. The matrices satisfy $$N = U * M$$.

##### 3.2-6 CreateHomalgTable
 ‣ CreateHomalgTable( R ) ( function )

Returns: a homalg table

This returns the homalg table of what will become the homalg ring R (at this point R is just a homalg object with some properties for the method selection of CreateHomalgTable). This method includes the needed functions stored in the global variables CommonHomalgTableForGaussTools and CommonHomalgTableForGaussBasic, and can add some more to the record that will become the homalg table.

#### 3.3 Matrix entry manipulation

This is just support for the sparse matrix data type.

##### 3.3-1 MatElm
 ‣ MatElm( M, r, c, R ) ( method )

Returns: M[r,c]

If the Eval attribute of the homalg matrix M over the homalg ring R is sparse, this calls the corresponding Gauss command GetEntry.

##### 3.3-2 SetMatElm
 ‣ SetMatElm( M, r, c, e, R ) ( method )

Returns: nothing

If the Eval attribute of the homalg matrix M over the homalg ring R is sparse, this calls the corresponding Gauss command GetEntry, to achieve M[r,c]:=e.

 ‣ AddToMatElm( M, r, c, e, R ) ( method )
If the Eval attribute of the homalg matrix M over the homalg ring R is sparse, this calls the corresponding Gauss command AddToEntry, to achieve M[r,c] := M[r,c] + e.