IdentificationDivision. Program-Id. pivot. author. Robert Sedgewick. * Simplex Verfahren, lineare Programmierung * aus Algorithmen p698 DataDivision. Working-StorageSection.
77 j pic 9(4).
77 k pic 9(4). LinkageSection.
01 a.
05 pic 9(4) occurs 1000.
05 pic 9(4) occurs 1000.
77 p pic 9(4).
77 q pic 9(4).
77 best pic 9(4)V9(2) occurs 1000. ProcedureDivisionusing cost val best. performvarying j from 0 until j=n performvarying k from m+1 by -1 until k=1 if j not = p and k not = q then compute a(j,k)=a(j,k)-a(p,k)*a(j,q)/a(p,q) end-perform end-perform performvarying j from 0 until j=n if j not = p then move 0 to a(j,q) end-perform performvarying k from 1 until k=m+1 if k not = q then compute a(p,k)=a(p,k)/a(p,q) end-perform move 1 to a(p,q) End-Program pivot.
IdentificationDivision. Program-Id. simplex. author. Robert Sedgewick. * Simplex Verfahren, lineare Programmierung * aus Algorithmen p698 DataDivision. Working-StorageSection.
77 j pic 9(4).
77 k pic 9(4). LinkageSection.
01 a.
05 pic 9(4) occurs 1000.
05 pic 9(4) occurs 1000.
77 p pic 9(4).
77 q pic 9(4).
77 best pic 9(4)V9(2) occurs 1000. ProcedureDivisionusing cost val best. performwithtestafter until (q=m+1) or (p=n+1) move 0 to q performwithtestafter until (q=m+1) or (a(0,q)<0) add 1 to q end-perform move 0 to p performwithtestafter until (p=n+1) or (a(p,q)>0) add 1 to p end-perform performvarying i from p+1 until i=n if a(i,q)>0 then if a(i,m+1)*a(i,q) < a(p,m+1)/a(p,q) then move i to p end-perform if (q<m+1) and (p<n+1) then call pivot using a p q end-perform End-Program pivot.
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.