Hi list,

I'm wanting to use a matrix as input to some java code, but I seem to be
unable to do this (See code below). When searching online for a solution I
found that rJava 0.5-2 (the version under development not yet in CRAN) is
adding "direct support for raw vectors as method parameters". Is this
related?

I also tried to use .jarray / .jcast in various combinations to no avail.

The only way I can think of to solve this is to modify the java code to
allow me to upload a row of the matrix one at a time.

Any other ideas?

> require(rJava);
Loading required package: rJava
> t = rbind(c(1,2,3),c(2,3,4),c(1,2,10));
> .jinit()
> distanceMatrix = .jnew("data/structure/DistanceMatrix");

> .jmethods(distanceMatrix);
 ... other methods omitted for brevity ...
 [4] "public void data.structure.DistanceMatrix.setDistances(double[][])"

> .jcall(distanceMatrix, "V", "setDistances", as.matrix(t));
Error in .jcall(distanceMatrix, "V", "setDistances", as.matrix(t)) :
  method setDistances with signature ([D)V not found
Calls: .jcall -> .External
Execution halted



Thanks in advance,
ben

	[[alternative HTML version deleted]]

