logo search
Диссертация_2013_Даулбаева ММ

Продолжение приложения б

inc(c);

ceq.solved := true;

end

else if (fV[ ceq.p2 ].solved) then

begin

fV[ ceq.p1 ].v := ceq.sum - fV[ ceq.p2 ].v;

fv[ ceq.p1 ].solved := true;

inc(c);

ceq.solved := true;

end;

end;

if (c = 0) then

exit;

end;

end;

procedure TForm1.CalcPotential(data: TData; var plan, x: TData);

function to_sign( v: integer ): integer;

begin

if (v = 0) then

Result := 1

else

Result := -1;

end;

var

index, index2, t: integer;

solve: TEqSolve;

s: string;

begin

solve := TEqSolve.Create( plan.Height, plan.Height + plan.Width );

for index := 0 to plan.Height-1 do

for index2 := 0 to plan.Width-1 do

if (plan.Arr[index2,index] > 0) then

solve.AddEq( index, index2, data.Arr[index2,index] );

index := 0;

index2 := 0;

while (solve.fEqCount < plan.Height + plan.Width-1) do

begin

inc(index2);

if (index2 = plan.Width) then