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

Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Implift/transformations_io.adb, Revision 1.1.1.1

1.1       maekawa     1: with integer_io;                         use integer_io;
                      2: with Standard_Integer_Vectors;           use Standard_Integer_Vectors;
                      3: with Standard_Integer_VecVecs;           use Standard_Integer_VecVecs;
                      4:
                      5: package body Transformations_io is
                      6:
                      7:   procedure get ( n : in natural; t : out Transfo ) is
                      8:   begin
                      9:     get(Standard_Input,n,t);
                     10:   end get;
                     11:
                     12:   procedure get ( file : in file_type; n : in natural; t : out Transfo ) is
                     13:
                     14:     v : VecVec(1..n);
                     15:
                     16:   begin
                     17:     for i in v'range loop
                     18:       v(i) := new Vector(1..n);
                     19:       for j in v(i)'range loop
                     20:        get(file,v(i)(j));
                     21:       end loop;
                     22:     end loop;
                     23:     t := Create(v);
                     24:     Clear(v);
                     25:   end get;
                     26:
                     27:   procedure put ( t : in Transfo ) is
                     28:   begin
                     29:     put(Standard_Output,t);
                     30:   end put;
                     31:
                     32:   procedure put ( file : in file_type; t : in Transfo ) is
                     33:
                     34:     n : natural := Dimension(t);
                     35:     v : VecVec(1..n);
                     36:
                     37:   begin
                     38:     for i in v'range loop
                     39:       v(i) := new Vector'(1..n => 0);
                     40:       v(i)(i) := 1;
                     41:       Apply(t,v(i).all);
                     42:     end loop;
                     43:     for i in v'range loop
                     44:       for j in v(i)'range loop
                     45:        put(file,' '); put(file,v(j)(i),1);
                     46:       end loop;
                     47:       new_line(file);
                     48:     end loop;
                     49:     Clear(v);
                     50:   end put;
                     51:
                     52: end Transformations_io;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>