Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/matricesforhomalg/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 7.8.2025 mit Größe 12 kB image not shown  

</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft">(<code class="code">homalgMode</code>( ) is a short form for <code class="code">homalgMode</code>( "" ))</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">"b"</td>
<td class="tdcenter">"basic"</td>
<td class="tdleft">make the basic matrix operations visible + <code class="code">homalgMode</code>( "logic" )</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">"d"</td>
<td class="tdcenter">"debug"</td>
<td class="tdleft">same as "basic" but also makes <code class="code">Row/ReducedColumnEchelonForm</code> visible</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">"l"</td>
<td class="tdcenter">"logic"</td>
<td class="tdleft">make the logical methods in <strong class="pkg">LIMAT</strong> and <strong class="pkg">COLEM</strong> visible</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft"></td>
</tr>
</table><br />
</div>

<p>All modes other than the "default"-mode only set their specific values and leave the other values untouched, which allows combining them to some extent. This also means that in order to get from one mode to a new mode (without the aim to combine them) one needs to reset to the "default"-mode first. This can be done using <code class="code">homalgMode</code>( "", new_mode );</p>


<div class="example"><pre>
InstallGlobalFunction( homalgMode,
  function( arg )
    local nargs, mode, s;
    
    nargs := Length( arg );
    
    if nargs = 0 or ( IsString( arg[1] ) and arg[1] = "" ) then
        mode := "default";
    elif IsString( arg[1] ) then ## now we know, the string is not empty
        s := arg[1];
        if LowercaseString( s{[1]} ) = "b" then
            mode := "basic";
        elif LowercaseString( s{[1]} ) = "d" then
            mode := "debug";
        elif LowercaseString( s{[1]} ) = "l" then
            mode := "logic";
        else
            mode := "";
        fi;
    else
        Error( "the first argument must be a string\n" );
    fi;
    
    if mode = "default" then
        HOMALG_MATRICES.color_display := false;
        for s in HOMALG_MATRICES.matrix_logic_infolevels do
            SetInfoLevel( s, 1 );
        od;
        SetInfoLevel( InfoHomalgBasicOperations, 1 );
    elif mode = "basic" then
        SetInfoLevel( InfoHomalgBasicOperations, 3 );
        homalgMode( "logic" );
    elif mode = "debug" then
        SetInfoLevel( InfoHomalgBasicOperations, 4 );
        homalgMode( "logic" );
    elif mode = "logic" then
        HOMALG_MATRICES.color_display := true;
        for s in HOMALG_MATRICES.matrix_logic_infolevels do
            SetInfoLevel( s, 2 );
        od;
    fi;
    
    if nargs > 1 and IsString( arg[2] ) then
        homalgMode( arg[2] );
    fi;
    
end );
</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chapD.html">[Previous Chapter]</a>    <a href="chapF.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chapA.html">A</a>  <a href="chapB.html">B</a>  <a href="chapC.html">C</a>  <a href="chapD.html">D</a>  <a href="chapE.html">E</a>  <a href="chapF.html">F</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

92%


¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland

Quelle  chapE.html   Sprache: HTML

 
 products/sources/formale Sprachen/GAP/pkg/matricesforhomalg/doc/chapE.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (MatricesForHomalg) - Appendix E: Debugging MatricesForHomalg</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chapE"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chapA.html">A</a>  <a href="chapB.html">B</a>  <a href="chapC.html">C</a>  <a href="chapD.html">D</a>  <a href="chapE.html">E</a>  <a href="chapF.html">F</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chapD.html">[Previous Chapter]</a>    <a href="chapF.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chapE_mj.html">[MathJax on]</a></p>
<p><a id="X82D40F3183F4F259" name="X82D40F3183F4F259"></a></p>
<div class="ChapSects"><a href="chapE.html#X82D40F3183F4F259">E <span class="Heading">Debugging <strong class="pkg">MatricesForHomalg</strong></span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chapE.html#X8062637283DD739D">E.1 <span class="Heading">Increase the assertion level</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chapE.html#X81D8EB2A7CE587C6">E.2 <span class="Heading"><code class="code">Using homalgMode</code></span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chapE.html#X7D07F29F7EB515EE">E.2-1 homalgMode</a></span>
</div></div>
</div>

<h3>E <span class="Heading">Debugging <strong class="pkg">MatricesForHomalg</strong></span></h3>

<p>Beside the <strong class="pkg">GAP</strong> builtin debugging facilities (--> <a href="../../../doc/ref/chap7.html#X8345F6817DFD6394"><span class="RefLink">Reference: Debugging and Profiling Facilities</span></a>) <strong class="pkg">MatricesForHomalg</strong> provides two ways to debug the computations.</p>

<p><a id="X8062637283DD739D" name="X8062637283DD739D"></a></p>

<h4>E.1 <span class="Heading">Increase the assertion level</span></h4>

<p><strong class="pkg">MatricesForHomalg</strong> comes with numerous builtin assertion checks. They are activated if the user increases the assertion level using <br /> <br /> <code class="code">SetAssertionLevel</code>( <var class="Arg">level</var> ); <br /> <br /> (--> <a href="../../../doc/ref/chap7.html#X876C83707F13A0FD"><span class="RefLink">Reference: AssertionLevel</span></a>), where <var class="Arg">level</var> is one of the values below:</p>

<div class="pcenter"><table class="GAPDocTable">
<tr>
<td class="tdleft"><var class="Arg">level</var></td>
<td class="tdleft">description</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">0</td>
<td class="tdleft">no assertion checks whatsoever</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">4</td>
<td class="tdleft">assertions about basic matrix operations are checked (--> Appendix <a href="chapA.html#X7CB422647C7DD289"><span class="RefLink">A</span></a>)</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdleft">(these are among the operations often delegated to external systems)</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdleft"></td>
</tr>
</table><br />
</div>

<p>In particular, if <strong class="pkg">MatricesForHomalg</strong> delegates matrix operations to an external system then <code class="code">SetAssertionLevel</code>( 4 ); can be used to let <strong class="pkg">MatricesForHomalg</strong> debug the external system. <br /> <br /> Below you can find the record of the available level-4 assertions, which is a <strong class="pkg">GAP</strong>-component of every <strong class="pkg">homalg</strong> ring. Each assertion can thus be overwritten by package developers or even ordinary users.</p>


<div class="example"><pre>
asserts :=
  rec(
      BasisOfRowModule :=
        function( B ) return ( NumberRows( B ) = 0 ) = IsZero( B ); end,
      
      BasisOfColumnModule :=
        function( B ) return ( NumberColumns( B ) = 0 ) = IsZero( B ); end,
      
      BasisOfRowsCoeff :=
        function( B, T, M ) return B = T * M; end,
      
      BasisOfColumnsCoeff :=
        function( B, M, T ) return B = M * T; end,
      
      DecideZeroRows_Effectively :=
        function( M, A, B ) return M = DecideZeroRows( A, B ); end,
      
      DecideZeroColumns_Effectively :=
        function( M, A, B ) return M = DecideZeroColumns( A, B ); end,
      
      DecideZeroRowsEffectively :=
        function( M, A, T, B ) return M = A + T * B; end,
      
      DecideZeroColumnsEffectively :=
        function( M, A, B, T ) return M = A + B * T; end,
      
      DecideZeroRowsWRTNonBasis :=
        function( B )
          local R;
          R := HomalgRing( B );
          if not ( HasIsBasisOfRowsMatrix( B ) and
                   IsBasisOfRowsMatrix( B ) ) and
             IsBound( R!.DecideZeroWRTNonBasis ) then
              if R!.DecideZeroWRTNonBasis = "warn" then
                  Info( InfoWarning, 1,
                        "about to reduce with respect to a matrix",
                        "with IsBasisOfRowsMatrix not set to true" );
              elif R!.DecideZeroWRTNonBasis = "error" then
                  Error( "about to reduce with respect to a matrix",
                         "with IsBasisOfRowsMatrix not set to true\n" );
              fi;
          fi;
        end,
      
      DecideZeroColumnsWRTNonBasis :=
        function( B )
          local R;
          R := HomalgRing( B );
          if not ( HasIsBasisOfColumnsMatrix( B ) and
                   IsBasisOfColumnsMatrix( B ) ) and
             IsBound( R!.DecideZeroWRTNonBasis ) then
              if R!.DecideZeroWRTNonBasis = "warn" then
                  Info( InfoWarning, 1,
                        "about to reduce with respect to a matrix",
                        "with IsBasisOfColumnsMatrix not set to true" );
              elif R!.DecideZeroWRTNonBasis = "error" then
                  Error( "about to reduce with respect to a matrix",
                         "with IsBasisOfColumnsMatrix not set to true\n" );
              fi;
          fi;
        end,
      
      ReducedBasisOfRowModule :=
        function( M, B )
          return GenerateSameRowModule( B, BasisOfRowModule( M ) );
        end,
      
      ReducedBasisOfColumnModule :=
        function( M, B )
          return GenerateSameColumnModule( B, BasisOfColumnModule( M ) );
        end,
      
      ReducedSyzygiesGeneratorsOfRows :=
        function( M, S )
          return GenerateSameRowModule( S, SyzygiesGeneratorsOfRows( M ) );
        end,
      
      ReducedSyzygiesGeneratorsOfColumns :=
        function( M, S )
          return GenerateSameColumnModule( S, SyzygiesGeneratorsOfColumns( M ) );
        end,
      
     );
</pre></div>

<p><a id="X81D8EB2A7CE587C6" name="X81D8EB2A7CE587C6"></a></p>

<h4>E.2 <span class="Heading"><code class="code">Using homalgMode</code></span></h4>

<p><a id="X7D07F29F7EB515EE" name="X7D07F29F7EB515EE"></a></p>

<h5>E.2-1 homalgMode</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ homalgMode</code>( <var class="Arg">str</var>[, <var class="Arg">str2</var>] )</td><td class="tdright">( method )</td></tr></table></div>
<p>This function sets different modes which influence how much of the basic matrix operations and the logical matrix methods become visible (--> Appendices <a href="chapA.html#X7CB422647C7DD289"><span class="RefLink">A</span></a>, <a href="chapC.html#X8222352C78A19214"><span class="RefLink">C</span></a>). Handling the string <var class="Arg">str</var> is <em>not</em> case-sensitive. If a second string <var class="Arg">str2</var> is given, then <code class="code">homalgMode</code>( <var class="Arg">str2</var> ) is invoked at the end. In case you let <strong class="pkg">homalg</strong> delegate matrix operations to an external system the you might also want to check <code class="code">homalgIOMode</code> in the <strong class="pkg">HomalgToCAS</strong> package manual.</p>

<div class="pcenter"><table class="GAPDocTable">
<tr>
<td class="tdleft"><var class="Arg">str</var></td>
<td class="tdcenter"><var class="Arg">str</var> (long form)</td>
<td class="tdleft">mode description</td>
</tr>
<tr>
<td class="tdleft"></td>
<td class="tdcenter"></td>
<td class="tdleft"></td>
</tr>
<tr>
<td class="tdleft">""</td>
<td class="tdcenter">""</td>
<td class="tdleft">the default mode, i.e. the computation protocol won't be visible





Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.