Градиентный метод первого порядка

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование



C.Pen.Width:=2C.Pen.Width:=1;

// C.Ellipse(PP.X-PointRadius,PP.Y-

PointRadius,PP.X+PointRadius,PP.Y+PointRadius+10);:=PP.X-PointRadius;:=PP.Y-PointRadius;:=PP.X+PointRadius;:=PP.Y+PointRadius;(X1minH)then

C.Ellipse(X1,Y1,X2,Y2);:=inttostr(PP.Value);:=C.TextHeight('A');:=C.TextWidth(s);.TextOut(round(PP.X-W/2),round(PP.Y-H/2),s);.Brush.Style := bsClear;.Font.Color:=clBlack;.Font.Style:=[fsBold];i:=0 to Points.Count-1 do:=Points[i];:=inttostr(PP.UIN);:=C.TextHeight('A');:=C.TextWidth(s);.TextOut(round(PP.X+PointRadius-W/2),PP.Y-PointRadius-H-1,s);.Font.Style:=[];.Brush.Style := bsSolid;;

TGraph.DrawGraph(C:TCanvas;minW,minH,maxW,maxH:integer);(C,minW,minH,maxW,maxH);(C,minW,minH,maxW,maxH);;TGraph.AddPoint(X,Y:integer;Value:integer);PP:PPoint;:=true;:=true;:=MaxUIN+1;(PP);.UIN:=MaxUIN;.X:=X;.Y:=Y;.Value:=Value;.Add(PP);;TGraph.CheckCicle(FP,TP:PPoint):boolean;List : TList;:PConnection;:PPoint;:integer;:=true;:= TList.create;.add(TP);List.Count<>0 do:=List.first;.delete(0);CurP = FP then:=false;;i:=0 to Connections.Count-1 do:=Connections[i];PC.fromPoint = CurP then List.Add(PC.toPoint);.clear;.Destroy;

TGraph.AddConnection(fromPoint,toPoint:PPoint;Value:integer):boolean;PC:PConnection;(fromPoint<>toPoint) and CheckCicle(fromPoint,toPoint) then:=true;:=true;(PC);.fromPoint:=fromPoint;.toPoint:=toPoint;.Value:=Value;.Add(PC);:=true:=false;TGraph.SaveToFile(filename:string);f:file;:PPoint;:PConnection;:integer;(f,filename);(f,1);(f,Points.Count,SizeOf(integer));(f,Connections.Count,SizeOf(integer));i:=0 to Points.Count-1 do:=Points[i];(f,PP,SizeOf(PP));(f,PP^,SizeOf(PP^));;i:=0 to Connections.Count-1 do:=Connections[i];

// BlockWrite(f,PC,SizeOf(PC));(f,PC^,SizeOf(PC^));;(f);;TGraph.OpenFromFile(filename:string);= ^TAddr;= record,New:pointer;;f:file;:TList;:PAddr;:PPoint;:PConnection;:pointer;,NOP,NOC:integer;SetNewAddr(iOld,iNew:pointer);PA:PAddr;(PA);.Old:=iOld;.New:=iNew;.add(PA);GetNewAddr(Old:pointer):pointer;i:integer;:=nil;i:=0 to Addresses.Count-1 doPAddr(Addresses[i]).Old = Old then:=PAddr(Addresses[i]).New;;;:=0;;:=false;:=false;:=TList.Create;(f,filename);(f,1);(f,NOP,SizeOf(integer));(f,NOC,SizeOf(integer));i:=0 to NOP-1 do(PP);(f,p,SizeOf(p));(f,PP^,SizeOf(PP^));.Add(PP);(p,PP);MaxUIN nil thenElem.ceType of:PPoint(Elem.element).Value:=Value;:PConnection(Elem.element).Value:=Value;;:=true;:=true;

// --- SubMerger --- //TSubMerger.Create;:= TList.Create;:= TList.Create;:=TList.Create;:=TList.Create;TSubMerger.ClearProcs(FreeElements:boolean);PPT:PProcTask;:PHolder;:pointer;:TList;:=nil;Procs.Countnil do:=PPP.Next.Next;(PPP.Next);.Next:=PPC;(PPP);(true);(true);.Clear;

{FProcTasks.Count0 do:=FLinkTasks.first;.delete(0);(PLT);

};TSubMerger.GetProcPointByUIN(UIN:integer):PProcPoint;i:integer;:=nil;i:=0 to Points.Count-1 doPProcPoint(Points[i]).UIN = UIN then:=Points[i];;;TSubMerger.GetProcTaskByUIN(UIN:integer):PProcTask;i:integer;:=nil;i:=0 to AllProcTasks.Count-1 doPProcTask(AllProcTasks[i]).UIN = UIN then:=AllProcTasks[i];;;TSubMerger.Init(GPoints,GConnections:TList);i:integer;:PPoint;:PConnection;:PProcPoint;:PProcCon;;i:=0 to GPoints.Count-1 do:=GPoints[i];(PPP);.UIN := PP.Uin;.Value := PP.Value;.UBorder:=0;.DBorder:=$8FFFFFFF;.UFixed:=false;.DFixed:=false;.UCon:=0;.DCon:=0;.Prev:=nil;.Next:=nil;.Add(PPP);;i:=0 to GConnections.Count-1 do:=GConnections[i];:= GetProcPointByUIN(PC.fromPoint.UIN);(PPC);.Value := PC.Value;.toPoint := GetProcPointByUIN(PC.toPoint.UIN);.Next := PPP.Next;.Next := PPC;:= GetProcPointByUIN(PC.toPoint.UIN);(PPC);.Value := PC.Value;.toPoint := GetProcPointByUIN(PC.fromPoint.UIN);.Next := PPP.Prev;.Prev := PPC;;;SetUBorderToPPP(PPP:PProcPoint;Value:integer);PPC:PProcCon;:boolean;PPP.UBorder nil donot PPC.toPoint.Merged then

//if PPC.toPoint.DBorder>PPP.UBorder-1 then

SetDBorderToPPP(PPC.toPoint,PPP.UBorder-1);(PPC.toPoint,PPP.UBorder-1);.toPoint.DCon:=PPC.toPoint.DCon+PPC.Value;;:=PPC.Next;;:=PPP.Next;PPC<>nil donot PPC.toPoint.Merged then

//if PPC.toPoint.UBorder<PPP.DBorder+1 then

SetUBorderToPPP(PPC.toPoint,PPP.DBorder+1);(PPC.toPoint,PPP.DBorder+1);.toPoint.UCon:=PPC.toPoint.UCon+PPC.Value;;:=PPC.Next;;;TSubMerger.DoBazovoe;i,j,p:integer;:PProcPoint;:PProcCon;,newPW:PWay;: TList;: TList;: integer;: string;

//-->>:PProcPoint;:boolean;: integer;

//-->>:PProcTask;(true);(true);.Clear;:= TList.Create;:= TList.Create;i:=0 to Points.Count-1 do:=Points[i];.UBorder:=0;.DBorder:=$7FFFFFFF;.UCon:=0;.DCon:=0;.UFixed:=false;.DFixed:=false;.Merged:=false;.Add(PPP);i:=0 to Points.Count-1 do:=Points[i];:=PPP.Next;PPC PPT.StartTime then:=Time-PPT.StartTime;.StartTime:=Time;j:=i+1 to List.Count-1 do

PProcTask(List[j]).StartTime:=PProcTask(List[j]).StartTime+dTime;;;SetProcStartTimes(List:TList);i:integer;:PProcTask;:integer;:=1;i:=0 to List.Count-1 do:=List[i];.StartTime:=Time;:=Time+PPT.Length;;;PLT_TimeCompare(I1,I2:Pointer):integer;D1,D2:integer;,Item2:PLinkTask;:=I1;:=I2;Item1.StartTimeItem2.StartTime then Result:=1Item1.toProc = Item2.toProc thenItem1.toTask.StartTime<Item2.toTask.StartTime