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

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/generic_vecmats_io.adb, Revision 1.1.1.1

1.1       maekawa     1: with integer_io;                         use integer_io;
                      2:
                      3: package body Generic_VecMats_io is
                      4:
                      5:   use Matrices,Matrices_io;
                      6:
                      7:   procedure get ( n : in natural; v : in out VecMat ) is
                      8:   begin
                      9:     get(Standard_Input,n,v);
                     10:   end get;
                     11:
                     12:   procedure get ( file : in file_type; n : in natural; v : in out VecMat ) is
                     13:
                     14:     n1,n2 : natural;
                     15:
                     16:   begin
                     17:     for i in v'range loop
                     18:       get(file,n1);
                     19:       get(file,n2);
                     20:       v(i) := new Matrix(1..n1,1..n2);
                     21:       get(file,v(i).all);
                     22:     end loop;
                     23:   end get;
                     24:
                     25:   procedure get ( n,n1,n2 : in natural; v : in out Link_to_VecMat ) is
                     26:   begin
                     27:     get(Standard_Input,n,n1,n2,v);
                     28:   end get;
                     29:
                     30:   procedure get ( file : in file_type; n,n1,n2 : in natural;
                     31:                   v : in out Link_to_VecMat ) is
                     32:   begin
                     33:     v := new VecMat(1..n);
                     34:     for i in 1..n loop
                     35:       v(i) := new Matrix(1..n1,1..n2);
                     36:       get(file,v(i).all);
                     37:     end loop;
                     38:   end get;
                     39:
                     40:   procedure put ( v : in VecMat ) is
                     41:   begin
                     42:     put(Standard_Output,v);
                     43:   end put;
                     44:
                     45:   procedure put ( file : in file_type; v : in VecMat ) is
                     46:   begin
                     47:     for i in v'range loop
                     48:       put(file,v(i).all); new_line(file);
                     49:     end loop;
                     50:   end put;
                     51:
                     52:   procedure put ( v : in Link_to_VecMat ) is
                     53:   begin
                     54:     put(Standard_Output,v);
                     55:   end put;
                     56:
                     57:   procedure put ( file : in file_type; v : in Link_to_VecMat ) is
                     58:   begin
                     59:     if v /= null
                     60:      then put(file,v.all);
                     61:     end if;
                     62:   end put;
                     63:
                     64:   procedure put ( v : in VecMat; dp : in natural ) is
                     65:   begin
                     66:     put(Standard_Output,v,dp);
                     67:   end put;
                     68:
                     69:   procedure put ( file : in file_type; v : in VecMat; dp : in natural ) is
                     70:   begin
                     71:     for i in v'range loop
                     72:       put(file,v(i).all,dp); new_line(file);
                     73:     end loop;
                     74:   end put;
                     75:
                     76:   procedure put ( v : in Link_to_VecMat; dp : in natural ) is
                     77:   begin
                     78:     put(Standard_Output,v,dp);
                     79:   end put;
                     80:
                     81:   procedure put ( file : in file_type;
                     82:                   v : in Link_to_VecMat; dp : in natural ) is
                     83:   begin
                     84:     if v /= null
                     85:      then put(file,v.all,dp);
                     86:     end if;
                     87:   end put;
                     88:
                     89: end Generic_VecMats_io;

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