Different behaviour for nativ JVM and python called JVM by checking Vector.length == 1
Calling the main method of the Radon transform from the reference implementation for Flatpanel seminar (edu.stanford.rsl.science.bier.flatPanel.Radon) interrupts with a java assert: "Direction vector must be of length 1:[VECTOR]".
Running the main native, the assert did not occur.
The Assert is occurring in class edu.stanford.rsl.conrad.geometry.General in method : "intersectRayWithCuboid" third statement:
assert (Math.abs(dir.normL2() - 1.0) < 10.0*CONRAD.DOUBLE_EPSILON) : new IllegalArgumentException("Direction vector must be of length 1:" + dir);
The problem can be fixed by multiplying the DOUBLE_EPSILON with 100 instead of 10: assert (Math.abs(dir.normL2() - 1.0) < 100.0*CONRAD.DOUBLE_EPSILON) : new IllegalArgumentException("Direction vector must be of length 1:" + dir);
Explanation for this behaviour?
I have no explanation for this, all the object should be created by the JVM, so different precision of double values should not be the Point. In my understanding jpype just have the address pointer to the variables, but they are allocated and created by the JVM itself. Additionally the problem occurs for a SimpleVector which is only living in the java code and is not accessible via jpype in python.