WilCrofter / GenS.jl

A Julia package to generate the nonzero entries of a system matrix.
Other
0 stars 1 forks source link

Zero index #3

Closed reginaastri closed 8 years ago

reginaastri commented 8 years ago

I'm calling genS with incorrect parameters but at the entry for (5,6), that is xmitr 5 and rcvr 6, a zero for the row index appears. The following code calls probePos and genS (with incorrect parameters) and prints the xmitr,rcvr pairs followed by a list of values which are linear combinations of the i,j indices associated with the pairs. For (xmitr,rcvr)==(5,6) the first entry is 0.

using GenS

function zeroRow() r2 = Float64[-.1 8.1; -.1 -0.1; 8.1 -0.1; 8.1 8.1] grid = .5 width = 8 height = 8 xmitr,rcvr = probePos(8,r2) data = genS(width,height,grid,xmitr,rcvr) for (j in 1:height) for (i in 1:width) col = (data[i,j][1][:,1]-1)width + data[i,j][1][:,2] println(i," ",j," \ ",col) end #i end #j end #function

WilCrofter commented 8 years ago

Fixed and test added.