  
  [1X3 [33X[0;0Y[5XGaussForHomalg[105X[101X[1X methods and functions[133X[101X
  
  
  [1X3.1 [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.1-4[114X)  is  a  function  specifically  designed  for
  [5XGaussForHomalg[105X.[133X
  
  [1X3.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-8 UnionOfRows[101X
  
  [33X[1;0Y[29X[2XUnionOfRows[102X( [3XA[103X, [3XB[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 [3XA[103X and
  [3XB[103X.[133X
  
  [1X3.1-9 UnionOfColumns[101X
  
  [33X[1;0Y[29X[2XUnionOfColumns[102X( [3XA[103X, [3XB[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 [3XA[103X and
  [3XB[103X.[133X
  
  [1X3.1-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.1-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.1-12 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.1-13 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.1-14 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.1-15 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.1-16 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.1-17 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.1-18 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.2 [33X[0;0YThe Basic Functions and [5Xhomalg[105X[101X[1X table creation[133X[101X
  
  [1X3.2-1 DecideZeroRows[101X
  
  [33X[1;0Y[29X[2XDecideZeroRows[102X( [3XA[103X, [3XB[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X matrix[133X
  
  [33X[0;0YThis  returns  the [5Xhomalg[105X matrix you get by row reducing the [5Xhomalg[105X matrix [3XA[103X
  with the [5Xhomalg[105X matrix [3XB[103X.[133X
  
  [1X3.2-2 DecideZeroRowsEffectively[101X
  
  [33X[1;0Y[29X[2XDecideZeroRowsEffectively[102X( [3XA[103X, [3XB[103X, [3XT[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X matrix [3XM[103X[133X
  
  [33X[0;0YThis returns the [5Xhomalg[105X matrix [3XM[103X you get by row reducing the [5Xhomalg[105X matrix [3XA[103X
  with  the  [5Xhomalg[105X  matrix [3XB[103X. The transformation matrix is stored in the void
  [5Xhomalg[105X matrix [3XT[103X as a side effect. The matrices satisfy [22XM = A + T * B[122X.[133X
  
  [1X3.2-3 SyzygiesGeneratorsOfRows[101X
  
  [33X[1;0Y[29X[2XSyzygiesGeneratorsOfRows[102X( [3XM[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X matrix[133X
  
  [33X[0;0YThis  returns  the  row  syzygies  of the [5Xhomalg[105X matrix [3XM[103X, again as a [5Xhomalg[105X
  matrix.[133X
  
  [1X3.2-4 RelativeSyzygiesGeneratorsOfRows[101X
  
  [33X[1;0Y[29X[2XRelativeSyzygiesGeneratorsOfRows[102X( [3XM[103X, [3XN[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya [5Xhomalg[105X matrix[133X
  
  [33X[0;0YThe  row syzygies of [3XM[103X are returned, but now the computation interpretes the
  rows of the [5Xhomalg[105X matrix [3XN[103X as additional zero relations.[133X
  
  [1X3.2-5 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.2-6 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.3 [33X[0;0YMatrix entry manipulation[133X[101X
  
  [33X[0;0YThis is just support for the sparse matrix data type.[133X
  
  [1X3.3-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.3-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.3-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
  
