Jump to content

sharkos

Members
  • Posts

    4
  • Joined

  • Last visited

sharkos's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Cant get it to work on Win2008 64bit @error = 2 I have ODBC 3.51 (32bit) installed. In HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers i have only 2 keys: SQL Native Client = Installed SQL Server = Installed Ive tried to reinstall witch no effect.
  2. Thx KaFu So problem was $A3=$A2 it should be after Step 1
  3. Input: Step 1 result: Step 2 result: Step 2 desired result: Whats going on?
  4. Im trying to write Gaussian elimination method. I have array (column 0 and row 0 are empty always): 11 | 12 | 13 | 14 21 | 22 | 23 | 24 31 | 32 | 33 | 34 In Stage 1 first array ($A) is modyfied by function 'calc' and saved in second array and it looks like these ( * - updated): 11 | 12 | 13 | 14 21* | 22* | 23* | 24* 31* | 32* | 33* | 34* In Stage 2 second array ($A2) is modyfied and saved in to $A3, should look like these: 11 | 12 | 13 | 14 21 | 22 | 23 | 24 31 | 32* | 33* | 34* But it dosent. Function 'calc' is called 3 times like it should be, but array is changed like these: 11 | 12 | 13 | 14 21(+1)* | 22(+1)* | 23(+1)* | 24(+1)* 31(+2)* | 32* | 33* | 34* Heres my code: #Include <Array.au3> $gi=3 $gj=$gi+1 Dim $A[$gi+1][$gj+1] Dim $A2[$gi+1][$gj+1] Dim $A3[$gi+1][$gj+1] $A[1][1] = 2 $A[1][2] = 2 $A[1][3] = 2 $A[1][4] = 2 $A[2][1] = 1 $A[2][2] = 2 $A[2][3] = 4 $A[2][4] = 0 $A[3][1] = 2 $A[3][2] = 2 $A[3][3] = 1 $A[3][4] = -2 $A2=$A $A3=$A ; Stage 1 <===================== For $ti=2 To $gi Step +1 For $tj=1 To $gj Step +1 $A2[$ti][$tj] = Call("calc", $A, $ti, $tj, 1) Next Next _ArrayDisplay($A2, "Window") ;Stage 2 <===================== For $ti=3 To $gi Step +1 For $tj=2 To $gj Step +1 $A3[$ti][$tj] = Call("calc", $A2, $ti, $tj, 2) Next Next _ArrayDisplay($A3, "Window") Func calc($T, $i, $j, $c) $temp = $T[$i][$j] - ($T[$i][$c]/$T[$c][$c]) * $T[$c][$j] MsgBox(0,"","$T["&$i&"]["&$j&"] - ($T["&$i&"]["&$c&"]/$T["&$c&"]["&$c&"]) * $T["&$c&"]["&$j&"] = "&$temp);FOR DEBUG ONLY Return $temp EndFunc Whats wrong in Step 2?
×
×
  • Create New...