fix de quelques warnings
git-svn-id: http://cregut.svn.enseeiht.fr/2020/1sn/pim/projets/GH-05@210408 e13453a9-b01f-0410-a051-f404c4f0c485
This commit is contained in:
parent
166c01d7c6
commit
8208062b99
|
@ -1,3 +1,4 @@
|
||||||
|
with Ada.Text_IO; use Ada.Text_IO;
|
||||||
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
|
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
|
||||||
|
|
||||||
package body Google_Creux is
|
package body Google_Creux is
|
||||||
|
@ -43,7 +44,7 @@ package body Google_Creux is
|
||||||
col_CRS: Natural := 0;
|
col_CRS: Natural := 0;
|
||||||
col_vec: Natural := 0;
|
col_vec: Natural := 0;
|
||||||
begin
|
begin
|
||||||
initialize(new_vec, sum(vec)*(1.0-alpha)/T_Element(N));
|
Vector_Element.initialize(new_vec, Vector_Element.sum(vec)*(1.0-alpha)/T_Element(N));
|
||||||
for i in 0..N-1 loop
|
for i in 0..N-1 loop
|
||||||
nb_col := mat.rows(i+1) - mat.rows(i);
|
nb_col := mat.rows(i+1) - mat.rows(i);
|
||||||
if nb_col = 0 then
|
if nb_col = 0 then
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
with Ada.Text_IO; use Ada.Text_IO;
|
|
||||||
with Vector;
|
with Vector;
|
||||||
|
|
||||||
generic
|
generic
|
||||||
|
@ -18,15 +17,6 @@ generic
|
||||||
|
|
||||||
package Google_Creux is
|
package Google_Creux is
|
||||||
|
|
||||||
-- on permet l'affichage direct des T_Element
|
|
||||||
package Text_T_Element is
|
|
||||||
new Ada.Text_IO.Float_IO(Num => T_Element);
|
|
||||||
use Text_T_Element;
|
|
||||||
|
|
||||||
-- on utilise les modules Vector
|
|
||||||
use Vector_Element;
|
|
||||||
use Vector_Link;
|
|
||||||
|
|
||||||
type T_Rows is array (0..N) of Natural;
|
type T_Rows is array (0..N) of Natural;
|
||||||
type T_Cols is array (0..N_links-1) of Natural;
|
type T_Cols is array (0..N_links-1) of Natural;
|
||||||
type T_Google is record
|
type T_Google is record
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
|
|
||||||
|
|
||||||
package body Google_Naive is
|
package body Google_Naive is
|
||||||
|
|
||||||
function "*"(left : Vector_Element.T_Vecteur; right : T_Google) return Vector_Element.T_Vecteur is
|
function "*"(left : Vector_Element.T_Vecteur; right : T_Google) return Vector_Element.T_Vecteur is
|
||||||
|
|
|
@ -22,10 +22,6 @@ package Google_Naive is
|
||||||
package Text_T_Element is
|
package Text_T_Element is
|
||||||
new Ada.Text_IO.Float_IO(Num => T_Element);
|
new Ada.Text_IO.Float_IO(Num => T_Element);
|
||||||
|
|
||||||
-- on utilise les modules Vector
|
|
||||||
use Vector_Element;
|
|
||||||
use Vector_Link;
|
|
||||||
|
|
||||||
type T_Google is array (0..N-1, 0..N-1) of T_Element;
|
type T_Google is array (0..N-1, 0..N-1) of T_Element;
|
||||||
|
|
||||||
function "*"(left: Vector_Element.T_Vecteur; right: T_Google) return Vector_Element.T_Vecteur;
|
function "*"(left: Vector_Element.T_Vecteur; right: T_Google) return Vector_Element.T_Vecteur;
|
||||||
|
|
|
@ -59,7 +59,7 @@ begin
|
||||||
vec_natural(2) := 21;
|
vec_natural(2) := 21;
|
||||||
vec_natural(3) := 3;
|
vec_natural(3) := 3;
|
||||||
vec_natural(4) := 13;
|
vec_natural(4) := 13;
|
||||||
vec_natural(5) := 2855030208059;
|
vec_natural(5) := 2855059;
|
||||||
vec_natural(6) := 3;
|
vec_natural(6) := 3;
|
||||||
vec_natural(7) := 5;
|
vec_natural(7) := 5;
|
||||||
vec_natural(8) := 6;
|
vec_natural(8) := 6;
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
|
||||||
|
|
||||||
package body Vector is
|
package body Vector is
|
||||||
|
|
||||||
package body Entier is
|
package body Entier is
|
||||||
|
|
||||||
procedure initialize(vec: in out T_Vecteur; value: in Long_Natural) is
|
procedure initialize(vec: in out T_Vecteur; value: in Natural) is
|
||||||
begin
|
begin
|
||||||
for i in 0..Capacite-1 loop
|
for i in 0..Capacite-1 loop
|
||||||
vec(i) := value;
|
vec(i) := value;
|
||||||
|
@ -12,12 +14,12 @@ package body Vector is
|
||||||
procedure identity(vec: in out T_Vecteur) is
|
procedure identity(vec: in out T_Vecteur) is
|
||||||
begin
|
begin
|
||||||
for i in 0..Capacite-1 loop
|
for i in 0..Capacite-1 loop
|
||||||
vec(i) := Long_Natural(i);
|
vec(i) := i;
|
||||||
end loop;
|
end loop;
|
||||||
end identity;
|
end identity;
|
||||||
|
|
||||||
procedure flip(vec: in out T_Vecteur) is
|
procedure flip(vec: in out T_Vecteur) is
|
||||||
tmp: Long_Natural;
|
tmp: Natural;
|
||||||
begin
|
begin
|
||||||
for i in 0..Capacite/2-1 loop
|
for i in 0..Capacite/2-1 loop
|
||||||
tmp := vec(i);
|
tmp := vec(i);
|
||||||
|
@ -44,13 +46,13 @@ package body Vector is
|
||||||
procedure quicksort(vec: in out T_Vecteur; low: Natural := 0; high: Natural := Capacite-1) is
|
procedure quicksort(vec: in out T_Vecteur; low: Natural := 0; high: Natural := Capacite-1) is
|
||||||
|
|
||||||
procedure swap(left, right: Natural) is
|
procedure swap(left, right: Natural) is
|
||||||
tmp : constant Long_Natural := vec(left);
|
tmp : constant Natural := vec(left);
|
||||||
begin
|
begin
|
||||||
vec(left) := vec(right);
|
vec(left) := vec(right);
|
||||||
vec(right) := tmp;
|
vec(right) := tmp;
|
||||||
end swap;
|
end swap;
|
||||||
|
|
||||||
pivot : constant Long_Natural := vec(low);
|
pivot : constant Natural := vec(low);
|
||||||
right : Natural := high;
|
right : Natural := high;
|
||||||
left : Natural := low;
|
left : Natural := low;
|
||||||
|
|
||||||
|
@ -181,7 +183,7 @@ package body Vector is
|
||||||
|
|
||||||
procedure swap(left, right: Natural) is
|
procedure swap(left, right: Natural) is
|
||||||
tmp : constant T_Digit := vec(left);
|
tmp : constant T_Digit := vec(left);
|
||||||
tmp_index : constant Long_Natural := vec_index(left);
|
tmp_index : constant Natural := vec_index(left);
|
||||||
begin
|
begin
|
||||||
vec(left) := vec(right);
|
vec(left) := vec(right);
|
||||||
vec(right) := tmp;
|
vec(right) := tmp;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
with Ada.Text_IO; use Ada.Text_IO;
|
with Ada.Text_IO; use Ada.Text_IO;
|
||||||
with Ada.Integer_Text_IO;
|
|
||||||
with Ada.Long_Integer_Text_IO;
|
|
||||||
|
|
||||||
package Vector is
|
package Vector is
|
||||||
|
|
||||||
|
@ -10,14 +8,9 @@ package Vector is
|
||||||
|
|
||||||
package Entier is
|
package Entier is
|
||||||
|
|
||||||
subtype Long_Natural is Long_Integer range 0 .. Long_Integer'Last; -- plus nécéssaire après implèm Links, TODO
|
type T_Vecteur is array (0..Capacite-1) of Natural;
|
||||||
|
|
||||||
-- on permet l'affichage des entiers.
|
|
||||||
use Ada.Long_Integer_Text_IO;
|
|
||||||
|
|
||||||
type T_Vecteur is array (0..Capacite-1) of Long_Natural;
|
procedure initialize(vec: in out T_Vecteur; value: in Natural);
|
||||||
|
|
||||||
procedure initialize(vec: in out T_Vecteur; value: in Long_Natural);
|
|
||||||
procedure identity(vec: in out T_Vecteur);
|
procedure identity(vec: in out T_Vecteur);
|
||||||
procedure flip(vec: in out T_Vecteur);
|
procedure flip(vec: in out T_Vecteur);
|
||||||
|
|
||||||
|
@ -41,10 +34,7 @@ package Vector is
|
||||||
-- on permet l'affichage direct des T_Digit
|
-- on permet l'affichage direct des T_Digit
|
||||||
package Text_T_Element is
|
package Text_T_Element is
|
||||||
new Ada.Text_IO.Float_IO(Num => T_Digit);
|
new Ada.Text_IO.Float_IO(Num => T_Digit);
|
||||||
use Text_T_Element;
|
use Text_T_Element;
|
||||||
|
|
||||||
-- on importe les vecteurs d'entiers
|
|
||||||
use Vector_Entier;
|
|
||||||
|
|
||||||
type T_Vecteur is array (0..Capacite-1) of T_Digit;
|
type T_Vecteur is array (0..Capacite-1) of T_Digit;
|
||||||
|
|
||||||
|
@ -74,9 +64,6 @@ package Vector is
|
||||||
from: Natural;
|
from: Natural;
|
||||||
to: Natural;
|
to: Natural;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
-- on permet l'affichage des entiers.
|
|
||||||
use Ada.Integer_Text_IO;
|
|
||||||
|
|
||||||
type T_Vecteur is array (0..Capacite-1) of T_Link;
|
type T_Vecteur is array (0..Capacite-1) of T_Link;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue