IsOne := a -> IsZero( Numerator( a ) - Denominator( a ) ),
Minus := function( a, b )
local c;
c := Cancel( Denominator( a ), Denominator( b ) );
return HomalgLocalRingElement(
Numerator( a ) * c[2]
-Numerator( b ) * c[1],
Denominator( a ) * c[2],
HomalgRing( a ) ); end,
#HomalgLocalRingElement will cancel here
DivideByUnit := function( a, u )
return HomalgLocalRingElement(
Numerator( a ) * Denominator( u ),
Denominator( a ) * Numerator( u ),
HomalgRing( a ) ); end,
IsUnit := function( R, u )
local globalR;
globalR := AssociatedComputationRing( R );
return not IsZero( DecideZeroRows( HomalgMatrix ( [ Numerator( u ) ], 1, 1, globalR ), GeneratorsOfMaximalLeftIdeal( R ) ) );
end,
Sum := function( a, b )
local c;
c := Cancel( Denominator( a ), Denominator( b ) );
return HomalgLocalRingElement(
Numerator( a ) * c[2]
+Numerator( b ) * c[1],
Denominator( a ) * c[2],
HomalgRing( a ) ); end,
#HomalgLocalRingElement will cancel here
Product := function( a, b )
return HomalgLocalRingElement(
Numerator( a ) * Numerator( b ),
Denominator( a ) * Denominator( b ),
HomalgRing( a ) ); end,
ShallowCopy := C -> List( Eval( C ), ShallowCopy ),
InitialMatrix := function( C )
local R;
R := AssociatedComputationRing( C );
return [
HomalgInitialMatrix( NumberRows( C ), NumberColumns( C ), R ),
One( R )
]; end,
InitialIdentityMatrix := function( C )
local R;
R := AssociatedComputationRing( C );
return [
HomalgInitialIdentityMatrix( NumberRows( C ), R ),
One( R )
]; end,
ZeroMatrix := function( C )
local R;
R := AssociatedComputationRing( C );
return [
HomalgZeroMatrix( NumberRows( C ), NumberColumns( C ), R ),
One( R )
]; end,
IdentityMatrix := function( C )
local R;
R := AssociatedComputationRing( C );
return [
HomalgIdentityMatrix( NumberRows( C ), R ),
One( R )
]; end,
IsDiagonalMatrix := M -> IsDiagonalMatrix( Numerator( M ) ),
ZeroRows := C -> ZeroRows( Numerator( C ) ),
ZeroColumns := C -> ZeroColumns( Numerator( C ) ),
# GetColumnIndependentUnitPositions := # function( M, pos_list ) # local pos, f; # f := function( a ) # if IsList(a) then # return [a[2],a[1]]; # else # return a; # fi; # end; # pos:=GetRowIndependentUnitPositions( Involution( M ), List( pos_list, f ) ); # if pos <> [ ] then # SetIsZero( M, false ); # fi; # return pos; # end, # # GetRowIndependentUnitPositions := # function( M, pos_list ) # local rest, pos, j, l, k; # rest := [ 1 .. NumberRows( M ) ]; # pos := [ ]; # for j in [ 1 .. NumberColumns( M ) ] do # l := GetUnitPosition( CertainColumns( M, [ j ] ), List( Filtered( [ 1 .. NumberRows( M ) ], a->not( a in rest )), b->[b,1] ) ); # if l <> fail then # k := l[1]; # Add( pos, [ j, k ] ); # rest := Filtered( rest, a -> IsZero( M[ a, j ] ) ); # fi; # # od; # # if pos <> [ ] then # SetIsZero( M, false ); # fi; # return pos; # end,
GetColumnIndependentUnitPositions := function( M, pos_list )
local pos, f;
f := function( a ) if IsList(a) then
return [a[2],a[1]]; else
return a; fi; end;
pos:=GetRowIndependentUnitPositions( Involution( M ), List( pos_list, f ) ); if pos <> [ ] then
SetIsZero( M, false ); fi;
return pos;
end,
GetRowIndependentUnitPositions := function( M, pos_list )
local rest, pos, j, l, k;
rest := [ 1 .. NumberRows( M ) ];
pos := [ ]; for j in [ 1 .. NumberColumns( M ) ] do
l := GetUnitPosition( CertainColumns( M, [ j ] ), List( Filtered( [ 1 .. NumberRows( M ) ], a->not( a in rest )), b->[b,1] ) ); if l <> fail then
k := l[1];
Add( pos, [ j, k ] );
rest := Filtered( rest, a -> IsZero( M[ a, j ] ) ); fi;
od;
if pos <> [ ] then
SetIsZero( M, false ); fi;
return pos;
end,
GetUnitPosition := function( M, pos_list )
local R, A, i, N, l;
R:= AssociatedComputationRing( M );
Assert( 6, IsIdenticalObj( R, AssociatedGlobalRing( M ) ) );#should not be called by mora
#our stuff
A := R * GeneratorsOfMaximalLeftIdeal( HomalgRing( M ) ); for i in [ 1 .. NumberColumns( M ) ] do if not i in pos_list then
N := CertainColumns( Numerator( M ) , [ i ] );
N := DecideZero( N, A );
l := GetUnitPosition( N ); if l <> fail then
return [l[1],i]; fi; fi;
od;
return fail;
end, # # DivideEntryByUnit := # function( M, i, j, u ) # # # end,
# CopyRowToIdentityMatrix := # function( M, i, L, j ) # # # end,
# CopyColumnToIdentityMatrix := # function( M, j, L, i ) # # # end,
# SetColumnToZero := # function( M, i, j ) # # # end,
# if not IsIdenticalObj( R, HomalgRing( N ) ) then # Error( "the two matrices must be defined over identically the same ring\n" ); # fi;
# RP := homalgTable( R );
# if IsBound(RP!.Diff) then # diff := RP!.Diff( D, N ); # if IshomalgExternalObjectRep( diff ) then # diff := HomalgMatrix( diff, NumberRows( D ) * NumberRows( N ), NumberColumns( D ) * NumberColumns( N ), R ); # fi; # return diff; # fi;
# if not IsHomalgInternalRingRep( R ) then # Error( "could not find a procedure called Diff ", # "in the homalgTable of the non-internal ring\n" ); # fi;
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 und die Messung sind noch experimentell.