Goto Chapter: Top 1 2 3 4 5 6 7 Bib Ind
 Top of Book   Previous Chapter   Next Chapter 

7. Installation and auxiliary functions
 7.1 Requirements
 7.2 Installation
 7.3 The Info class of the package
  7.3-1 InfoRCWA
 7.4 The testing routine
  7.4-1 RCWATest

7. Installation and auxiliary functions

7.1 Requirements

The RCWA package needs at least GAP 4.4.7, ResClasses 2.5.1, GRAPE 4.0 [Soi02], Polycyclic 2.1 [EN06] and GAPDoc 1.0 [LN07]. With possible exception of the most recent version of ResClasses, all needed packages are already present in an up-to-date standard GAP installation. The RCWA package can be used under UNIX, under Windows and on the MacIntosh. It is completely written in the GAP language and does neither contain nor require external binaries. In particular, warnings concerning missing binaries issued by GRAPE or other packages can savely be ignored.

7.2 Installation

Like any other GAP package, RCWA must be installed in the pkg subdirectory of the GAP distribution. This is accomplished by extracting the distribution file in this directory. If you have done this, you can load the package as usual via LoadPackage( "rcwa" );.

7.3 The Info class of the package

7.3-1 InfoRCWA
> InfoRCWA( info class )

This is the Info class of the RCWA package. See section Info Functions in the GAP Reference Manual for a description of the Info mechanism. For convenience: RCWAInfo(n) is a shorthand for SetInfoLevel(InfoRCWA,n).

7.4 The testing routine

7.4-1 RCWATest
> RCWATest( )( function )

Returns: Nothing.

Performs tests of the RCWA package. Errors, i.e. differences to the correct results of the test computations, are reported. The processed test files are in the directory pkg/rcwa/tst.

7.5 Building the manual

The following routine is a development tool. As all files it generates are included in the distribution file anyway, users will not need it.

7.5-1 RCWABuildManual
> RCWABuildManual( )( function )

Returns: Nothing.

This function builds the manual of the RCWA package in the file formats LaTeX, PDF, HTML and ASCII text. This is accomplished using the GAPDoc package by Frank Lübeck and Max Neunhöffer. Building the manual is possible only on UNIX systems and requires PDFLaTeX.

7.6 Loading and saving bitmap pictures

RCWA provides functions to create 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 produced pictures can be processed further with many common graphics programs:

7.6-1 SaveAsBitmapPicture
> SaveAsBitmapPicture( picture, filename )( function )

Returns: Nothing.

Writes the pixel matrix picture to a bitmap- (bmp-) picture file named filename. The filename should include the entire pathname. The argument picture 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 picture 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 n = 65536 * red + 256 * green + blue in the range 0, dots, 2^24-1 specifying the RGB values of the colors of the pixels.

The picture can be read back into GAP by the function ReadFromBitmapPicture(filename).


gap> color   := n->32*(n mod 8)+256*32*(Int(n/8) mod 8)+65536*32*Int(n/64);;
gap> picture := List([1..512],y->List([1..512],x->color(Gcd(x,y)-1)));;
gap> SaveAsBitmapPicture(picture,"~/images/gcd.bmp");

7.7 Running demonstrations

RCWA provides a routine to run demonstrations of its functionality or of other features of GAP. It is intended for being used in talks.

7.7-1 RunDemonstration
> RunDemonstration( filename )( function )

Returns: Nothing.

This function executes the code in the file named filename. It shows a command and the corresponding output, waits for a keystroke, shows the next command and the corresponding output, waits again for a keystroke, and so on until the end of the file. The demonstration can be stopped by pressing q. The function is adapted from the function Demonstration in the file lib/demo.g of the main GAP distribution.

7.8 Some general utility functions

RCWA introduces a couple of small utility functions which can be used in a more general context: The function GeneratorsAndInverses(G) returns a list of generators of G and their inverses, EpimorphismByGenerators(G,H) is a shorthand for GroupHomomorphismByImages(G,H, GeneratorsOfGroup(G),GeneratorsOfGroup(H)) (there is also an NC version of this), the function ListOfPowers(g,exp) returns the list [g,g^2,...,g^exp] of powers of g, the function AllProducts(l,k) returns the list of all products of k entries of the list l, the function DifferencesList(l) returns the list of differences of consecutive entries of the list l, and the function FloatQuotients(l) returns the list of floating point approximations of quotients of consecutive entries of the list l.

There are also methods EquivalenceClasses(l,inv) and EquivalenceClasses(l,rel), which decompose a list l into equivalence classes under an equivalence relation. The equivalence relation is given either as a function inv computing a class invariant of a given list entry or as a function rel which takes as arguments two list entries and returns either true or false depending on whether the arguments belong to the same equivalence class or not.

 Top of Book   Previous Chapter   Next Chapter 
Goto Chapter: Top 1 2 3 4 5 6 7 Bib Ind

generated by GAPDoc2HTML