Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/ts_cmpvec.adb, Revision 1.1.1.1
1.1 maekawa 1: with text_io,integer_io; use text_io,integer_io;
2: with Standard_Complex_Vectors;
3: with Standard_Complex_Vectors_io;
4: with Multprec_Complex_Vectors;
5: with Multprec_Complex_Vectors_io;
6:
7: procedure ts_cmpvec is
8:
9: -- DESCRIPTION :
10: -- Tests the vector packages of standard and multi-precision complex numbers.
11:
12: procedure Test_Standard_Vectors_io is
13:
14: use Standard_Complex_Vectors,Standard_Complex_Vectors_io;
15:
16: n : natural;
17:
18: begin
19: put("Give the dimension : "); get(n);
20: declare
21: nv : Vector(1..n);
22: begin
23: put("Give "); put(n,1); put_line(" complex numbers : "); get(nv);
24: put_line("Your vector : "); put_line(nv);
25: end;
26: end Test_Standard_Vectors_io;
27:
28: procedure Test_Multprec_Vectors_io is
29:
30: use Multprec_Complex_Vectors,Multprec_Complex_Vectors_io;
31:
32: n : natural;
33:
34: begin
35: put("Give the dimension : "); get(n);
36: declare
37: nv : Vector(1..n);
38: begin
39: put("Give "); put(n,1); put_line(" complex numbers : "); get(nv);
40: put_line("Your vector : "); put_line(nv);
41: end;
42: end Test_Multprec_Vectors_io;
43:
44: procedure Main is
45:
46: ans : character;
47:
48: begin
49: new_line;
50: put_line("Interactive testing of vectors of complex numbers.");
51: loop
52: new_line;
53: put_line("Choose one of the following : ");
54: put_line(" 0. exit this program.");
55: put_line(" 1. io of vectors of standard complex numbers.");
56: put_line(" 2. io of vectors of multi-precision complex numbers.");
57: put("Make your choice (0,1, or 2) : "); get(ans);
58: exit when (ans = '0');
59: case ans is
60: when '1' => Test_Standard_Vectors_io;
61: when '2' => Test_Multprec_Vectors_io;
62: when others => null;
63: end case;
64: end loop;
65: end Main;
66:
67: begin
68: Main;
69: end ts_cmpvec;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>