<p>This version of <strong class="pkg">ResClasses</strong> needs at least <strong class="pkg">GAP</strong> 4.9.0, <strong class="pkg">Polycyclic</strong> 2.11 <a href="chapBib.html#biBPolycyclic">[EHN13]</a>, <strong class="pkg">GAPDoc</strong> 1.5.1 <a href="chapBib.html#biBGAPDoc">[LN12]</a> and <strong class="pkg">Utils</strong> 0.40 <a href="chapBib.html#biBUtils">[GKW16]</a>. It can be used on all platforms for which <strong class="pkg">GAP</strong> is available. <strong class="pkg">ResClasses</strong> is completely written in the <strong class="pkg">GAP</strong> language and does neither contain nor require external binaries.</p>
<p>Like any other <strong class="pkg">GAP</strong> package, <strong class="pkg">ResClasses</strong> is usually installed in the <code class="file">pkg</code> subdirectory of the <strong class="pkg">GAP</strong> distribution. This is accomplished by extracting the distribution file in this directory. By default, the package <strong class="pkg">ResClasses</strong> is autoloaded. If you have switched autoloading of packages off, you can load <strong class="pkg">ResClasses</strong> via <code class="code">LoadPackage( "resclasses" );</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ResClassesTest</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="code">true</code> if no errors were found, and <code class="code">false</code> otherwise.</p>
<p>Performs tests of the <strong class="pkg">ResClasses</strong> package. Errors, i.e. differences to the correct results of the test computations, are reported. The processed test files are in the directory <code class="file">pkg/resclasses/tst</code>.</p>
<p>Runs all examples in the manual of the <strong class="pkg">ResClasses</strong> package, and reports any differences between the actual output and the output printed in the manual.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LogToDatedFile</code>( <var class="Arg">directory</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the full pathname of the created logfile.</p>
<p>This function opens a logfile in the specified directory; the name of the logfile has the form of a timestamp, i.e. <code class="code">year-month-day hour-minute-second.log.</code> If <strong class="pkg">GAP</strong> is already in logging mode, the old logfile is closed before the new one is opened.</p>
<p>The availability of this function depends on that the package <strong class="pkg">IO</strong> <a href="chapBib.html#biBIO">[HN16]</a> is installed and compiled.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DownloadFile</code>( <var class="Arg">url</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the contents of the file with URL <var class="Arg">url</var> in the form of a string if that file exists and the download was successful, and <code class="code">fail</code> otherwise.</p>
<p>As most system-related functions, <code class="code">DownloadFile</code> works only under UNIX / Linux. Also the computer must of course be connected to the Internet.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SendEmail</code>( <var class="Arg">sendto</var>, <var class="Arg">copyto</var>, <var class="Arg">subject</var>, <var class="Arg">text</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: zero if everything worked correctly, and a system error number otherwise.</p>
<p>Sends an e-mail with subject <var class="Arg">subject</var> and body <var class="Arg">text</var> to the addresses in the list <var class="Arg">sendto</var>, and copies it to those in the list <var class="Arg">copyto</var>. The first two arguments must be lists of strings, and the latter two must be strings.</p>
<p>As most system-related functions, <code class="code">SendEmail</code> works only under UNIX / Linux. Also the computer must of course be connected to the Internet.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EmailLogFile</code>( <var class="Arg">addresses</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: zero if everything worked correctly, and a system error number otherwise.</p>
<p>Sends the current log file by e-mail to <var class="Arg">addresses</var>, if <strong class="pkg">GAP</strong> is in logging mode and one is working under UNIX / Linux, and does nothing otherwise. The argument <var class="Arg">addresses</var> must be either a list of e-mail addresses or a single e-mail address. Long log files are abbreviated, i.e. if the log file is larger than 64KB, then any output is truncated at 1KB, and if the log file is still longer than 64KB afterwards, it is truncated at 64KB.</p>
<p><strong class="pkg">ResClasses</strong> provides functions to generate bitmap picture files from suitable pixel matrices and vice versa. The author has successfully tested this feature both under Linux and under Windows, and the generated pictures can be processed further with many common graphics programs:</p>
<p>Writes the pixel matrix <var class="Arg">picture</var> to a bitmap- (bmp-) picture file named <var class="Arg">filename</var>. The filename should include the entire pathname. The argument <varclass="Arg">picture</var> can be a GF(2) matrix, in which case a monochrome picture file is generated. In this case, zeros stand for black pixels and ones stand for white pixels. The argument <var class="Arg">picture</var> can also be an integer matrix, in which case a 24-bit true color picture file is generated. In this case, the entries of the matrix are supposed to be integers <span class="SimpleMath">n = 65536 ⋅ red + 256 ⋅ green + blue</span> in the range <span class="SimpleMath">0, dots, 2^24-1</span> specifying the RGB values of the colors of the pixels.</p>
<p>The picture can be read back into <strong class="pkg">GAP</strong> by the function <code class="code">LoadBitmapPicture(<var class="Arg">filename</var>)</code>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">color := n->32*(n mod 8)+256*32*(Int(n/8) mod 8)+65536*32*Int(n/64);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">picture := List([1..512],y->List([1..512],x->color(Gcd(x,y)-1)));;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">SaveAsBitmapPicture(picture,Filename(DirectoryTemporary(),"gcd.bmp"));</span>
<p>Draws a line on picture <var class="Arg">pic</var> from (<var class="Arg">x1</var>,<var class="Arg">y1</var>) to (<var class="Arg">x2</var>,<var class="Arg">y2</var>), with color <var class="Arg">color</var> and of width <var class="Arg">width</var>.</p>
<h4>4.7 <span class="Heading">Some general utility functions</span></h4>
<p><strong class="pkg">ResClasses</strong> provides a few small utility functions and -operations which can be used in a more general context. They are described in this section.</p>
<p>There is an operation <code class="code">PositionsSublist(<var class="Arg">list</var>,<var class="Arg">sub</var>)</code> which returns the list of positions at which <var class="Arg">sub</var> occurs as a sublist of <var class="Arg">list</var>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">PositionsSublist([1,2,6,2,7,2,7,2,3,1,6,2,7,2,8],[2,7,2]);</span>
[ 4, 6, 12 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">PositionsSublist([1,2,3,4,3,2,1],[1,3,5]);</span>
[ ]
<span class="GAPprompt">gap></span> <span class="GAPinput">PositionsSublist("This is an example, isn't it?","is"); </span>
[ 3, 6, 21 ]
</pre></div>
<p>Also there are methods <code class="code">EquivalenceClasses(<var class="Arg">l</var>,<var class="Arg">inv</var>)</code> and <code class="code">EquivalenceClasses(<var class="Arg">l</var>,<var class="Arg">rel</var>)</code> which decompose a list <var class="Arg">l</var> into equivalence classes under an equivalence relation. The equivalence relation is given either as a function <varclass="Arg">inv</var> computing a class invariant of a given list entry or as a function <var class="Arg">rel</var> which takes as arguments two list entries and returns either <code class="code">true</code> or <code class="code">false</code> depending on whether the arguments belong to the same equivalence class or not.</p>
<p>Further, there is an operation <code class="code">GraphClasses(<var class="Arg">n</var>)</code> which returns a list of isomorphism classes of graphs with vertices <span class="SimpleMath">1, 2, dots, n</span>, and an operation <code class="code">AllGraphs(<var class="Arg">n</var>)</code> which returns a list of representatives of these classes. The graphs are represented as lists of edges, where each edge is a list of the two vertices it connects, and they are ordered by ascending number of edges. Given a graph <var class="Arg">graph</var> with <var class="Arg">n</var> vertices, the operation <code class="code">IdGraphNC(<var class="Arg">graph</var>,GraphClasses(<var class="Arg">n</var>))</code> returns the index <code class="code">i</code> such that <var class="Arg">graph</var> lies in <code class="code">GraphClasses(<var class="Arg">n</var>)[i]</code>. For reasons of efficiency, <code class="code">IdGraphNC</code> performs no argument checks.</p>
¤ 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.17Bemerkung:
(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.