[BACK]Return to transformations_io.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Implift

File: [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Implift / transformations_io.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:29 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 integer_io;                         use integer_io;
with Standard_Integer_Vectors;           use Standard_Integer_Vectors;
with Standard_Integer_VecVecs;           use Standard_Integer_VecVecs;

package body Transformations_io is

  procedure get ( n : in natural; t : out Transfo ) is
  begin
    get(Standard_Input,n,t);
  end get;

  procedure get ( file : in file_type; n : in natural; t : out Transfo ) is

    v : VecVec(1..n);

  begin
    for i in v'range loop
      v(i) := new Vector(1..n);
      for j in v(i)'range loop
	get(file,v(i)(j));
      end loop;
    end loop;
    t := Create(v);
    Clear(v);
  end get;

  procedure put ( t : in Transfo ) is
  begin
    put(Standard_Output,t);
  end put;

  procedure put ( file : in file_type; t : in Transfo ) is

    n : natural := Dimension(t);
    v : VecVec(1..n);

  begin
    for i in v'range loop
      v(i) := new Vector'(1..n => 0);
      v(i)(i) := 1;
      Apply(t,v(i).all);
    end loop;
    for i in v'range loop
      for j in v(i)'range loop
	put(file,' '); put(file,v(j)(i),1);
      end loop;
      new_line(file);
    end loop;
    Clear(v);
  end put;

end Transformations_io;