[BACK]Return to drivers_for_symmetry_group_io.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Symmetry

Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Symmetry/drivers_for_symmetry_group_io.adb, Revision 1.1

1.1     ! maekawa     1: with text_io,integer_io;                 use text_io,integer_io;
        !             2: with Communications_with_User;           use Communications_with_User;
        !             3: with Numbers_io;                         use Numbers_io;
        !             4: with Symbol_Table,Symbol_Table_io;       use Symbol_Table;
        !             5: with Symbolic_Symmetry_Group_io;
        !             6:
        !             7: package body Drivers_for_Symmetry_Group_io is
        !             8:
        !             9:   procedure Read_Permutation_Group
        !            10:                ( n : in natural; g,v : in out List_of_Permutations;
        !            11:                  allperms : out boolean ) is
        !            12:
        !            13:     ans : character;
        !            14:     nb : natural;
        !            15:
        !            16:   begin
        !            17:     new_line;
        !            18:     put("Is the group the full permutation group ? (y/n) ");
        !            19:     Ask_Yes_or_No(ans);  allperms := (ans = 'y');
        !            20:     if ans = 'y'
        !            21:      then
        !            22:        g := SymGrp(n);
        !            23:      else
        !            24:        put("The neutral element of the group is represented as ");
        !            25:        for i in 1..n loop
        !            26:          declare
        !            27:            sb : Symbol;
        !            28:          begin
        !            29:            sb := (sb'range => ' ');
        !            30:            sb := Symbol_Table.Get(i);
        !            31:            Symbol_Table_io.put(sb);
        !            32:            put(" ");
        !            33:          end;
        !            34:        end loop;
        !            35:        new_line;
        !            36:        put("Give the number of generating elements in the group : ");
        !            37:        Read_Natural(nb);
        !            38:        put("Give "); put(nb,1);
        !            39:        put_line(" vector representations of the generating elements :");
        !            40:        Symbolic_Symmetry_Group_io.Get(g,n,nb);
        !            41:     end if;
        !            42:     put("Do you want the generation of the group ? (y/n) ");
        !            43:     Ask_Yes_or_No(ans);
        !            44:     if ans = 'y'
        !            45:      then v := Generate(g);
        !            46:      else v := g;
        !            47:     end if;  -- v = either full group or group supplied by user
        !            48:   end Read_Permutation_Group;
        !            49:
        !            50:   procedure Read_Symmetry_Group
        !            51:                ( n : in natural; g,v : in out List_of_Permutations;
        !            52:                  allperms,signsym,allsigns : out boolean ) is
        !            53:
        !            54:     ans : character;
        !            55:     nb : natural;
        !            56:     pv,fv,fg : List_of_Permutations;
        !            57:
        !            58:   begin
        !            59:     Read_Permutation_Group(n,pv,fv,allperms);
        !            60:     put("Is there any sign symmetry to take into account ? (y/n) ");
        !            61:     Ask_Yes_or_No(ans);
        !            62:     signsym := (ans = 'y');
        !            63:     if ans = 'y'
        !            64:      then
        !            65:        put("Contains the group all sign permutations ? (y/n) ");
        !            66:        Ask_Yes_or_No(ans);
        !            67:        if ans = 'y'
        !            68:         then
        !            69:           allsigns := true;
        !            70:         else
        !            71:           allsigns := false;
        !            72:           signsym := false;  -- fv will contain these permutations
        !            73:           allperms := false; -- fv will be used for the generating solutions
        !            74:           put("The sign inversion of all elements is represented as ");
        !            75:           for i in 1..n loop
        !            76:             put('-');
        !            77:             declare
        !            78:               sb : Symbol;
        !            79:             begin
        !            80:               sb := (sb'range => ' ');
        !            81:               sb := Symbol_Table.get(i);
        !            82:               Symbol_Table_io.put(sb); put(" ");
        !            83:             end;
        !            84:           end loop;
        !            85:           new_line;
        !            86:           put("Give the number of generating elements in the group : ");
        !            87:           Read_Natural(nb);
        !            88:           put("Give "); put(nb,1);
        !            89:           put_line(" vector representations of the generating elements :");
        !            90:           Symbolic_Symmetry_Group_io.Get(fg,n,nb);
        !            91:        end if;
        !            92:        put("Do you want the generation of the group ? (y/n) ");
        !            93:        Ask_Yes_or_No(ans);
        !            94:        if ans = 'y'
        !            95:         then fv := Generate(Union(fg,pv));
        !            96:         else fv := Union(fg,pv);
        !            97:        end if;
        !            98:      else
        !            99:        allsigns := false;
        !           100:     end if;
        !           101:     g := Union(fg,pv); v := fv;
        !           102:   end Read_Symmetry_Group;
        !           103:
        !           104: end Drivers_for_Symmetry_Group_io;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>