Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multidimensional array inputs #156

Open
davnn opened this issue Jan 21, 2022 · 2 comments
Open

Allow multidimensional array inputs #156

davnn opened this issue Jan 21, 2022 · 2 comments

Comments

@davnn
Copy link

davnn commented Jan 21, 2022

How could we extend JavaCall to allow passing of multidimensional arrays? E.g.

public class Test {
    public static double[][] testDoubleArray2D(double[][] array) {
        return array;
    }
}

The problem appears to be MethodError: no method matching jvalue(::Vector{Vector{Float64}}), but I'm having a hard time debugging the root cause of this issue.

@mkitti
Copy link
Member

mkitti commented Jan 21, 2022

double[][] is not the correct way to represent a matrix in Java. You would need a multidimensional array class in Java to do this. For example, https:/imglib/imglib2/blob/master/src/main/java/net/imglib2/img/array/ArrayImg.java .

@davnn
Copy link
Author

davnn commented Jan 21, 2022

double[][] is not the correct way to represent a matrix in Java. You would need a multidimensional array class in Java to do this. For example, https:/imglib/imglib2/blob/master/src/main/java/net/imglib2/img/array/ArrayImg.java .

The library I would like to use requires a double[][] as input, I do not have an influence on that design I'm afraid. Do you suggest that I should use some Matrix library and convert the matrix to double[][] natively?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants