Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/modisom/gap/tables/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 23.8.2024 mit Größe 716 B image not shown  

Quelle  linalg.gi   Sprache: unbekannt

 
BindGlobal( "SiftInto", function( B, c )
    local dep, d, i;

    # catch some simple cases
    if c = 0*c then return false; fi;
    if Length(B) = 0 then B[1] := NormedRowVector(c); return true; fi;
    if Length(B) = Length(B[1]) then return false; fi;

    # sift
    dep := List(B, PositionNonZero);
    while true do
        d := PositionNonZero(c);
        if d > Length(c) then return false; fi;
        i := Position(dep,d);
        if IsBool(i) then
            B[Length(B)+1] := NormedRowVector(c);
            return true;
        fi;
        AddRowVector( c, B[i], -c[d] );
    od;

end );

BindGlobal( "OrderByDepth", function( U )
    SortParallel(List(U, PositionNonZero), U);
    return U;
end );


[ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ]