How to convert 2d Array to double[][]?

Hey guys,

I would like to use the Matrix class of Apache Commons Maths, and in one
of its constructors it requires a double[][]. Through google I got to
know you can transform a Ruby array with something like
“[1,2,3].to_java(:double)”, but how would you do it with e.g.
“[[1,2],[3,4]]” to get the same result out of it as “double[][] foo =
{{1.0, 2.0}, {3.0, 4.0}}” ?

Kind regards,
Nils

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs