#AdditionalJar: jama.jar
Sub Process_Globals
End Sub
Sub inline As JavaObject
Return Me
End Sub
Sub AppStart (Args() As String)
Dim x() As Double =Array As Double(1, 2, 4, 8, 16, 20)
Dim y() As Double = Array As Double(100, 50, 15, 67, 201, 4)
Dim d(4,2) As Double = inline.RunMethod("PolyReg", Array(x,y,4)) <-------- what to do (I tried before array as object() also)?
'Log(d)
End Sub
#if JAVA
public static class PolynomialRegression implements Comparable<PolynomialRegression> {
public PolynomialRegression(double[] x, double[] y, int degree) {
this(x, y, degree, "x");
}
...
}
public double[][] PolyReg(double[] x, double[] y, int degree) {
PolynomialRegression regression = new PolynomialRegression(x, y, degree);
return regression.PolyReg(x, y, degree);
}
#End If
main._appstart (java line: 56)
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.main._appstart(main.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.main(main.java:30)