Quelle chap6_mj.html
Sprache: HTML
|
|
| products/sources/formale Sprachen/GAP/pkg/browse/doc/chap6_mj.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>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (Browse) - Chapter 6: Examples of Applications based on NCurses.BrowseGeneric
</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="chap6" onload="jscontent()">
<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chap5_mj.html">5</a> <a href="chap6_mj.html">6</a> <a href="chapA_mj.html">A</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap5_mj.html">[Previous Chapter]</a> <a href="chapA_mj.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap6.html">[MathJax off]</a></p>
<p><a id="X78D4F8EA79405AF9" name="X78D4F8EA79405AF9"></a></p>
<div class="ChapSects"><a href="chap6_mj.html#X78D4F8EA79405AF9">6 <span class="Heading">Examples of Applications based on <code class="code">NCurses.BrowseGeneric</code>
</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X813F90F7815AB5B3">6.1 <span class="Heading">The Operation <code class="code">Browse</code></span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7FDD696B7DD54A6E">6.1-1 Browse</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7F6EE19480D10E2B">6.2 <span class="Heading">Matrix Display</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X8295F85D87118C83">6.2-1 NCurses.BrowseDenseList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7AD78A0B7BEDBB20">6.2-2 Browse</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X8720923F7FDE5223">6.3 <span class="Heading">Character Table Display</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X870C744182073CF6">6.3-1 Browse</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7D80A56D853C9655">6.3-2 BrowseDecompositionMatrix</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X80E9A03780DE8891">6.4 <span class="Heading">Table of Marks Display</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7F4BD9C580BBBAA4">6.4-1 Browse</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X80370827793813FD">6.5 <span class="Heading">Table of Contents of <strong class="pkg">AtlasRep</strong></span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X8411AF928194C5AB">6.5-1 <span class="Heading">BrowseAtlasInfo</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7CF999297B331E01">6.6 <span class="Heading">Access to <strong class="pkg">GAP</strong> Manuals–a Variant</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7D79DF9181A15EDF">6.6-1 BrowseGapManuals</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X846751CC7F54F51D">6.7 <span class="Heading">Overview of Bibliographies</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7F0FE4CC7F46ABF3">6.7-1 BrowseBibliography</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7E4B5E277D08987B">6.7-2 BrowseBibliographyGapPackages</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X81F1558678ACDB4A">6.7-3 BrowseMSC</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X837BDF547FF0EA31">6.8 <span class="Heading">Profiling <strong class="pkg">GAP</strong> functions–a Variant</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7B42091982DE7AE7">6.8-1 BrowseProfile</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X87B30F7387C0E531">6.9 <span class="Heading">Variables defined in <strong class="pkg">GAP</strong> packages–a Variant</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X8030B1688335783D">6.9-1 BrowsePackageVariables</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7CD025147D528741">6.10 <span class="Heading">Configuring User preferences–a Variant</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7A7B712E7A06449F">6.10-1 BrowseUserPreferences</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X86C730A07855238D">6.11 <span class="Heading">Overview of <strong class="pkg">GAP</strong> Data</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X850C786C87A4877B">6.11-1 BrowseGapData</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7FC24FCE7A0C6058">6.11-2 BrowseGapDataAdd</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7E3FDA927E62D963">6.12 <span class="Heading">Navigating in a Directory Tree</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X859682DE8397261E">6.12-1 BrowseDirectory</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7FAE33037D09CC4E">6.13 <span class="Heading">A Puzzle</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X7EF5FCBD7DAFFAF3">6.13-1 BrowsePuzzle</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7FFF943D78A403C9">6.14 <span class="Heading">Peg Solitaire</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X82C8691380FCB674">6.14-1 PegSolitaire</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X862CB73B7E0BE170">6.15 <span class="Heading">Rubik's Cube
</ span>
< div class= "ContSSBlock">
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X8100659E81FFE9A2">6.15-1 BrowseRubiksCube</a></ span>
</ div></ div>
< div class= "ContSect">< span class= "tocline">< span class= "nocss"> </ span><a href= "chap6_mj.html#X7ADD618186541123">6.16 < span class= "Heading">Changing Sides</ span></a>
</ span>
< div class= "ContSSBlock">
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X7FCFC5858584F46E">6.16-1 BrowseChangeSides</a></ span>
</ div></ div>
< div class= "ContSect">< span class= "tocline">< span class= "nocss"> </ span><a href= "chap6_mj.html#X7DDE46668321B5E9">6.17 < span class= "Heading">Sudoku</ span></a>
</ span>
< div class= "ContSSBlock">
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X789D3D4C818F4BC2">6.17-1 Sudoku.Init</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X86A5C6CE79DD67EE">6.17-2 Sudoku.Place</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X8401B31A879F9F9F">6.17-3 Sudoku.RandomGame</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X86917AC57C25A68F">6.17-4 Sudoku.SimpleDisplay</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X81F98C6C7C8415AB">6.17-5 Sudoku.DisplayString</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X7C73C6D08293B3B8">6.17-6 Sudoku.OneSolution</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X865DDBDC7E16217F">6.17-7 Sudoku.UniqueSolution</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X7D19224478E86BB4">6.17-8 PlaySudoku</a></ span>
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X804D66D67B908F30">6.17-9 Sudoku.HTMLGame</a></ span>
</ div></ div>
< div class= "ContSect">< span class= "tocline">< span class= "nocss"> </ span><a href= "chap6_mj.html#X78E8DF8381626623">6.18 < span class= "Heading">Managing simple Workflows</ span></a>
</ span>
< div class= "ContSSBlock">
< span class= "ContSS">< br />< span class= "nocss"> </ span><a href= "chap6_mj.html#X7E47FC2378C276C6">6.18-1 < span class= "Heading">BrowseWizard</ span></a>
</ span>
</ div></ div>
< div class= "ContSect">< span class= "tocline">< span class= "nocss"> </ span><a href= "chap6_mj.html#X7BCE1AE37EFCE91D">6.19 < span class= "Heading">Utility for < strong class= "pkg">GAP</ strong> De mos</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap6_mj.html#X80F418C5835C62BA">6.19-1 LoadDemoFile</a></span>
</div></div>
</div>
<h3>6 <span class="Heading">Examples of Applications based on <code class="code">NCurses.BrowseGeneric</code>
</span></h3>
<p>This chapter introduces the operation <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) and lists several examples how the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) can be utilized for rendering <strong class="pkg">GAP</strong> related data or for playing games. Each section describes the relevant <strong class="pkg">GAP</strong> functions and briefly sketches the technical aspects of the implementation; more details can be found in the <strong class="pkg">GAP</strong> files, in the <code class="file">app</code> directory of the package.</p>
<p>Only Section <a href="chap6_mj.html#X80E9A03780DE8891"><span class="RefLink">6.4</span></a> describes a standard application in the sense of the introduction to Chapter <a href="chap4_mj.html#X877E60DE7F53FDEC"><span class="RefLink">4</span></a>, perhaps except for a special function that is needed to compare table entries. The other examples in this chapter require some of the programming described in Chapter <a href="chap5_mj.html#X82DDDC1783B4CA30"><span class="RefLink">5</span></a>.</p>
<p>The <strong class="pkg">GAP</strong> examples in this chapter use the "replay" feature of <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>), see Section <a href="chap4_mj.html#X869EDB308717F199"><span class="RefLink">4.1</span></a>. This means that the <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) based function is called between two calls of <code class="func">BrowseData.SetReplay</code> (<a href="chap5_mj.html#X791FB5BA7A9951F4"><span class="RefLink">5.4-2</span></a>). If you want to paste these examples into the <strong class="pkg">GAP</strong> session with the mouse then do not paste the final <code class="func">BrowseData.SetReplay</code> (<a href="chap5_mj.html#X791FB5BA7A9951F4"><span class="RefLink">5.4-2</span></a>) call, since <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) would regard the additional input as a user interrupt.</p>
<p><a id="X813F90F7815AB5B3" name="X813F90F7815AB5B3"></a></p>
<h4>6.1 <span class="Heading">The Operation <code class="code">Browse</code></span></h4>
<p><a id="X7FDD696B7DD54A6E" name="X7FDD696B7DD54A6E"></a></p>
<h5>6.1-1 Browse</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Browse</code>( <var class="Arg">obj</var>[, <var class="Arg">arec</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This operation displays the <strong class="pkg">GAP</strong> object <var class="Arg">obj</var> in a nice, formatted way, similar to the operation <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>). The difference is that <code class="func">Browse</code> is intended to use <code class="code">ncurses</code> facilities.</p>
<p>Currently there are methods for matrices (see <code class="func">Browse</code> (<a href="chap6_mj.html#X7AD78A0B7BEDBB20"><span class="RefLink">6.2-2</span></a>)), for character tables (see <code class="func">Browse</code> (<a href="chap6_mj.html#X870C744182073CF6"><span class="RefLink">6.3-1</span></a>)) and for tables of marks (see <code class="func">Browse</code> (<a href="chap6_mj.html#X7F4BD9C580BBBAA4"><span class="RefLink">6.4-1</span></a>)).</p>
<p><a id="X7F6EE19480D10E2B" name="X7F6EE19480D10E2B"></a></p>
<h4>6.2 <span class="Heading">Matrix Display</span></h4>
<p>The <strong class="pkg">GAP</strong> library provides several <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) methods for matrices. In order to cover the functionality of these methods, <strong class="pkg">Browse</strong> provides the function <code class="func">NCurses.BrowseDenseList</code> (<a href="chap6_mj.html#X8295F85D87118C83"><span class="RefLink">6.2-1</span></a>) that uses the standard facilities of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>), i. e., one can scroll in the matrix, searching and sorting are provided etc.</p>
<p>The idea is to customize this function for different special cases, and to install corresponding <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) methods. Examples are methods for matrices over finite fields and residue class rings of the rational integers, see <code class="func">Browse</code> (<a href="chap6_mj.html#X7AD78A0B7BEDBB20"><span class="RefLink">6.2-2</span></a>).</p>
<p>The code can be found in the file <code class="file">app/matdisp.g</code> of the package.</p>
<p><a id="X8295F85D87118C83" name="X8295F85D87118C83"></a></p>
<h5>6.2-1 NCurses.BrowseDenseList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NCurses.BrowseDenseList</code>( <var class="Arg">list</var>, <var class="Arg">arec</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: nothing.</p>
<p>Let <var class="Arg">list</var> be a dense list whose entries are lists, for example a matrix, and let <var class="Arg">arec</var> be a record. This function displays <var class="Arg">list</var> in a window, as a two-dimensional array with row and column positions as row and column labels, respectively.</p>
<p>The following components of <var class="Arg">arec</var> are supported.</p>
<dl>
<dt><strong class="Mark"><code class="code">header</code></strong></dt>
<dd><p>If bound, the value must be a valid value of the <code class="code">work.header</code> component of a browse table, see <code class="func">BrowseData.IsBrowseTable</code> (<a href="chap4_mj.html#X81007E2F8552523B"><span class="RefLink">4.2-3</span></a>); for example, the value can be a list of strings. If this component is not bound then the browse table has no header.</p>
</dd>
<dt><strong class="Mark"><code class="code">footer</code></strong></dt>
<dd><p>If bound, the value must be a valid value of the <code class="code">work.footer</code> component of a browse table, see <code class="func">BrowseData.IsBrowseTable</code> (<a href="chap4_mj.html#X81007E2F8552523B"><span class="RefLink">4.2-3</span></a>); for example, the value can be a list of strings. If this component is not bound then the browse table has no footer.</p>
</dd>
<dt><strong class="Mark"><code class="code">convertEntry</code></strong></dt>
<dd><p>If bound, the value must be a unary function that returns a string describing its argument. The default is the operation <code class="func">String</code> (<a href="../../../doc/ref/chap27_mj.html#X81FB5BE27903EC32"><span class="RefLink">Reference: String</span></a>). Another possible value is <code class="code">NCurses.ReplaceZeroByDot</code>, which returns the string <code class="code">"."</code> if the argument is a zero element in the sense of <code class="func">IsZero</code> (<a href="../../../doc/ref/chap31_mj.html#X82BDA47282F9BBA7"><span class="RefLink">Reference: IsZero</span></a>), and returns the <code class="func">String</code> (<a href="../../../doc/ref/chap27_mj.html#X81FB5BE27903EC32"><span class="RefLink">Reference: String</span></a>) value otherwise. For each entry in a row of <var class="Arg">list</var>, the <code class="code">convertEntry</code> value is shown in the browse table.</p>
</dd>
<dt><strong class="Mark"><code class="code">labelsRow</code></strong></dt>
<dd><p>If bound, the value must be a list of row label rows for <var class="Arg">list</var>, as described in Section <code class="func">BrowseData.IsBrowseTable</code> (<a href="chap4_mj.html#X81007E2F8552523B"><span class="RefLink">4.2-3</span></a>). The default is <code class="code">[ [ "1" ], [ "2" ], ... ]</code>.</p>
</dd>
<dt><strong class="Mark"><code class="code">labelsCol</code></strong></dt>
<dd><p>If bound, the value must be a list of column label rows for <var class="Arg">list</var>, as described in Section <code class="func">BrowseData.IsBrowseTable</code> (<a href="chap4_mj.html#X81007E2F8552523B"><span class="RefLink">4.2-3</span></a>). The default is <code class="code">[ [ "1", "2", ... ] ]</code>.</p>
</dd>
</dl>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<p><a id="X7AD78A0B7BEDBB20" name="X7AD78A0B7BEDBB20"></a></p>
<h5>6.2-2 Browse</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Browse</code>( <var class="Arg">list</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>Returns: nothing.</p>
<p>Several methods for the operation <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) are installed for the case that the argument is a list of lists. These methods cover a default method for lists of lists and the <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) methods for matrices over finite fields and residue class rings of the rational integers. Note that matrices over finite prime fields, small extension fields, and large extension fields are displayed differently, and the same holds for the corresponding <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) methods.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">n:= [ 14, 14, 14, 14 ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">input:= Concatenation( n, n, n, "Q" );; # ``do nothing and quit''</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, Integers ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, GF(3) ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, GF(4) ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, Integers mod 6 ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, GF( NextPrimeInt( 2^16 ) ) ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( input );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Browse( RandomMat( 10, 10, GF( 2^20 ) ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( false );</span>
</pre></div>
<p><a id="X8720923F7FDE5223" name="X8720923F7FDE5223"></a></p>
<h4>6.3 <span class="Heading">Character Table Display</span></h4>
<p>The <strong class="pkg">GAP</strong> library provides a <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) method for character tables that breaks the table into columns fitting on the screen. <strong class="pkg">Browse</strong> provides an alternative, using the standard facilities of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>), i. e., one can scroll in the matrix of character values, searching and sorting are provided etc.</p>
<p>The <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) method for character tables can be called instead of <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>). For convenience, one can additionally make this function the default <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) method for character tables, by assigning it to the <code class="code">Display</code> component in the global record <code class="code">CharacterTableDisplayDefaults.User</code>, see <a href="../../../doc/ref/chap71_mj.html#X7C1941F17BE9FC21"><span class="RefLink">Reference: Printing Character Tables</span></a>; for example, one can do this in one's gaprc file, see Reference: The gap.ini and gaprc files. (This can be undone by unbinding the component CharacterTableDisplayDefaults.User.Display.)
<p>The function <code class="func">BrowseDecompositionMatrix</code> (<a href="chap6_mj.html#X7D80A56D853C9655"><span class="RefLink">6.3-2</span></a>) can be used to display decomposition matrices for Brauer character tables.</p>
<p><a id="X870C744182073CF6" name="X870C744182073CF6"></a></p>
<h5>6.3-1 Browse</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Browse</code>( <var class="Arg">tbl</var>[, <var class="Arg">options</var>] )</td><td class="tdright">( method )</td></tr></table></div>
<p>This method displays the character table <var class="Arg">tbl</var> in a window. The optional record <var class="Arg">options</var> describes what shall be displayed, the supported components and the default values are described in <a href="../../../doc/ref/chap71_mj.html#X7C1941F17BE9FC21"><span class="RefLink">Reference: Printing Character Tables</span></a>.</p>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">if TestPackageAvailability( "CTblLib" ) = true then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # scroll in the table</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "DRULdddddrrrrrlluu",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # select an entry and move it around</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "seddrruuuddlll",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # search for the pattern 135 (six times)</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "/135", [ NCurses.keys.ENTER ], "nnnnn",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # deselect the entry, select the first column</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "qLsc",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # sort and categorize by this column</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "sc",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # select the first row, move down the selection</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "srdddd",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # expand the selected category, scroll the selection down</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "xd",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # and quit the application</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q" ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Browse( CharacterTable( "HN" ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> BrowseData.SetReplay( false );</span>
<span class="GAPprompt">></span> <span class="GAPinput">fi;</span>
</pre></div>
<p><em>Implementation remarks</em>: The first part of the code in the <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) method for character tables is almost identical with the code for extracting the data to be displayed from the input data in the <strong class="pkg">GAP</strong> library function <code class="code">CharacterTableDisplayDefault</code>. The second part of the code transforms these data into a browse table. Character names and (if applicable) indicator values are used as row labels, and centralizer orders, power maps, and class names are used as column labels. The identifier of the table is used as the static header. When an irrational entry is selected, a description of this entry is shown in the dynamic footer.</p>
<p>The standard modes in <code class="func">BrowseData</code> (<a href="chap5_mj.html#X86E80E578085F137"><span class="RefLink">5.4-1</span></a>) (except the <code class="code">help</code> mode) have been extended by three new actions. The first two of them open pagers giving an overview of all irrationalities in the table, or of all those irrationalities that have been shown on the screen in the current call, respectively. The corresponding user inputs are the <strong class="button">I</strong> and the <strong class="button">i</strong> key. (The names assigned to the irrationalities are generated column-wise. If one just scrolls through the table, without jumping, then these names coincide with the names generated by the default <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) method for character tables; this is in general <em>not</em> the case, for example when a row-wise search in the table is performed.) The third new action, which is associated with the <strong class="button">p</strong> key, toggles the visibility status of the column label rows for centralizer orders and power maps.</p>
<p>An individual <code class="code">minyx</code> function does not only check whether the desired table fits into the window but also whether a table with too high column labels (centralizer orders and power maps) would fit if these labels get collapsed via the <strong class="button">p</strong> key. In this case, the labels are automatically collapsed, and the <strong class="button">p</strong> key is disabled.</p>
<p>In order to keep the required space small also for large character tables, caching of formatted matrix entries is disabled, and the strings to be displayed are computed on demand with a <code class="code">Main</code> function in the <code class="code">work</code> component of the browse table. For the same reason, the constant height one for all table rows is set in advance, so one need not inspect a whole character if only a few values of it shall be shown.</p>
<p>Special functions are provided for sorting (concerning the comparison of character values, which can be integers or irrationalities) and categorizing the table by a column (the value in the category row involves the class name of the column in question).</p>
<p>The code can be found in the file <code class="file">app/ctbldisp.g</code> of the package.</p>
<p><a id="X7D80A56D853C9655" name="X7D80A56D853C9655"></a></p>
<h5>6.3-2 BrowseDecompositionMatrix</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BrowseDecompositionMatrix</code>( <var class="Arg">modtbl</var>[, <var class="Arg">b</var>][, <var class="Arg">options</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>This method displays the decomposition matrix of (the <var class="Arg">b</var>-th block of) the Brauer character table <var class="Arg">modtbl</var> in a window. The arguments are the same as for <code class="func">LaTeXStringDecompositionMatrix</code> (<a href="../../../doc/ref/chap71_mj.html#X83EC921380AF9B3B"><span class="RefLink">Reference: LaTeXStringDecompositionMatrix</span></a>).</p>
<p>The positions of the ordinary and modular irreducible characters are shown in the labels of the rows and columns, respectively, that are indexed by these characters. When an entry in the decomposition matrix is selected then information about the degrees of these characters is shown in the table footer.</p>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # select the first entry</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "se",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # scroll in the table</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "drrrr",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # keep the table open for a while</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 14, 14, 14, 14, 14 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # and quit the application</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q" ) );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseDecompositionMatrix( CharacterTable( "J1" ) mod 2 );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( false );</span>
</pre></div>
<p>The code can be found in the file <code class="file">app/ctbldisp.g</code> of the package.</p>
<p><a id="X80E9A03780DE8891" name="X80E9A03780DE8891"></a></p>
<h4>6.4 <span class="Heading">Table of Marks Display</span></h4>
<p>The <strong class="pkg">GAP</strong> library provides a <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) method for tables of marks that breaks the table into columns fitting on the screen. Similar to the situation with character tables, see Section <a href="chap6_mj.html#X8720923F7FDE5223"><span class="RefLink">6.3</span></a>, but with a much simpler implementation, <strong class="pkg">Browse</strong> provides an alternative based on the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>).</p>
<p><code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) can be called instead of <code class="func">Display</code> (<a href="../../../doc/ref/chap6_mj.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) for tables of marks, cf. <a href="../../../doc/ref/chap70_mj.html#X7AC0FB9685DCBCFD"><span class="RefLink">Reference: Printing Tables of Marks</span></a>.</p>
<p><a id="X7F4BD9C580BBBAA4" name="X7F4BD9C580BBBAA4"></a></p>
<h5>6.4-1 Browse</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Browse</code>( <var class="Arg">tom</var>[, <var class="Arg">options</var>] )</td><td class="tdright">( method )</td></tr></table></div>
<p>This method displays the table of marks <var class="Arg">tom</var> in a window. The optional record <var class="Arg">options</var> describes what shall be displayed, the supported components and the default values are described in <a href="../../../doc/ref/chap70_mj.html#X7AC0FB9685DCBCFD"><span class="RefLink">Reference: Printing Tables of Marks</span></a>.</p>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">if TestPackageAvailability( "TomLib" ) = true then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # scroll in the table</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "DDRRR",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # search for the (exact) value 100 (three times)</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "/100",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ NCurses.keys.DOWN, NCurses.keys.DOWN, NCurses.keys.RIGHT ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ NCurses.keys.DOWN, NCurses.keys.DOWN, NCurses.keys.DOWN ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ NCurses.keys.RIGHT, NCurses.keys.ENTER ], "nn",</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # no more occurrences of 100, confirm</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ NCurses.keys.ENTER ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # and quit the application</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q" ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Browse( TableOfMarks( "A10" ) );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> BrowseData.SetReplay( false );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
</pre></div>
<p><em>Implementation remarks</em>: Rows and columns are indexed by their positions. The identifier of the table is used as the static header, there is no footer.</p>
<p>In order to keep the required space small also for large tables of marks, caching of formatted matrix entries is disabled, and the strings to be displayed are computed on demand with a <code class="code">Main</code> function in the <code class="code">work</code> component of the browse table. For the same reason, the constant height one for the table rows is set in advance. (For example, the table of marks of the group with identifier <code class="code">"O8+(2)"</code>, with <span class="SimpleMath">\(11171\)</span> rows and columns, can be shown with <code class="func">Browse</code> (<a href="chap6_mj.html#X7FDD696B7DD54A6E"><span class="RefLink">6.1-1</span></a>) in a <strong class="pkg">GAP</strong> session requiring about <span class="SimpleMath">\(100\)</span> MB.)</p>
<p>The code can be found in the file <code class="file">app/tomdisp.g</code> of the package.</p>
<p><a id="X80370827793813FD" name="X80370827793813FD"></a></p>
<h4>6.5 <span class="Heading">Table of Contents of <strong class="pkg">AtlasRep</strong></span></h4>
<p>The <strong class="pkg">GAP</strong> package <strong class="pkg">AtlasRep</strong> (see <a href="chapBib_mj.html#biBAtlasRep">[WPN+19]</a>) is an interface to a database of representations and related data. The table of contents of this database can be displayed via the function <code class="func">DisplayAtlasInfo</code> (<a href="../../../pkg/atlasrep/doc/chap3_mj.html#X79DACFFA7E2D1A99"><span class="RefLink">AtlasRep: DisplayAtlasInfo</span></a>) of this package. The <strong class="pkg">Browse</strong> package provides an alternative based on the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>); one can scroll, search, and fetch data for later use.</p>
<p><a id="X8411AF928194C5AB" name="X8411AF928194C5AB"></a></p>
<h5>6.5-1 <span class="Heading">BrowseAtlasInfo</span></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BrowseAtlasInfo</code>( [<var class="Arg">listofnames</var>][,] [<var class="Arg">"contents"</var>, <var class="Arg">sources</var>][,] [<var class="Arg">...</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BrowseAtlasInfo</code>( <var class="Arg">gapname</var>[, <var class="Arg">std</var>][, <var class="Arg">...</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the list of "clicked" info records.</p>
<p>This function shows the information available via the <strong class="pkg">GAP</strong> package <strong class="pkg">AtlasRep</strong> in a browse table, cf. Section <a href="../../../pkg/atlasrep/doc/chap3_mj.html#X7CC88B2287A72204"><span class="RefLink">AtlasRep: Accessing Data via AtlasRep</span></a> in the <strong class="pkg">AtlasRep</strong> manual.</p>
<p>The optional arguments can be used to restrict the table to core data or data extensions, or to show an overview for one particular group. The arguments are the same as for <code class="func">DisplayAtlasInfo</code> (<a href="../../../pkg/atlasrep/doc/chap3_mj.html#X79DACFFA7E2D1A99"><span class="RefLink">AtlasRep: DisplayAtlasInfo</span></a>), see the documentation of this function for details. (Note that additional conditions such as <code class="func">IsPermGroup</code> (<a href="../../../doc/ref/chap43_mj.html#X7879877482F59676"><span class="RefLink">Reference: IsPermGroup</span></a>) can be entered also in the case that no <var class="Arg">gapname</var> is given. In this situation, the additional conditions are evaluated for the "second level tables" that are opened by "clicking" on a table row or entry.)</p>
<p>When one "clicks" on one of the table rows or entries then a browse table with an overview of the information available for this group is shown, and "clicking" on one of the rows in these tables adds the corresponding info record (see <code class="func">OneAtlasGeneratingSetInfo</code> (<a href="../../../pkg/atlasrep/doc/chap3_mj.html#X841478AB7CD06D44"><span class="RefLink">AtlasRep: OneAtlasGeneratingSetInfo</span></a>)) to the list of return values of <code class="func">BrowseAtlasInfo</code>.</p>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<p>The following example shows how <code class="func">BrowseAtlasInfo</code> can be used to fetch info records about permutation representations of the alternating groups <span class="SimpleMath">\(A_5\)</span> and <span class="SimpleMath">\(A_6\)</span>: We search for the group name <code class="code">"A5"</code> in the overview table, and the first cell in the table row for <span class="SimpleMath">\(A_5\)</span> becomes selected; hitting the <strong class="button">Enter</strong> key causes a new window to be opened, with an overview of the data available for <span class="SimpleMath">\(A_5\)</span>; moving down two rows and hitting the <strong class="button">Enter</strong> key again causes the second representation to be added to the result list; hitting <strong class="button">Q</strong> closes the second window, and we are back in the overview table; we move the selection down twice (to the row for the group <span class="SimpleMath">\(A_6\)</span>), and choose the first representation for this group; finally we leave the table, and the return value is the list with the data for the two representations.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">d:= [ NCurses.keys.DOWN ];; r:= [ NCurses.keys.RIGHT ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">c:= [ NCurses.keys.ENTER ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "/A5", # Find the string A5 ...</span>
<span class="GAPprompt">></span> <span class="GAPinput"> d, d, r, # ... such that just the word matches,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> c, # start the search,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> c, # click the table entry A5,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> d, d, # move down two rows,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> c, # click the row for this representation,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q", # quit the second level table,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> d, d, # move down two rows,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> c, # click the table entry A6,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> d, # move down one row,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> c, # click the first row,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q", # quit the second level table,</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "Q" ) ); # and quit the application.</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">if IsBound( BrowseAtlasInfo ) and IsBound( AtlasProgramInfo ) then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> SetUserPreference( "AtlasRep", "AtlasRepMarkNonCoreData", "" );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> tworeps:= BrowseAtlasInfo();</span>
<span class="GAPprompt">></span> <span class="GAPinput"> else</span>
<span class="GAPprompt">></span> <span class="GAPinput"> tworeps:= [ fail ];</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( false );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">if fail in tworeps then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Print( "no access to the Web ATLAS\n" );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> else</span>
<span class="GAPprompt">></span> <span class="GAPinput"> Print( List( tworeps, x -> x.identifier[1] ), "\n" );</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
[ "A5", "A6" ]
</pre></div>
<p><em>Implementation remarks</em>: The first browse table shown has a static header, no footer and row labels, one row of column labels describing the type of data summarized in the columns.</p>
<p>Row and column separators are drawn as grids (cf. <code class="func">NCurses.Grid</code> (<a href="chap2_mj.html#X790715F683BF1E66"><span class="RefLink">2.2-8</span></a>)) composed from the special characters described in Section <a href="chap2_mj.html#X8091936586CCD248"><span class="RefLink">2.1-6</span></a>, using the component <code class="code">work.SpecialGrid</code> of the browse table, see <code class="func">BrowseData</code> (<a href="chap5_mj.html#X86E80E578085F137"><span class="RefLink">5.4-1</span></a>).</p>
<p>When a row is selected, the "click" functionality opens a new window (via a second level call to <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>)), in which a browse table with the list of available data for the given group is shown; in this table, "click" results in adding the info for the selected row to the result list, and a message about this addition is shown in the footer row. One can choose further data, return to the first browse table, and perhaps iterate the process for other groups. When the first level table is left, the list of info records for the chosen data is returned.</p>
<p>For the two kinds of browse tables, the standard modes in <code class="func">BrowseData</code> (<a href="chap5_mj.html#X86E80E578085F137"><span class="RefLink">5.4-1</span></a>) (except the <code class="code">help</code> mode) have been extended by a new action that opens a pager giving an overview of all data that have been chosen in the current call. The corresponding user input is the <strong class="button">Y</strong> key.</p>
<p>This function is available only if the <strong class="pkg">GAP</strong> package <strong class="pkg">AtlasRep</strong> is available.</p>
<p>The code can be found in the file <code class="file">app/atlasbrowse.g</code> of the package.</p>
<p><a id="X7CF999297B331E01" name="X7CF999297B331E01"></a></p>
<h4>6.6 <span class="Heading">Access to <strong class="pkg">GAP</strong> Manuals–a Variant</span></h4>
<p>A <strong class="pkg">Browse</strong> adapted way to access several manuals is to show the hierarchy of books, chapters, sections, and subsections as collapsible category rows, and to regard the contents of each subsection as a data row of a matrix with only one column.</p>
<p>This application is mainly intended as an example with table cells that exceed the screen, and as an example with several category levels.</p>
<p><a id="X7D79DF9181A15EDF" name="X7D79DF9181A15EDF"></a></p>
<h5>6.6-1 BrowseGapManuals</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BrowseGapManuals</code>( [<var class="Arg">start</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function displays the contents of the <strong class="pkg">GAP</strong> manuals (the main <strong class="pkg">GAP</strong> manuals as well as the loaded package manuals) in a window. The optional argument <var class="Arg">start</var> describes the initial status, admissible values are the strings <code class="code">"inline/collapsed"</code>, <code class="code">"inline/expanded"</code>, <code class="code">"pager/collapsed"</code>, and <code class="code">"pager/expanded"</code>.</p>
<p>In the <code class="code">inline</code> cases, the parts of the manuals are shown in the browse table, and in the <code class="code">pager</code> case, the parts of the manuals are shown in a different window when they are "clicked", using the user's favourite help viewer, see Reference: Changing the Help Viewer.
<p>In the <code class="code">collapsed</code> cases, all category rows are collapsed, and the first row is selected; typical next steps are moving down the selection and expanding single category rows. In the <code class="code">expanded</code> cases, all category rows are expanded, and nothing is selected; a typical next step in the <code class="code">inline/expanded</code> case is a search for a string in the manuals. (Note that searching in quite slow: For viewing a part of a manual, the file with the corresponding section is read into <strong class="pkg">GAP</strong>, the text is formatted, the relevant part is cut out from the section, perhaps markup is stripped off, and finally the search is performed in the resulting strings.)</p>
<p>If no argument is given then the user is asked for selecting an initial status, using <code class="func">NCurses.Select</code> (<a href="chap3_mj.html#X833D321E86528981"><span class="RefLink">3.1-2</span></a>).</p>
<p>The full functionality of the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) is available.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">n:= [ 14, 14, 14 ];; # ``do nothing''</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "xdxd", # expand a Tutorial section</span>
<span class="GAPprompt">></span> <span class="GAPinput"> n, "Q" ) ); # and quit</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseGapManuals( "inline/collapsed" );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( Concatenation(</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "/Browse", [ NCurses.keys.ENTER ], # search for "Browse"</span>
<span class="GAPprompt">></span> <span class="GAPinput"> "xdxddxd", # expand a section</span>
<span class="GAPprompt">></span> <span class="GAPinput"> n, "Q" ) ); # and quit</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseGapManuals( "inline/collapsed" );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">BrowseData.SetReplay( false );</span>
</pre></div>
<p><em>Implementation remarks</em>: The browse table has a dynamic header showing the name of the currently selected manual, no footer, no row or column labels, and exactly one column of fixed width equal to the screen width. The category rows are precomputed, i. e., they do not arise from a table column; this way, the contents of each data cell can be computed on demand, as soon as it is shown on the screen, in particular the category hierarchy is computed without reading the manuals into <strong class="pkg">GAP</strong>. Also, the data rows are not cached. There is no return value. The heights of many cells are bigger than the screen height, so scrolling is a mixture of scrolling to the next cell and scrolling inside a cell. The different initial states are realized via executing different initial steps before the table is shown to the user.</p>
<p>For the variants that show the manuals in a pager, the code temporarily replaces the <code class="code">show</code> function of the default viewer <code class="code">"screen"</code> (see <a href="../../../doc/ref/chap2_mj.html#X863FF9087EDA8DF9"><span class="RefLink">Reference: Changing the Help Viewer</span></a>) by a function that uses <code class="func">NCurses.Pager</code> (<a href="chap3_mj.html#X87E1B2787F588CC0"><span class="RefLink">3.1-4</span></a>). Note that in the case that the manual bit in question fits into one screen, the default <code class="code">show</code> function writes this text directly to the screen, but this is used already by the browse table.</p>
<p>The implementation should be regarded as a sketch.</p>
<p>For example, the markup available in the text file format of <strong class="pkg">GAPDoc</strong> manuals (using <strong class="button">Esc</strong> sequences) is stripped off instead of being transferred to the attribute lines that arise, because of the highlighting problem mentioned in Section <a href="chap2_mj.html#X81D1FC927C455AEB"><span class="RefLink">2.2-3</span></a>.</p>
<p>Some heuristics used in the code are due to deficiencies of the manual formats.</p>
<p>For the inline variant of the browse table, the titles of chapters, sections, and subsections are <em>not</em> regarded as parts of the actual text since they appear already as category rows; however, the functions of the <strong class="pkg">GAP</strong> help system deliver the text <em>together with</em> these titles, so these lines must be stripped off afterwards.</p>
<p>The category hierarchy representing the tables of contents is created from the <code class="file">manual.six</code> files of the manuals. These files do not contain enough information for determining whether several functions define the same subsection, in the sense that there is a common description text after a series of manual lines introducing different functions. In such cases, the browse table contains a category row for each of these functions (with its own number), but the corresponding text appears only under the <em>last</em> of these category rows, the data rows for the others are empty. (This problem does not occur in the <strong class="pkg">GAPDoc</strong> manual format because this introduces explicit subsection titles, involving only the <em>first</em> of several function definitions.)</p>
<p>Also, index entries and sectioning entries in <code class="file">manual.six</code> files of manuals in <strong class="pkg">GAPDoc</strong> format are not explicitly distinguished.</p>
<p>The code can be found in the file <code class="file">app/manual.g</code> of the package.</p>
<p><a id="X846751CC7F54F51D" name="X846751CC7F54F51D"></a></p>
<h4>6.7 <span class="Heading">Overview of Bibliographies</span></h4>
<p>The function <code class="func">BrowseBibliography</code> (<a href="chap6_mj.html#X7F0FE4CC7F46ABF3"><span class="RefLink">6.7-1</span></a>) can be used to turn the contents of bibliography files in BibTeX or BibXMLext format (see <a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X7FB8F6BD80D859D1"><span class="RefLink">GAPDoc: The BibXMLext Format</span></a>) into a Browse table, such that one can scroll in the list, search for entries, sort by year, sort and categorize by authors etc.</p>
<p>The default bibliography used by <code class="func">BrowseBibliography</code> (<a href="chap6_mj.html#X7F0FE4CC7F46ABF3"><span class="RefLink">6.7-1</span></a>) is the bibliography of <strong class="pkg">GAP</strong> related publications, see <a href="chapBib_mj.html#biBGAPBibliography">[GAP]</a>. The <strong class="pkg">Browse</strong> package contains a (perhaps outdated) version of this bibliography. One can get an updated version as follows.</p>
<p><code class="code">wget -N http://www.gap-system.org/Doc/Bib/gap-publishednicer.bib</code></p>
<p>The columns of the Browse table that is shown by <code class="func">BrowseBibliography</code> (<a href="chap6_mj.html#X7F0FE4CC7F46ABF3"><span class="RefLink">6.7-1</span></a>) can be customized, two examples for that are given by the functions <code class="func">BrowseBibliographySporadicSimple</code> (<a href="../../../pkg/atlasrep/doc/chap3_mj.html#X84ED4FC182C28198"><span class="RefLink">AtlasRep: BrowseBibliographySporadicSimple</span></a>) and <code class="func">BrowseBibliographyGapPackages</code> (<a href="chap6_mj.html#X7E4B5E277D08987B"><span class="RefLink">6.7-2</span></a>).</p>
<p>The function <code class="func">BrowseMSC</code> (<a href="chap6_mj.html#X81F1558678ACDB4A"><span class="RefLink">6.7-3</span></a>) shows an overview of the AMS Mathematics Subject Classification codes.</p>
<p><a id="X7F0FE4CC7F46ABF3" name="X7F0FE4CC7F46ABF3"></a></p>
<h5>6.7-1 BrowseBibliography</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ BrowseBibliography</code>( [<var class="Arg">bibfiles</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a record as returned by <code class="func">ParseBibXMLExtFiles</code> (<a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X86BD29AE7A453721"><span class="RefLink">GAPDoc: ParseBibXMLextFiles</span></a>).</p>
<p>This function shows the list of bibliography entries in the files given by <var class="Arg">bibfiles</var>, which may be a string or a list of strings (denoting a filename or a list of filenames, respectively) or a record (see below for the supported components).</p>
<p>If no argument is given then the file <code class="file">bibl/gap-publishednicer.bib</code> in the <strong class="pkg">Browse</strong> package directory is taken, and <code class="code">"GAP Bibliography"</code> is used as the header.</p>
<p>Another perhaps interesting data file that should be available in the <strong class="pkg">GAP</strong> distribution is <code class="file">doc/manualbib.xml</code>. This file can be located as follows.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">file:= Filename( DirectoriesLibrary( "doc" ), "manualbib.xml" );;</span>
</pre></div>
<p>Both BibTeX format and the <strong class="pkg">XML</strong> based extended format provided by the <strong class="pkg">GAPDoc</strong> package are supported by <code class="func">BrowseBibliography</code>, see Chapter <a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X7EB94CE97ABF7192"><span class="RefLink">GAPDoc: Utilities for Bibliographies</span></a>.</p>
<p>In the case of BibTeX format input, first a conversion to the extended format takes place, via <code class="func">StringBibAsXMLext</code> (<a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X85F33C64787A00B7"><span class="RefLink">GAPDoc: StringBibAsXMLext</span></a>) and <code class="func">ParseBibXMLextString</code> (<a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X86BD29AE7A453721"><span class="RefLink">GAPDoc: ParseBibXMLextString</span></a>). Note that syntactically incorrect entries are rejected in this conversion –this is signaled with <code class="func">InfoBibTools</code> (<a href="../../../pkg/GAPDoc.dev/doc/chap7_mj.html#X85C1D50F7E37A99A"><span class="RefLink">GAPDoc: InfoBibTools</span></a>) warnings– and that only a subset of the possible LaTeX markup is recognized –other markup appears in the browse table except that the leading backslash is removed.</p>
<p>In both cases of input, the problem arises that in visual mode, currently we can show only ASCII characters (and the symbols in <code class="code">NCurses.lineDraw</code>, but these are handled differently, see Section <a href="chap2_mj.html#X8091936586CCD248"><span class="RefLink">2.1-6</span></a>). Therefore, we use the function <code class="func">SimplifiedUnicodeString</c | |