  
  [1X3 [33X[0;0Y[5XGaussForHomalg[105X[101X[1X methods and functions[133X[101X
  
  
  [1X3.1 [33X[0;0YThe field of rationals[133X[101X
  
  [1X3.1-1 HomalgFieldOfRationals[101X
  
  [33X[1;0Y[29X[2XHomalgFieldOfRationals[102X(  ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X ring[133X
  
  [33X[0;0YThe  field  of  rationals  [22Xℚ[122X is returned. The operation [10XSetRingProperties[110X is
  automatically invoked to set the ring properties.[133X
  
  
  [1X3.2 [33X[0;0YThe Tools[133X[101X
  
  [33X[0;0YPlease   note   that   there   are  more  tool  functions  you  can  define,
  [5XGaussForHomalg[105X  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,   [2XImportMatrix[102X   ([14X3.2-4[114X)  is  a  function  specifically  designed  for
  [5XGaussForHomalg[105X.[133X
  
  [1X3.2-1 ZeroMatrix[101X
  
  [33X[1;0Y[29X[2XZeroMatrix[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  a sparse matrix with the same dimensions and base ring as the
  [5Xhomalg[105X matrix [3XC[103X.[133X
  
  [1X3.2-2 IdentityMatrix[101X
  
  [33X[1;0Y[29X[2XIdentityMatrix[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis returns a sparse [22Xn × n[122X identity matrix with the same ring as the [5Xhomalg[105X
  matrix [3XC[103X, [22Xn[122X being the number of rows of [3XC[103X.[133X
  
  [1X3.2-3 CopyMatrix[101X
  
  [33X[1;0Y[29X[2XCopyMatrix[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  a  sparse matrix which is a shallow copy of the sparse matrix
  stored in the [10XEval[110X attribute of the [5Xhomalg[105X matrix [3XC[103X.[133X
  
  [1X3.2-4 ImportMatrix[101X
  
  [33X[1;0Y[29X[2XImportMatrix[102X( [3XM[103X, [3XR[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the  sparse  version  of the [5XGAP[105X matrix [3XM[103X over the ring [3XR[103X. It
  prevents [5Xhomalg[105X from calling sparse matrix algorithms on dense [5XGAP[105X matrices.
  Note  that  this  is not a "standard" tool but neccessary because of the new
  data type.[133X
  
  [1X3.2-5 Involution[101X
  
  [33X[1;0Y[29X[2XInvolution[102X( [3XM[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  a  sparse  matrix which is the transpose of the sparse matrix
  stored in the [10XEval[110X attribute of the [5Xhomalg[105X matrix [3XM[103X.[133X
  
  [1X3.2-6 CertainRows[101X
  
  [33X[1;0Y[29X[2XCertainRows[102X( [3XM[103X, [3Xplist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the  rows  in  [3Xplist[103X  of the sparse matrix stored in the [10XEval[110X
  attribute of the [5Xhomalg[105X matrix [3XM[103X as a new matrix.[133X
  
  [1X3.2-7 CertainColumns[101X
  
  [33X[1;0Y[29X[2XCertainColumns[102X( [3XM[103X, [3Xplist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the  columns in [3Xplist[103X of the sparse matrix stored in the [10XEval[110X
  attribute of the [5Xhomalg[105X matrix [3XM[103X as a new matrix.[133X
  
  [1X3.2-8 UnionOfRows[101X
  
  [33X[1;0Y[29X[2XUnionOfRows[102X( [3XL[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the  sparse  matrix  created by concatenating the rows of the
  sparse  matrices stored in the [10XEval[110X attributes of the [5Xhomalg[105X matrices in the
  list [3XL[103X.[133X
  
  [1X3.2-9 UnionOfColumns[101X
  
  [33X[1;0Y[29X[2XUnionOfColumns[102X( [3XL[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the sparse matrix created by concatenating the columns of the
  sparse  matrices stored in the [10XEval[110X attributes of the [5Xhomalg[105X matrices in the
  list [3XL[103X.[133X
  
  [1X3.2-10 DiagMat[101X
  
  [33X[1;0Y[29X[2XDiagMat[102X( [3Xe[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  method  takes a list [3Xe[103X of [5Xhomalg[105X matrices and returns the sparse block
  matrix of the matrices stored in the [10XEval[110X attributes of the matrices in [3Xe[103X.[133X
  
  [1X3.2-11 KroneckerMat[101X
  
  [33X[1;0Y[29X[2XKroneckerMat[102X( [3XA[103X, [3XB[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns the sparse Kronecker matrix of the matrices stored in the [10XEval[110X
  attributes of the [5Xhomalg[105X matrices [3XA[103X and [3XB[103X.[133X
  
  [1X3.2-12 DualKroneckerMat[101X
  
  [33X[1;0Y[29X[2XDualKroneckerMat[102X( [3XA[103X, [3XB[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns the sparse dual Kronecker matrix of the matrices stored in the
  [10XEval[110X attributes of the [5Xhomalg[105X matrices [3XA[103X and [3XB[103X.[133X
  
  [1X3.2-13 Compose[101X
  
  [33X[1;0Y[29X[2XCompose[102X( [3XA[103X, [3XB[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya sparse matrix[133X
  
  [33X[0;0YThis  returns  the  matrix product of the sparse matrices stored in the [10XEval[110X
  attributes of the [5Xhomalg[105X matrices [3XA[103X and [3XB[103X.[133X
  
  [1X3.2-14 NrRows[101X
  
  [33X[1;0Y[29X[2XNrRows[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Yan integer[133X
  
  [33X[0;0YThis  returns  the  number  of  rows of the sparse matrix stored in the [10XEval[110X
  attribute of the [5Xhomalg[105X matrix [3XC[103X.[133X
  
  [1X3.2-15 NrColumns[101X
  
  [33X[1;0Y[29X[2XNrColumns[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Yan integer[133X
  
  [33X[0;0YThis  returns  the number of columns of the sparse matrix stored in the [10XEval[110X
  attribute of the [5Xhomalg[105X matrix [3XC[103X.[133X
  
  [1X3.2-16 IsZeroMatrix[101X
  
  [33X[1;0Y[29X[2XIsZeroMatrix[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Y[12Xtrue[112X or [12Xfalse[112X[133X
  
  [33X[0;0YThis  returns  [12Xtrue[112X if the sparse matrix stored in the [10XEval[110X attribute of the
  [5Xhomalg[105X matrix [3XC[103X is a zero matrix, and [12Xfalse[112X otherwise.[133X
  
  [1X3.2-17 IsDiagonalMatrix[101X
  
  [33X[1;0Y[29X[2XIsDiagonalMatrix[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Y[12Xtrue[112X or [12Xfalse[112X[133X
  
  [33X[0;0YThis  returns  [12Xtrue[112X if the sparse matrix stored in the [10XEval[110X attribute of the
  [5Xhomalg[105X matrix [3XC[103X is a diagonal matrix, and [12Xfalse[112X otherwise.[133X
  
  [1X3.2-18 ZeroRows[101X
  
  [33X[1;0Y[29X[2XZeroRows[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya list[133X
  
  [33X[0;0YThis  returns  the list of zero rows of the sparse matrix stored in the [10XEval[110X
  attribute of the [5Xhomalg[105X matrix [3XC[103X.[133X
  
  [1X3.2-19 ZeroColumns[101X
  
  [33X[1;0Y[29X[2XZeroColumns[102X( [3XC[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya list[133X
  
  [33X[0;0YThis  returns  the  list  of zero columns of the sparse matrix stored in the
  [10XEval[110X attribute of the [5Xhomalg[105X matrix [3XC[103X.[133X
  
  
  [1X3.3 [33X[0;0YThe Basic Functions and [5Xhomalg[105X[101X[1X table creation[133X[101X
  
  [1X3.3-1 RowReducedEchelonForm[101X
  
  [33X[1;0Y[29X[2XRowReducedEchelonForm[102X( [3XM[103X[, [3XU[103X] ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X matrix [3XN[103X[133X
  
  [33X[0;0YIf  one  argument  is  given, this returns the triangular basis (reduced row
  echelon  form)  of the [5Xhomalg[105X matrix [3XM[103X, again as a [5Xhomalg[105X matrix. In case of
  two  arguments,  still  only  the triangular basis of [3XM[103X is returned, but the
  transformation  matrix  is  stored  in  the  void  [5Xhomalg[105X matrix [3XU[103X as a side
  effect. The matrices satisfy [22XN = U * M[122X.[133X
  
  [1X3.3-2 CreateHomalgTable[101X
  
  [33X[1;0Y[29X[2XCreateHomalgTable[102X( [3XR[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X table[133X
  
  [33X[0;0YThis returns the [5Xhomalg[105X table of what will become the [5Xhomalg[105X ring [3XR[103X (at this
  point  [3XR[103X  is  just  a  [5Xhomalg[105X  object  with  some  properties for the method
  selection  of  [10XCreateHomalgTable[110X). This method includes the needed functions
  stored   in   the   global   variables   [10XCommonHomalgTableForGaussTools[110X  and
  [10XCommonHomalgTableForGaussBasic[110X,  and  can  add  some more to the record that
  will become the [5Xhomalg[105X table.[133X
  
  
  [1X3.4 [33X[0;0YMatrix entry manipulation[133X[101X
  
  [33X[0;0YThis is just support for the sparse matrix data type.[133X
  
  [1X3.4-1 MatElm[101X
  
  [33X[1;0Y[29X[2XMatElm[102X( [3XM[103X, [3Xr[103X, [3Xc[103X, [3XR[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Y[3XM[103X[[3Xr[103X,[3Xc[103X][133X
  
  [33X[0;0YIf  the  Eval  attribute  of  the  homalg matrix [3XM[103X over the [5Xhomalg[105X ring [3XR[103X is
  sparse, this calls the corresponding [5XGauss[105X command [10XGetEntry[110X.[133X
  
  [1X3.4-2 SetMatElm[101X
  
  [33X[1;0Y[29X[2XSetMatElm[102X( [3XM[103X, [3Xr[103X, [3Xc[103X, [3Xe[103X, [3XR[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ynothing[133X
  
  [33X[0;0YIf  the  Eval  attribute  of  the  homalg matrix [3XM[103X over the [5Xhomalg[105X ring [3XR[103X is
  sparse,  this  calls  the  corresponding  [5XGauss[105X command [10XGetEntry[110X, to achieve
  [10X[3XM[103X[10X[[3Xr[103X[10X,[3Xc[103X[10X]:=[3Xe[103X[10X[110X.[133X
  
  [1X3.4-3 AddToMatElm[101X
  
  [33X[1;0Y[29X[2XAddToMatElm[102X( [3XM[103X, [3Xr[103X, [3Xc[103X, [3Xe[103X, [3XR[103X ) [32X method[133X
  [6XReturns:[106X  [33X[0;10Ynothing[133X
  
  [33X[0;0YIf  the  Eval  attribute  of  the  homalg matrix [3XM[103X over the [5Xhomalg[105X ring [3XR[103X is
  sparse,  this  calls  the corresponding [5XGauss[105X command [10XAddToEntry[110X, to achieve
  [10X[3XM[103X[10X[[3Xr[103X[10X,[3Xc[103X[10X] := [3XM[103X[10X[[3Xr[103X[10X,[3Xc[103X[10X] + [3Xe[103X[10X[110X.[133X
  
