f4d3a11e80
git-svn-id: http://cregut.svn.enseeiht.fr/2020/1sn/pim/projets/GH-05@207223 e13453a9-b01f-0410-a051-f404c4f0c485
35 lines
962 B
Ada
35 lines
962 B
Ada
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; |