[BACK]Return to ts_fltvec.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_fltvec.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_Floating_Vectors;
with Standard_Floating_Vectors_io;
with Standard_Floating_VecVecs;
with Standard_Floating_VecVecs_io;
with Multprec_Floating_Vectors;
with Multprec_Floating_Vectors_io;
with Multprec_Floating_Vecvecs;
with Multprec_Floating_Vecvecs_io;

procedure ts_fltvec is

-- DESCRIPTION :
--   Tests the vector packages of standard and multi-precision floats.

  procedure Test_Standard_Vectors_io is

    use Standard_Floating_Vectors,Standard_Floating_Vectors_io;

    n : natural;

  begin
    put("Give the dimension : "); get(n);
    declare
      nv : Vector(1..n);
    begin
      put("Give "); put(n,1); put_line(" floating numbers : "); get(nv);
      put("Your vector : "); put(nv); new_line;
    end;
  end Test_Standard_Vectors_io;

  procedure Test_Standard_VecVecs_io is

    use Standard_Floating_VecVecs,Standard_Floating_VecVecs_io;

    n : natural;

  begin
    put("Give the dimension : "); get(n);
    declare
      nv : VecVec(1..n);
    begin
      put("Give "); put(n,1); put_line(" floating vectors : "); get(n,nv);
      put_line("Your vector : "); put(nv); new_line;
    end;
  end Test_Standard_VecVecs_io;

  procedure Test_Multprec_Vectors_io is

    use Multprec_Floating_Vectors,Multprec_Floating_Vectors_io;

    n : natural;

  begin
    put("Give the dimension : "); get(n);
    declare
      nv : Vector(1..n);
    begin
      put("Give "); put(n,1); put_line(" floating numbers : "); get(nv);
      put_line("Your vector : "); put_line(nv);
    end;
  end Test_Multprec_Vectors_io;

  procedure Test_Multprec_VecVecs_io is

    use Multprec_Floating_VecVecs,Multprec_Floating_VecVecs_io;

    n : natural;

  begin
    put("Give the dimension : "); get(n);
    declare
      nv : VecVec(1..n);
    begin
      put("Give "); put(n,1); put_line(" floating vectors : "); get(n,nv);
      put_line("Your vector : "); put_line(nv);
    end;
  end Test_Multprec_VecVecs_io;

  procedure Main is

    ans : character;

  begin
    new_line;
    put_line("Interactive testing of vectors of floating 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 floating numbers.");
      put_line("  2. io of vectors of vectors of standard floating numbers.");
      put_line("  3. io of vectors of multi-precision floating numbers.");
      put_line("  4. io of vectors of vectors of multi-precision floats.");
      put("Make your choice (0,1,2,3, or 4) : "); get(ans);
      case ans is
        when '1' => Test_Standard_Vectors_io;
        when '2' => Test_Standard_VecVecs_io;
        when '3' => Test_Multprec_Vectors_io;
        when '4' => Test_Multprec_VecVecs_io;
        when others => null;
      end case;
      exit when ans = '0';
    end loop;
  end Main;

begin
  Main;
end ts_fltvec;