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

File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices / ts_cmpvec.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:24 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

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;