Private Sub gauss5() i0 = i0 + 1 d2 = (w1 - A11 - 2) * z1 : pas = I(2) ' d2 = Math.Abs(d2) For A9 = w1 To w2 d2 = d2 + z1 n2 = d2 + 1 n3 = d2 + z1 ' n2 = Math.Abs(n2) :' n3 = Math.Abs(n3) If w3 = 0 Then GoTo SA1990 End If Console.WriteLine(" Gauss5 čte wequ od" & n2 & " Do" & n3 & " rovnice:" & q1 & ".") Using sr As New StreamReader("c:\temp\wequ.txt", True) ' For jj = 1 To (i0 - 1) * (I(2) + I(6)) ' sr.ReadLine() ' Next jj ' While Not sr.EndOfStream For j = n2 To n3 Dim ss As Double = CDbl(sr.ReadLine()) KA(j) = ss 'načtení KA() z temp\wequ.txt na disku c:\ Next j ii = 0 For j = n2 To n3 'přiřazení wequ(q1,ii) do KA(j) ii = ii + 1 ' KA(j) = wequ(q1, ii) Console.Write(" KAwequ(" & j & ")=") Console.Write("(0) ", KA(j)) 'kontrolní tisk KA() !! ' Console.WriteLine(" wequ(" & q1 & "," & ii & ")=" & wequ(q1, ii) & ".") 'kontrolní tisk wequ( , ) Next j ' For j = 1 To (I(1) - i0) * (I(2) + I(6)) - 1 ' sr.ReadLine() ' Next j q1 = q1 + 1 ' End While End Using SA1990: If w3 <> 0 Then GoTo SA2240 End If If d9 <= 0 Then GoTo SA2120 End If Using sr As New StreamReader("c:\temp\alfa.txt", True) ' While Not sr.EndOfStream Console.WriteLine(" čte alfa-rovnice " & q3 & ".") For j = n2 To n3 Dim ss As Double = CDbl(sr.ReadLine()) KA(j) = ss : Console.Write(" KAalfa(" & j & ")=") ' KA() načteno z temp\alfa.txt na disku c:\ Console.Write("(0) ", KA(j)) Next j Console.WriteLine() ' End While End Using ' Using sr As New StreamReader("c:\temp\alfb.txt") ' For j = n2 To n3 ' Dim ss As Double = CDbl(sr.ReadLine()) ' KA(j) = ss : Console.WriteLine(" KA(" & j & ")=" & KA(j) & ".") ' Next j ' End Using q3 = q3 + 1 SA2120: If d9 >= 0 Then GoTo SA2240 End If Using sr As New StreamReader("c:\temp\beta.txt") ' While Not sr.EndOfStream Console.WriteLine(" čte beta-rovnice " & q7 & " n2=" & n2 & " n3=" & n3 & ".") For j = n2 To n3 Dim ss As Double = CDbl(sr.ReadLine()) KA(j) = ss : Console.Write(" KAbeta(" & j & ")=") ' KA() načteno z temp\beta.txt na disku c:\ Console.Write("(0) ", KA(j)) Next j Console.WriteLine() ' End While End Using ' Using SR As New StreamReader("c:\temp\betb.txt", True) ' For j = n2 To n3 ' Dim ss As Double = CDbl(sr.ReadLine()) ' KA(j) = ss : Console.WriteLine(" KA(" & j & ")=" & KA(j) & ".") ' Next j q7 = q7 + 1 SA2240: Next A9 ' Stop DA = w1 - A11 - 2 ' DA = Math.Abs(DA) CA = DA * z1 + 1 EE = 8 * z1 Using sw As New StreamWriter("c:\temp\wwork.txt", True) Console.WriteLine(" zápis souboru wwork: " & w1 & "------->" & w2 & ".") For n = w1 To w2 Step f1 'eliminace Gauss... vektoru KA() DA = DA + f1 CA = CA + z1 c3 = CA + i2 u1 = i2 - DA - f1 If u1 > B22 Then GoTo SA2600 End If If u1 >= 0 Then d4 = z1 * (u1 - I(2) + DA) + f1 Else u1 = f0 : d4 = z1 * (u1 - I(2) + DA) + f1 End If For j = u1 To B22 Step f1 d4 = d4 + z1 d5 = d4 + I(2) d3 = d5 - j - f1 If KA(d3) = f0 Then GoTo SA2580 End If If KA(d4) = 0 Then KA(d4) = 1 End If m = -KA(d3) / KA(d4) r1 = d3 - CA For j1 = n1 + CA To j + CA Step f1 KA(j1) = KA(j1) + m * KA(r1 + j1) Next j1 For j9 = n1 To p1 Step f1 n2 = c3 + j9 ' n2 = Math.Abs(n2) n3 = d5 + j9 ' n3 = Math.Abs(n3) KA(n2) = KA(n2) + m * KA(n3) Next j9 SA2580: Next j SA2600: n3 = (CA + B11) Console.WriteLine(" rovnice eliminovaná:" & n & " CA=:" & CA & " n3=:" & n3 & ".") For j = CA To n3 Step f1 sw.WriteLine(KA(j)) 'zápis eliminované rovnice...vektoru KA() do souboru temp\wwork.txt na disk c:\ Console.Write(" KAelim(" & j & ")=") Console.Write("(0) ", KA(j)) Next j Console.WriteLine() sw.Flush() q2 = q2 + 1 Next n End Using Console.WriteLine(" konec gauss5") End Sub tak toto je ten podprogram (procedura) Gauss5() , kde se to pole wequ(,) vynulovalo J.T.
|