[BACK]Return to ts_matinv.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Schubert

File: [local] / OpenXM_contrib / PHC / Ada / Schubert / ts_matinv.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:33 2000 UTC (23 years, 6 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_Matrices;         use Standard_Floating_Matrices;
with Standard_Floating_Matrices_io;      use Standard_Floating_Matrices_io;
with Standard_Complex_Matrices;          use Standard_Complex_Matrices;
with Standard_Complex_Matrices_io;       use Standard_Complex_Matrices_io;
with Standard_Random_Matrices;           use Standard_Random_Matrices;
with Standard_Matrix_Inversion;          use Standard_Matrix_Inversion;

procedure ts_matinv is

-- DESCRIPTION :
--   Test on matrix inversion.

  procedure Main is
    
    n : natural;

  begin
    put("Give the dimension : "); get(n);
    declare
      cmpmat : Standard_Complex_Matrices.Matrix(1..n,1..n)
             := Random_Matrix(n,n);
      invcmp : Standard_Complex_Matrices.Matrix(1..n,1..n) := Inverse(cmpmat);
      fltmat : Standard_Floating_Matrices.Matrix(1..n,1..n)
             := Random_Matrix(n,n);
      invflt : Standard_Floating_Matrices.Matrix(1..n,1..n) := Inverse(fltmat);
    begin
      put_line("Test on complex matrix inversion : ");
      put(cmpmat*invcmp,3);
      put_line("Test on commutativity with complex matrix inversion : ");
      put(invcmp*cmpmat,3);
      put_line("Test on floating matrix inversion : ");
      put(fltmat*invflt,3);
      put_line("Test on commutativity with floating matrix inversion : ");
      put(invflt*fltmat,3);
    end;
  end Main;

begin 
  Main;
end ts_matinv;