<p>The functions listed below are components of the <code class="code">homalgTable</code> objectstored in the ring. They are only indirectly accessible through standard methods that invoke them.</p>
<h4>B.1 <span class="Heading">The Tool Operations <em>without</em> a Fallback Method</span></h4>
<p>There are matrix methods for which <strong class="pkg">homalg</strong> needs a <code class="code">homalgTable</code> entry for non-internal rings, as it cannot provide a suitable fallback. Below is the list of these <code class="code">homalgTable</code> entries.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InitialMatrix</code>( <var class="Arg">C</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">InitialMatrix</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7EEAADA6807A5A45"><span class="RefLink">C.4-1</span></a>) resets the filter <code class="code">IsInitialMatrix</code> and returns <span class="SimpleMath">RP</span>!.<code class="code">InitialMatrix</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InitialIdentityMatrix</code>( <var class="Arg">C</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">InitialIdentityMatrix</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7B619CA885024F0F"><span class="RefLink">C.4-2</span></a>) resets the filter <code class="code">IsInitialIdentityMatrix</code> and returns <span class="SimpleMath">RP</span>!.<code class="code">InitialIdentityMatrix</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ZeroMatrix</code>( <var class="Arg">C</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">ZeroMatrix</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7EADAA3180A84318"><spanclass="RefLink">C.4-3</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">ZeroMatrix</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IdentityMatrix</code>( <var class="Arg">C</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">IdentityMatrix</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X78CCA57B84E51834"><span class="RefLink">C.4-4</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">IdentityMatrix</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Involution</code>( <var class="Arg">M</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">Involution</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7928991E8768FA72"><spanclass="RefLink">C.4-7</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">Involution</code> applied to the content of the attribute <code class="code">EvalInvolution</code><span class="SimpleMath">( <var class="Arg">C</var> ) = <var class="Arg">M</var></span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TransposedMatrix</code>( <var class="Arg">M</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">TransposedMatrix</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X78D5359480EFC5AC"><span class="RefLink">C.4-8</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">TransposedMatrix</code> applied to the content of the attribute <code class="code">EvalTransposedMatrix</code><span class="SimpleMath">( <var class="Arg">C</var> ) = <var class="Arg">M</var></span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UnionOfRows</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfRows</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7F35A61C8522A1B0"><span class="RefLink">C.4-12</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">UnionOfRows</code> applied to the content of the attribute <code class="code">EvalUnionOfRows</code><span class="SimpleMath">( <var class="Arg">C</var> ) = <var class="Arg">L</var></span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UnionOfRowsPair</code>( <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfRowsPair</code> is bound and the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfRows</code> is not bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7F35A61C8522A1B0"><span class="RefLink">C.4-12</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">UnionOfRowsPair</code> applied recursively to a balanced binary tree created from the content of the attribute <code class="code">EvalUnionOfRows</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UnionOfColumns</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfColumns</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7EDE6095820F8128"><span class="RefLink">C.4-13</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">UnionOfColumns</code> applied to the content of the attribute <code class="code">EvalUnionOfColumns</code><span class="SimpleMath">( <var class="Arg">C</var> ) = <var class="Arg">L</var></span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UnionOfColumnsPair</code>( <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfColumnsPair</code> is bound and the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">UnionOfColumns</code> is not bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7EDE6095820F8128"><span class="RefLink">C.4-13</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">UnionOfColumnsPair</code> applied recursively to a balanced binary tree created from the content of the attribute <code class="code">EvalUnionOfRows</code><span class="SimpleMath">( <var class="Arg">C</var> )</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DiagMat</code>( <var class="Arg">e</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the <code class="code">Eval</code> value of a <strong class="pkg">homalg</strong> matrix <var class="Arg">C</var></p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">DiagMat</code> is bound then the method <code class="func">Eval</code> (<a href="chapC.html#X7FD68F43831046B6"><span class="RefLink">C.4-14</span></a>) returns <span class="SimpleMath">RP</span>!.<code class="code">DiagMat</code> applied to the content of the attribute <code class="code">EvalDiagMat</code><span class="SimpleMath">( <var class="Arg">C</var> ) = <var class="Arg">e</var></span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NumberRows</code>( <var class="Arg">C</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a nonnegative integer</p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">C</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">NumberRows</code> is bound then the standard method for the attribute <code class="func">NumberRows</code> (<a href="chap5.html#X7C72971F7D0CA3C8"><span class="RefLink">5.4-1</span></a>) shown below returns <span class="SimpleMath">RP</span>!.<code class="code">NumberRows</code><span class="SimpleMath">( <varclass="Arg">C</var> )</span>.</p>
if IsBound(RP!.NumberRows) then
return RP!.NumberRows( C );
fi;
if not IsHomalgInternalMatrixRep( C ) then
Error( "could not find a procedure called NumberRows ", "in the homalgTable of the non-internal ring\n" );
fi;
#=====# can only work for homalg internal matrices #=====#
if IsBound(RP!.NumberColumns) then
return RP!.NumberColumns( C );
fi;
if not IsHomalgInternalMatrixRep( C ) then
Error( "could not find a procedure called NumberColumns ", "in the homalgTable of the non-internal ring\n" );
fi;
#=====# can only work for homalg internal matrices #=====#
if NumberRows( C ) <> NumberColumns( C ) then
Error( "the matrix is not a square matrix\n" );
fi;
if IsEmptyMatrix( C ) then
return One( R );
elif IsZero( C ) then
return Zero( R );
fi;
if IsBound(RP!.Determinant) then
return RingElementConstructor( R )( RP!.Determinant( C ), R );
fi;
if not IsHomalgInternalMatrixRep( C ) then
Error( "could not find a procedure called Determinant ", "in the homalgTable of the non-internal ring\n" );
fi;
#=====# can only work for homalg internal matrices #=====#
<h4>B.2 <span class="Heading">The Tool Operations with a Fallback Method</span></h4>
<p>These are the methods for which it is recommended for performance reasons to have a <code class="code">homalgTable</code> entry for non-internal rings. <strong class="pkg">homalg</strong> only provides a generic fallback method.</p>
## do not touch mutable matrices
if not ( IsMutable( M1 ) or IsMutable( M2 ) ) then
if IsBound( M1!.AreEqual ) then
are_equal := _ElmWPObj_ForHomalg( M1!.AreEqual, M2, fail );
if are_equal <> fail then
return are_equal;
fi;
else
M1!.AreEqual :=
ContainerForWeakPointers(
TheTypeContainerForWeakPointersOnComputedValues,
[ "operation", "AreEqual" ] );
fi;
if IsBound( M2!.AreEqual ) then
are_equal := _ElmWPObj_ForHomalg( M2!.AreEqual, M1, fail );
if are_equal <> fail then
return are_equal;
fi;
fi;
## do not store things symmetrically below to ``save'' memory
fi;
R := HomalgRing( M1 );
RP := homalgTable( R );
if IsBound(RP!.AreEqualMatrices) then
## CAUTION: the external system must be able to check equality
## modulo possible ring relations (known to the external system)!
are_equal := RP!.AreEqualMatrices( M1, M2 );
elif IsBound(RP!.Equal) then
## CAUTION: the external system must be able to check equality
## modulo possible ring relations (known to the external system)!
are_equal := RP!.Equal( M1, M2 );
elif IsBound(RP!.IsZeroMatrix) then ## ensuring this avoids infinite loops
are_equal := IsZero( M1 - M2 );
fi;
if IsBound( are_equal ) then
## do not touch mutable matrices
if not ( IsMutable( M1 ) or IsMutable( M2 ) ) then
if are_equal then
MatchPropertiesAndAttributes( M1, M2,
LIMAT.intrinsic_properties,
LIMAT.intrinsic_attributes,
LIMAT.intrinsic_components,
LIMAT.intrinsic_attributes_do_not_check_their_equality
);
fi;
## do not store things symmetrically to ``save'' memory
_AddTwoElmWPObj_ForHomalg( M1!.AreEqual, M2, are_equal );
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GetColumnIndependentUnitPositions</code>( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a (possibly empty) list of pairs of positive integers</p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">M</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">GetColumnIndependentUnitPositions</code> is bound then the standard method of the operation <code class="func">GetColumnIndependentUnitPositions</code> (<a href="chap5.html#X85887BBB86F0A08B"><span class="RefLink">5.5-24</span></a>) shown below returns <span class="SimpleMath">RP</span>!.<code class="code">GetColumnIndependentUnitPositions</code><span class="SimpleMath">( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</span>.</p>
function( M, poslist )
local cache, R, RP, rest, pos, i, j, k;
if IsBound( M!.GetColumnIndependentUnitPositions ) then
cache := M!.GetColumnIndependentUnitPositions;
if IsBound( cache.(String( poslist )) ) then
return cache.(String( poslist ));
fi;
else
cache := rec( );
M!.GetColumnIndependentUnitPositions := cache;
fi;
R := HomalgRing( M );
RP := homalgTable( R );
if IsBound(RP!.GetColumnIndependentUnitPositions) then
pos := RP!.GetColumnIndependentUnitPositions( M, poslist );
if pos <> [ ] then
SetIsZero( M, false );
fi;
cache.(String( poslist )) := pos;
return pos;
fi;
#=====# the fallback method #=====#
rest := [ 1 .. NumberColumns( M ) ];
pos := [ ];
for i in [ 1 .. NumberRows( M ) ] do
for k in Reversed( rest ) do
if not [ i, k ] in poslist and
IsUnit( R, M[ i, k ] ) then
Add( pos, [ i, k ] );
rest := Filtered( rest,
a -> IsZero( M[ i, a ] ) );
break;
fi;
od;
od;
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GetRowIndependentUnitPositions</code>( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a (possibly empty) list of pairs of positive integers</p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">M</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">GetRowIndependentUnitPositions</code> is bound then the standard method of the operation <code class="func">GetRowIndependentUnitPositions</code> (<a href="chap5.html#X824AB44184DD63B0"><span class="RefLink">5.5-25</span></a>) shown below returns <span class="SimpleMath">RP</span>!.<code class="code">GetRowIndependentUnitPositions</code><span class="SimpleMath">( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</span>.</p>
function( M, poslist )
local cache, R, RP, rest, pos, j, i, k;
if IsBound( M!.GetRowIndependentUnitPositions ) then
cache := M!.GetRowIndependentUnitPositions;
if IsBound( cache.(String( poslist )) ) then
return cache.(String( poslist ));
fi;
else
cache := rec( );
M!.GetRowIndependentUnitPositions := cache;
fi;
R := HomalgRing( M );
RP := homalgTable( R );
if IsBound(RP!.GetRowIndependentUnitPositions) then
pos := RP!.GetRowIndependentUnitPositions( M, poslist );
if pos <> [ ] then
SetIsZero( M, false );
fi;
cache.( String( poslist ) ) := pos;
return pos;
fi;
#=====# the fallback method #=====#
rest := [ 1 .. NumberRows( M ) ];
pos := [ ];
for j in [ 1 .. NumberColumns( M ) ] do
for k in Reversed( rest ) do
if not [ j, k ] in poslist and
IsUnit( R, M[ k, j ] ) then
Add( pos, [ j, k ] );
rest := Filtered( rest,
a -> IsZero( M[ a, j ] ) );
break;
fi;
od;
od;
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GetUnitPosition</code>( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a (possibly empty) list of pairs of positive integers</p>
<p>Let <span class="SimpleMath">R :=</span> <code class="code">HomalgRing</code><span class="SimpleMath">( <var class="Arg">M</var> )</span> and <span class="SimpleMath">RP :=</span> <code class="code">homalgTable</code><span class="SimpleMath">( R )</span>. If the <code class="code">homalgTable</code> component <span class="SimpleMath">RP</span>!.<code class="code">GetUnitPosition</code> is bound then the standard method of the operation <code class="func">GetUnitPosition</code> (<a href="chap5.html#X7A1969A17979FC49"><span class="RefLink">5.5-26</span></a>) shown below returns <span class="SimpleMath">RP</span>!.<code class="code">GetUnitPosition</code><span class="SimpleMath">( <var class="Arg">M</var>, <var class="Arg">poslist</var> )</span>.</p>
function( M, poslist )
local R, RP, pos, m, n, i, j;
R := HomalgRing( M );
RP := homalgTable( R );
if IsBound(RP!.GetUnitPosition) then
pos := RP!.GetUnitPosition( M, poslist );
if IsList( pos ) and IsPosInt( pos[1] ) and IsPosInt( pos[2] ) then
SetIsZero( M, false );
fi;
return pos;
fi;
#=====# the fallback method #=====#
m := NumberRows( M );
n := NumberColumns( M );
for i in [ 1 .. m ] do
for j in [ 1 .. n ] do
if not [ i, j ] in poslist and not j in poslist and
IsUnit( R, M[ i, j ] ) then
SetIsZero( M, false );
return [ i, j ];
fi;
od;
od;
function( M )
local R, RP, pos, entries, r, c, i, k, j;
R := HomalgRing( M );
RP := homalgTable( R );
if IsBound(RP!.PositionOfFirstNonZeroEntryPerRow) then
return RP!.PositionOfFirstNonZeroEntryPerRow( M );
elif IsBound(RP!.PositionOfFirstNonZeroEntryPerColumn) then
return PositionOfFirstNonZeroEntryPerColumn( Involution( M ) );
fi;
#=====# the fallback method #=====#
entries := EntriesOfHomalgMatrix( M );
r := NumberRows( M );
c := NumberColumns( M );
pos := ListWithIdenticalEntries( r, 0 );
for i in [ 1 .. r ] do
k := (i - 1) * c;
for j in [ 1 .. c ] do
if not IsZero( entries[k + j] ) then
pos[i] := j;
break;
fi;
od;
od;
function( M )
local R, RP, pos, entries, r, c, j, i, k;
R := HomalgRing( M );
RP := homalgTable( R );
if IsBound(RP!.PositionOfFirstNonZeroEntryPerColumn) then
return RP!.PositionOfFirstNonZeroEntryPerColumn( M );
elif IsBound(RP!.PositionOfFirstNonZeroEntryPerRow) then
return PositionOfFirstNonZeroEntryPerRow( Involution( M ) );
fi;
#=====# the fallback method #=====#
entries := EntriesOfHomalgMatrix( M );
r := NumberRows( M );
c := NumberColumns( M );
pos := ListWithIdenticalEntries( c, 0 );
for j in [ 1 .. c ] do
for i in [ 1 .. r ] do
k := (i - 1) * c;
if not IsZero( entries[k + j] ) then
pos[j] := i;
break;
fi;
od;
od;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.102Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.