Hi All!
Sorry for newbie question, but this is the first occassion to do with this kind of params and I can't figure out how to do it:
I can see the error message, but don't know how to solve it...
thanks in advance
Sorry for newbie question, but this is the first occassion to do with this kind of params and I can't figure out how to do it:
I can see the error message, but don't know how to solve it...
thanks in advance
B4X:
#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)
Last edited: