Dear all,
I’ve posted this previously to the Ruby Forum:
In a JRuby script, I try to use Java code from
to do matrix calculations. This works in principle fine, however,
as described in the accompanying tutorial, Java matrices are
defined with a syntax like so:
double[][] A = { { 1.1, 1.2, 1.3, 1.4 }, { 2.1, 2.2, 2.3, 2.4 }, { 3.1,
3.2, 3.3, 3.4 } };
This syntax clashes in JRuby with the definition of Hashes.
I can’t find another way of writing data into the Matrix.
Is there a way of defining an alias for the curly braces method syntax,
somewhat analogous to the class name renaming example in the JRuby
cookbook ? :
Example 1-7. Creating an alias to avoid class name conflicts
include Java
include_class ‘java.lang.String’ do |package,name|
“JString”
end
p JString.new(“A quick brown fox”).indexOf(“brown”)
If this is not possible, do you know of a good Java matrix calculation
library that includes Singular value decomposition
(Singular value decomposition - Wikipedia) ?
Thank you very much for your help!
Best regards,
Axel
–
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter Aktuelle Nachrichten aus Politik, Wirtschaft & Panorama | GMX
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email