with text_io,integer_io; use text_io,integer_io;
with Standard_Complex_Vectors;
with Standard_Complex_Vectors_io;
with Multprec_Complex_Vectors;
with Multprec_Complex_Vectors_io;
procedure ts_cmpvec is
-- DESCRIPTION :
-- Tests the vector packages of standard and multi-precision complex numbers.
procedure Test_Standard_Vectors_io is
use Standard_Complex_Vectors,Standard_Complex_Vectors_io;
n : natural;
begin
put("Give the dimension : "); get(n);
declare
nv : Vector(1..n);
begin
put("Give "); put(n,1); put_line(" complex numbers : "); get(nv);
put_line("Your vector : "); put_line(nv);
end;
end Test_Standard_Vectors_io;
procedure Test_Multprec_Vectors_io is
use Multprec_Complex_Vectors,Multprec_Complex_Vectors_io;
n : natural;
begin
put("Give the dimension : "); get(n);
declare
nv : Vector(1..n);
begin
put("Give "); put(n,1); put_line(" complex numbers : "); get(nv);
put_line("Your vector : "); put_line(nv);
end;
end Test_Multprec_Vectors_io;
procedure Main is
ans : character;
begin
new_line;
put_line("Interactive testing of vectors of complex numbers.");
loop
new_line;
put_line("Choose one of the following : ");
put_line(" 0. exit this program.");
put_line(" 1. io of vectors of standard complex numbers.");
put_line(" 2. io of vectors of multi-precision complex numbers.");
put("Make your choice (0,1, or 2) : "); get(ans);
exit when (ans = '0');
case ans is
when '1' => Test_Standard_Vectors_io;
when '2' => Test_Multprec_Vectors_io;
when others => null;
end case;
end loop;
end Main;
begin
Main;
end ts_cmpvec;