Attention une mise à jour du service Gitlab va être effectuée le mardi 18 janvier (et non lundi 17 comme annoncé précédemment) entre 18h00 et 18h30. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 81d9d784 authored by BARGAIN Orianne's avatar BARGAIN Orianne
Browse files

resolve Out of local stack

parent 17ff8161
......@@ -18,6 +18,93 @@
+G1: graph 1 [NbVertexe, NbSpecie, EdgesList, Id]
+G2: graph 2 [NbVertexe, NbSpecie, EdgesList, Id]
+Stream: where to write clauses*/
merge_neigh(G1, G2, Stream):-
assert_neighbours(G1),
debug(sepi, "done listing neighbours", []),
neigh_clauses_assert(G1, G2, Stream),
debug(sepi, "done writing 2 neighbours clauses", []).
assert_neighbours(G1):-
G1 = [N1, _, E1, _],
N1_1 is N1 - 1,
numlist(0,N1_1,Vertex_G1),
forall(
(
member(A, Vertex_G1),
member(B, Vertex_G1),
member(C, Vertex_G1)
),
(
Arc1 = (A,C),
Arc2 = (C,A),
Arc3 = (B,C),
Arc4 = (C,B),
(
(
member(Arc1, E1)
;
member(Arc2, E1)
),
(
member(Arc3, E1)
;
member(Arc4, E1)
)
->
assert(neigh(A,B))
;
true
)
)
).
neigh_clauses_assert(G1, G2, Stream):-
G1 = [N1, _, _, _],
N1_1 is N1 - 1,
numlist(0,N1_1,Vertex_G1),
forall(
(
member(A, Vertex_G1),
member(B, Vertex_G1)
),
(
(
not(neigh(A,B)),
not(neigh(B,A)),
not(A is B)
)
->
debug(sepi, "A ~w B ~w not neigh", [A, B]),
neigh_clauses_not_neigh_assert(A, B, N1, G2, Stream)
;
debug(sepi, "A ~w B ~w neigh", [A, B])
)
).
neigh_clauses_not_neigh_assert(A, B, N1, G2, Stream):-
G2 = [N2, _, _, _],
N2_1 is N2 - 1,
numlist(0,N2_1,Vertex_G2),
forall(
(
member(Y, Vertex_G2)
),
(
m_ij(A, Y, N2, May),
m_ij(B, Y, N2, Mby),
get_option(reduction, Reduction),
(
not(Reduction=normal)
->
Top is N1 + 1,
format(Stream, "~d -~d -~d 0~n", [Top, May, Mby])
;
format(Stream, "-~d -~d 0~n", [May, Mby])
),
debug(merge, "A ~w B ~w Y ~w", [A, B, Y])
)
).
/* Old code just in case
merge_neigh(G1, G2, Stream):-
list_neighbours(G1, L),
debug(sepi, "done writing L: L = ~w ", [L]),
......@@ -39,14 +126,14 @@ list_neighbours(A, 0, 0, N1, E1, L):-
list_neighbours(A, B, 0, N1, E1, L):-
B2 is B - 1,
(
not(B2 is A)
B2 > A
->
C is N1,
debug(merge, "A ~w B ~w C ~w - new B", [A, B2, C]),
list_neighbours(A, B2, C, N1, E1, L)
;
debug(merge, "A ~w B ~w C ~w - new B - pass (A=B)", [A, B2, 0]),
list_neighbours(A, B2, 0, N1, E1, L)
debug(merge, "A ~w B ~w C ~w - new B - pass (A>=B)", [A, B2, 0]),
list_neighbours(A, 0, 0, N1, E1, L)
).
list_neighbours(A, B, C, N1, E1, L):-
C2 is C - 1,
......@@ -96,15 +183,17 @@ neigh_clauses(G1, G2, L, Stream):-
),
(
(
Couple = (A,B),
not(member(Couple, L)),
Couple1 = (A,B),
Couple2 = (B,A),
not(member(Couple1, L)),
not(member(Couple2, L)),
not(A is B)
)
->
debug(merge, "A ~w B ~w not neigh", [A, B]),
debug(sepi, "A ~w B ~w not neigh", [A, B]),
neigh_clauses_not_neigh(A, B, N1, G2, Stream)
;
debug(merge, "A ~w B ~w neigh", [A, B])
debug(sepi, "A ~w B ~w neigh", [A, B])
)
).
neigh_clauses_not_neigh(A, B, N1, G2, Stream):-
......@@ -130,3 +219,4 @@ neigh_clauses_not_neigh(A, B, N1, G2, Stream):-
debug(merge, "A ~w B ~w Y ~w", [A, B, Y])
)
).
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment