Class: Array
Overview
Extensions to Ruby’s Array class
Instance Method Summary collapse
-
#to_mat ⇒ Object
Convert array to matrix.
-
#to_matlab_string ⇒ Object
Convert array to matrix string representation.
Instance Method Details
#to_mat ⇒ Object
Convert array to matrix.
49 50 51 |
# File 'lib/jblas/extensions.rb', line 49 def to_mat JBLAS::DoubleMatrix[*self] end |
#to_matlab_string ⇒ Object
Convert array to matrix string representation
54 55 56 |
# File 'lib/jblas/extensions.rb', line 54 def to_matlab_string '[' + map{|e| e.to_s}.join(', ') + ']' end |