projet-programmation-impera.../src/googleNaive.ads

35 lines
962 B
Ada
Raw Normal View History

generic
type T_Element is private;
CAPACITY: Positive;
package googleNaive is
type T_Row is limited private;
type T_Google is limited private;
function "*"(left, right: T_Google) return T_Google;
function "+"(left, right: T_Google) return T_Google;
function "*"(left: T_Google; right: Integer) return T_Google;
function "/"(left: T_Google; right: Integer) return T_Google;
procedure initialize(mat: in out T_Google) with
Post => isEmpty(mat);
function ones(rows, cols: Positive) return T_Google;
function zeros(rows, cols: Positive) return T_Google;
procedure insert(mat: in out T_Google; i, j: Natural; elm: T_Element);
function transpose(mat: in T_Google) return T_Google;
private
type T_Row is array (0..CAPACITY-1) of T_Element;
type T_Google is record
dimension: array (0..1) of Positive;
matrix: array (0..CAPACITY-1) of T_Row;
end record;
end googleNaive;