Hi Sir,
I'm testing to use Alglib for a 300x300 2D scattered data interpolation , I reference to this thread http://forum.alglib.net/viewtopic.php?f=2&t=59 and tried to convert it to vb.net, unfortunately, I got the output with no changes of original data, can you please help to to check where is wrong in my codes. thanks!
'export_array(a) , a is a (300,300) please refer to data file. Dim z1 As idwinterpolant Dim nx As Integer = 2 Dim d As Integer = 2 Dim n As Integer = 301 * 301 - 1 Dim nq As Integer = 30 Dim nw As Integer = 50 Dim idwerrors As Boolean = False
Dim xy(n, nx) As Double Dim k As Integer = 0 Dim x(1) As Double Dim i As Integer, j As Integer
For i = 0 To 300 For j = 0 To 300 xy(k, 0) = i xy(k, 1) = j xy(k, 2) = a(i, j) k += 1 Next Next
'////////////////////////////////////////////////////// '// build interpolant '////////////////////////////////////////////////////// idwbuildmodifiedshepard(xy, n, nx, d, nq, nw, z1)
For i = 0 To n x(0) = xy(i, 0) x(1) = xy(i, 1) a(xy(i, 0), xy(i, 1)) = idwcalc(z1, x) 'idwerrors = ap::fp_neq(val, xy(i,nx)); Next
' export_array(a)
Attachments: |
File comment: data
arp-000.csv [248.95 KiB]
Downloaded 758 times
|
|