-- real_matrix_arithmetic.ads with Define_Real ; use Define_Real ; package Real_Matrix_Arithmetic is -- This is just a partial example of a full matrix arithmetic package -- Establish the type ( data structure) Real_Matrix type Real_Matrix is array ( Integer range <> , Integer range <> ) of REAL ; -- The first subscript is the row , the second subscript is the column -- Declare the matrix multiply function, parameters and return function "*" ( A , B : Real_Matrix ) return Real_Matrix ; -- Declare the PUT procedure procedure Put ( A : Real_Matrix ; Width : Integer := 3 ; Fore : Integer := 2 ; Aft : Integer := Real'Digits - 1 ; Exp : Integer := 3 ) ; -- Declare that Matrix_Error is an exception Matrix_Error : exception ; end Real_Matrix_Arithmetic ; -- Notes: -- -- For every (non limited) type that is defined, the ":=" is defined -- -- To get three matrices A, B and C of size 4 by 4, you might write: -- -- A, B, C : Real_Matrix(1..4, 1..4); -- -- Then you might write: -- -- A := B + C; -- A := B * C; -- A := B * C + A; --