package Matrix is constant --process count constant 900 --vector matri

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package Matrix is
P: constant := 5; --process count
N: constant := 900; --vector & matrix size
MIN: constant := -100; --max number in matrix
MAX: constant := 100; --max number in matrix
H: constant Positive := N / P; --submatrix size
--Index types
subtype Index1H is Integer range 1 .. H;
subtype Index2H is Integer range 1 .. 2 * H;
subtype Index3H is Integer range 1 .. 3 * H;
subtype Index4H is Integer range 1 .. 4 * H;
subtype Index_Full is Integer range 1 .. N;
-- Vector types
type Vector_Base is array (Integer range <>) of Integer;
subtype Vector1H is Vector_Base (Index1H);
subtype Vector2H is Vector_Base (Index2H);
subtype Vector3H is Vector_Base (Index3H);
subtype Vector4H is Vector_Base (Index4H);
subtype Vector_Full is Vector_Base (Index_Full);
-- Matrix types
type Matrix_Base is array (Integer range <>) of Vector_Full;
subtype Matrix1H is Matrix_Base (Index1H);
subtype Matrix2H is Matrix_Base (Index2H);
subtype Matrix3H is Matrix_Base (Index3H);
subtype Matrix4H is Matrix_Base (Index4H);
subtype Matrix_Full is Matrix_Base (Index_Full);
--Procedures
procedure InitMatrix (M : out Matrix_Full);
procedure PrintMatrix (M : in Matrix_Full);
procedure Transposition (Target : out Matrix_Full; Source : in Matrix_Full);
procedure CalculateMOMK1H
(MOMK_out: out Matrix1H;
MO_in: in Matrix1H;
MK_in: Matrix_Full);
procedure InitVector (V : out Vector_Full);
procedure PrintVector (V : in Vector_Full);
procedure CalculateA1H
(A_out: out Vector1H;
B_in: in Vector1H;
C_in: Vector_Full;
MOMKT_in: in Matrix1H); --A1H = B + C * MOMK1H
end Matrix;