How to transform a two dimension Array[Array[Double]] to a Java double[][]?

As described in the title. I have used a third party jar in my program which was written in Java. There is a method take double[][] as its argument as below
public LinearSearch(T[] dataset, Distance distance)
Actually, it’s a two dimension array, I used it in Java code like this:
double[][] data = new double[positions.size()][2];
LinearSearch linearSearch = new LinearSearch(data, euclideanDistance);
So how can I adapt this method in my program, anyone can help?

I’m not sure what the problem is. A Scala Array[Array[Double]] is exactly the same as a Java double[][].

1 Like

That the problem is solved. Actually, it’s not a problem. I’m mistake the parameters. Thank you all the same.:wink: