GAP (GaussForHomalg) - Chapter 3: GaussForHomalg methods and functions

Goto Chapter: Top 1 2 3 4 A Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax on]

3 GaussForHomalg methods and functions
3.1 The field of rationals
3.1-1 HomalgFieldOfRationals
3.2 The Tools
3.2-1 ZeroMatrix
3.2-2 IdentityMatrix
3.2-3 CopyMatrix
3.2-4 ImportMatrix
3.2-5 Involution
3.2-6 CertainRows
3.2-7 CertainColumns
3.2-8 UnionOfRows
3.2-9 UnionOfColumns
3.2-10 DiagMat
3.2-11 KroneckerMat
3.2-12 DualKroneckerMat
3.2-13 Compose
3.2-14 NrRows
3.2-15 NrColumns
3.2-16 IsZeroMatrix
3.2-17 IsDiagonalMatrix
3.2-18 ZeroRows
3.2-19 ZeroColumns
3.3 The Basic Functions and homalg table creation
3.3-1 ReducedRowEchelonForm
3.3-2 CreateHomalgTable
3.4 Matrix entry manipulation
3.4-1 MatElm
3.4-2 SetMatElm
3.4-3 AddToMatElm

### 3 GaussForHomalg methods and functions

#### 3.1 The field of rationals

##### 3.1-1 HomalgFieldOfRationals

`‣ HomalgFieldOfRationals`( ) | ( function )

Returns: a homalg ring

The field of rationals ℚ is returned. The operation `SetRingProperties` is automatically invoked to set the ring properties.

#### 3.2 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.2-4) is a function specifically designed for GaussForHomalg.

##### 3.2-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.2-2 IdentityMatrix

`‣ IdentityMatrix`( C ) | ( function )

Returns: a sparse matrix

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

##### 3.2-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.2-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.2-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.2-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.2-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.2-8 UnionOfRows

`‣ UnionOfRows`( L ) | ( 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 in the list L.

##### 3.2-9 UnionOfColumns

`‣ UnionOfColumns`( L ) | ( 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 in the list L.

##### 3.2-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.2-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.2-12 DualKroneckerMat

`‣ DualKroneckerMat`( A, B ) | ( function )

Returns: a sparse matrix

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

##### 3.2-13 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.2-14 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.2-15 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.2-16 IsZeroMatrix

`‣ IsZeroMatrix`( C ) | ( function )

Returns: true or false

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

##### 3.2-17 IsDiagonalMatrix

`‣ IsDiagonalMatrix`( C ) | ( function )

Returns: true or false

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

##### 3.2-18 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.2-19 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.3 The Basic Functions and homalg table creation

##### 3.3-1 ReducedRowEchelonForm

`‣ ReducedRowEchelonForm`( 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.3-2 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.4 Matrix entry manipulation

This is just support for the sparse matrix data type.

##### 3.4-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.4-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`.

##### 3.4-3 AddToMatElm

`‣ AddToMatElm`( 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 `AddToEntry`, to achieve `M[r,c] := M[r,c] + e`.

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 4 A Bib Ind

generated by GAPDoc2HTML