Sha256: 0e039da1c194ea21540b69d4cdbd6e178b0cf71784fa279b465b8446ad2a2881

Contents?: true

Size: 427 Bytes

Versions: 9

Compression:

Stored size: 427 Bytes

Contents

module Hilbert
  module Parser
    module MatrixParser
      include Base
      def execute(els, opts = { trans: false })
        trans = opts[:trans]
        rows = els.first.split(/ *(?:;|\n) */).map(&:split_by_sp)
        rows.all? { |row| row.count == rows.first.count }
        if trans
          rows = rows.transpose
        end
        MatrixApi.execute(rows)
      end
      module_function :execute
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hilbert-0.0.2700420 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700410 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700400 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700320 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700300 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700210 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700110 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700100 lib/hilbert/parser/matrix_parser.rb
hilbert-0.0.2700001 lib/hilbert/parser/matrix_parser.rb