Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/hap/lib/Homology/   (GAP Algebra Version 4.15.1©)  Datei vom 19.6.2025 mit Größe 1 kB image not shown  

Quelle  solutionsMat.gi   Sprache: Shell

 

#(C) Graham Ellis

#############################################################################
##
#M  SolutionsMatDestructive( <mat>, <matvec> ) . . . .  one solution for each
## of several equations
##
##  One solution <x> of <x> * <mat> = <vec_i> or `fail' for each row vec_i
##  of <matvec>
##
InstallMethod( SolutionsMatDestructive,
        "generic method",
    [ IsOrdinaryMatrix and IsMutable,
      IsOrdinaryMatrix and IsMutable],
        function( mat, matvec )
    local i,ncols,sem, vno, z,x, row, sol,vec,solmat,z1,sol1,lngm;

    solmat:=[];
    z1 := Zero(mat[1][1]);
    sol1:=ListWithIdenticalEntries(Length(mat),z1);
    lngm:=Length(mat[1]);
    sem := SemiEchelonMatTransformationDestructive(StructuralCopy(mat));
    ncols := Length(matvec[1]);
    

for vec in matvec do
    z := StructuralCopy(z1);
    sol := StructuralCopy(sol1);
    ConvertToVectorRepNC(sol);
    if ncols <> lngm then
        Error("SolutionMat: matrix and vector incompatible");
    fi;
    for i in [1..ncols] do
        vno := sem.heads[i];
        if vno <> 0 then
            x := vec[i];
            if x <> z then
                AddRowVector(vec, sem.vectors[vno], -x);
                AddRowVector(sol, sem.coeffs[vno], x);
            fi;
        fi;
    od;
    if IsZero(vec) then
        Append(solmat,[sol]);
    else
        Append(solmat,[fail]);
    fi;
od;

return solmat;
end);


Messung
CHZG
889910095

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.