Download Maple Advanced Programming Guide
Transcript
2.6 Interfaces and Implementations
•
145
>
do
>
for s in gens[ 1 .. i ] do
>
elt := G:-mul( elements[ rep_pos ], s );
>
if not G:-member( elt, Entries( elements ) ) then
>
addElt( elt );
>
for j from 2 to prev_ord do
>
addElt( G:-‘.‘( elements[ j ], elt ) )
>
end do
>
end if
>
end do;
>
rep_pos := rep_pos + prev_ord;
>
if rep_pos > ord then
>
break
>
end if
>
end do
>
end if
>
end do;
>
Entries( elements )
> end proc:
The coding of this algorithm is generic. The exported members of the
group object G are used to effect computations within the procedure.
Even comparisons of equality use the export eq instead of the built-in
comparison operator ‘=‘. (The need for this is illustrated below.)
Using the Symmetric constructor previously defined, you can compute
the elements of the symmetric group S4 , using Dimino’s algorithm, as
follows.
> G := Symmetric( 4 );
G := module()
export
id , ‘.‘, mul , inv , eq , member , gens , order , elements ;
option record ;
end module
> Dimino( G );
{[2, 1, 3, 4], [2, 3, 1, 4], [1, 2, 3, 4], [3, 2, 1, 4],
[2, 3, 4, 1], [3, 2, 4, 1], [1, 3, 4, 2], [3, 1, 4, 2],
[3, 4, 1, 2], [4, 3, 1, 2], [2, 4, 1, 3], [4, 2, 1, 3],
[3, 4, 2, 1], [4, 3, 2, 1], [4, 1, 2, 3], [1, 4, 2, 3],
[3, 1, 2, 4], [1, 3, 2, 4], [4, 1, 3, 2], [1, 4, 3, 2],
[4, 2, 3, 1], [2, 4, 3, 1], [1, 2, 4, 3], [2, 1, 4, 3]}
Related documents
Sony SRF-59 User's Manual
FM Stereo Radio
FM/AM Clock Radio - Pdfstream.manualsonline.com
Maple Programming Guide
Perl Extension Building with SWIG
Maple Introductory Programming Guide
AN-878 High Speed ADC SPI Control Software
A Maple User`s Guide
Mobile security system with cellular transceiver, position reporting
CSW with GeoNetwork - NETMAR - Nansen Environmental and
Maple Programming Guide - Numerical Relativity Group at UBC
FLANN - Fast Library for Approximate Nearest Neighbors User Manual