Sha256: 59b8e6ae2d26929fd0d7b8854fb323816cda83f261a94910aa173e7e326cd1e7
Contents?: true
Size: 472 Bytes
Versions: 12
Compression:
Stored size: 472 Bytes
Contents
module Qlang module Api module MatrixApi def execute(rows) row_count = rows.count column_count = rows.first.count case $type when :R "matrix(#{VectorApi.execute(rows.flatten)}, #{row_count}, #{column_count}, byrow = TRUE)" when :Ruby arys_str = rows.map { |row| "[#{row.join(', ')}]" }.join(', ') "Matrix[#{arys_str}]" end end module_function :execute end end end
Version data entries
12 entries across 12 versions & 1 rubygems