[BACK]Return to ts_intvec.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/ts_intvec.adb, Revision 1.1.1.1

1.1       maekawa     1: with text_io,integer_io;                 use text_io,integer_io;
                      2: with Standard_Integer_Vectors;
                      3: with Standard_Integer_Vectors_io;
                      4: with Standard_Integer_VecVecs;
                      5: with Standard_Integer_VecVecs_io;
                      6: with Multprec_Integer_Vectors;
                      7: with Multprec_Integer_Vectors_io;
                      8: with Multprec_Integer_Vecvecs;
                      9: with Multprec_Integer_Vecvecs_io;
                     10:
                     11: procedure ts_intvec is
                     12:
                     13: -- DESCRIPTION :
                     14: --   Tests the vector packages of standard and multi-precision integers.
                     15:
                     16:   procedure Test_Standard_Vectors_io is
                     17:
                     18:     use Standard_Integer_Vectors,Standard_Integer_Vectors_io;
                     19:
                     20:     n : natural;
                     21:
                     22:   begin
                     23:     put("Give the dimension : "); get(n);
                     24:     declare
                     25:       nv : Vector(1..n);
                     26:     begin
                     27:       put("Give "); put(n,1); put_line(" integer numbers : "); get(nv);
                     28:       put("Your vector : "); put(nv); new_line;
                     29:     end;
                     30:   end Test_Standard_Vectors_io;
                     31:
                     32:   procedure Test_Standard_VecVecs_io is
                     33:
                     34:     use Standard_Integer_VecVecs,Standard_Integer_VecVecs_io;
                     35:
                     36:     n : natural;
                     37:
                     38:   begin
                     39:     put("Give the dimension : "); get(n);
                     40:     declare
                     41:       nv : VecVec(1..n);
                     42:     begin
                     43:       put("Give "); put(n,1); put_line(" integer vectors : "); get(n,nv);
                     44:       put_line("Your vector : "); put(nv); new_line;
                     45:     end;
                     46:   end Test_Standard_VecVecs_io;
                     47:
                     48:   procedure Test_Multprec_Vectors_io is
                     49:
                     50:     use Multprec_Integer_Vectors,Multprec_Integer_Vectors_io;
                     51:
                     52:     n : natural;
                     53:
                     54:   begin
                     55:     put("Give the dimension : "); get(n);
                     56:     declare
                     57:       nv : Vector(1..n);
                     58:     begin
                     59:       put("Give "); put(n,1); put_line(" integer numbers : "); get(nv);
                     60:       put_line("Your vector : "); put_line(nv);
                     61:     end;
                     62:   end Test_Multprec_Vectors_io;
                     63:
                     64:   procedure Test_Multprec_VecVecs_io is
                     65:
                     66:     use Multprec_Integer_VecVecs,Multprec_Integer_VecVecs_io;
                     67:
                     68:     n : natural;
                     69:
                     70:   begin
                     71:     put("Give the dimension : "); get(n);
                     72:     declare
                     73:       nv : VecVec(1..n);
                     74:     begin
                     75:       put("Give "); put(n,1); put_line(" integer vectors : "); get(n,nv);
                     76:       put_line("Your vector : "); put_line(nv);
                     77:     end;
                     78:   end Test_Multprec_VecVecs_io;
                     79:
                     80:   procedure Main is
                     81:
                     82:     ans : character;
                     83:
                     84:   begin
                     85:     new_line;
                     86:     put_line("Interactive testing of vectors of integer numbers.");
                     87:     loop
                     88:       new_line;
                     89:       put_line("Choose one of the following : ");
                     90:       put_line("  0. exit this program.");
                     91:       put_line("  1. io of vectors of standard integer numbers.");
                     92:       put_line("  2. io of vectors of vectors of standard integer numbers.");
                     93:       put_line("  3. io of vectors of multi-precision integer numbers.");
                     94:       put_line("  4. io of vectors of vectors of multi-precision integers.");
                     95:       put("Make your choice (0,1,2,3, or 4) : "); get(ans);
                     96:       case ans is
                     97:         when '1' => Test_Standard_Vectors_io;
                     98:         when '2' => Test_Standard_VecVecs_io;
                     99:         when '3' => Test_Multprec_Vectors_io;
                    100:         when '4' => Test_Multprec_VecVecs_io;
                    101:         when others => null;
                    102:       end case;
                    103:       exit when ans = '0';
                    104:     end loop;
                    105:   end Main;
                    106:
                    107: begin
                    108:   Main;
                    109: end ts_intvec;

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