rmatrix 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/gpu_example.rb +17 -0
- data/lib/rmatrix/core.rb +1 -1
- data/lib/rmatrix/matrix.rb +15 -0
- data/lib/rmatrix/{matrix_table.rb → printing/matrix_table.rb} +2 -0
- data/lib/rmatrix/{print_table.rb → printing/print_table.rb} +1 -4
- data/lib/rmatrix/typecode.rb +7 -7
- data/lib/rmatrix/version.rb +1 -1
- metadata +5 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b03156a99a7338c06f4bde90d9c21af4323e3a75
         | 
| 4 | 
            +
              data.tar.gz: 9c3229920bcb608b8cec92320e2f5c4119d93966
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2f3d4b98cdb9cb7fde56f80fa4988c9bbf88387c136dd0487ee0192e533d61c0a06a5ed070f6dbdbcc48fa932cf73ab9b216219123e7802ad82a0bce8c6343db
         | 
| 7 | 
            +
              data.tar.gz: 8e19dfaf471c07dbaf8463ab646bb5c9c1f440f2d20ad2f71e8ab4b519f3488d0c2fea61031f7c5f296fff713fb433d82b8d492aafed85d1c453869b881c3bd9
         | 
    
        data/lib/rmatrix/core.rb
    CHANGED
    
    
    
        data/lib/rmatrix/matrix.rb
    CHANGED
    
    | @@ -58,6 +58,21 @@ module RMatrix | |
| 58 58 | 
             
                  narray.to_s << ':' << columns.to_s << ':' << rows.to_s << ':' << narray.typecode.to_s
         | 
| 59 59 | 
             
                end
         | 
| 60 60 |  | 
| 61 | 
            +
                def to_f
         | 
| 62 | 
            +
                  if length === 1
         | 
| 63 | 
            +
                    self[0].to_f
         | 
| 64 | 
            +
                  else
         | 
| 65 | 
            +
                    raise "Can only call to_f on vectors of length 1"
         | 
| 66 | 
            +
                  end
         | 
| 67 | 
            +
                end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                def to_i
         | 
| 70 | 
            +
                  if length === 1
         | 
| 71 | 
            +
                    self[0].to_i
         | 
| 72 | 
            +
                  else
         | 
| 73 | 
            +
                    raise "Can only call to_i on vectors of length 1"
         | 
| 74 | 
            +
                  end
         | 
| 75 | 
            +
                end
         | 
| 61 76 | 
             
                def self._load arg
         | 
| 62 77 | 
             
                  split_index, buffer, index = 0, '', arg.length - 1
         | 
| 63 78 | 
             
                  split = Array.new(3)
         | 
| @@ -80,7 +80,7 @@ TEX | |
| 80 80 | 
             
                end
         | 
| 81 81 |  | 
| 82 82 | 
             
                def numeric_to_truncated_string(numeric)
         | 
| 83 | 
            -
                   | 
| 83 | 
            +
                  numeric.to_s
         | 
| 84 84 | 
             
                end
         | 
| 85 85 |  | 
| 86 86 | 
             
                def [](column, row)
         | 
| @@ -101,7 +101,4 @@ TEX | |
| 101 101 | 
             
                  self.row_count = [self.row_count || 0 , idx.succ].max
         | 
| 102 102 | 
             
                end
         | 
| 103 103 | 
             
              end
         | 
| 104 | 
            -
             | 
| 105 | 
            -
             | 
| 106 104 | 
             
            end
         | 
| 107 | 
            -
            require_relative 'matrix_table'
         | 
    
        data/lib/rmatrix/typecode.rb
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            module RMatrix
         | 
| 2 2 | 
             
              class Matrix
         | 
| 3 3 | 
             
                module Typecode
         | 
| 4 | 
            -
                  BYTE | 
| 5 | 
            -
                  SINT | 
| 6 | 
            -
                  INT | 
| 7 | 
            -
                  SFLOAT | 
| 8 | 
            -
                  FLOAT | 
| 4 | 
            +
                  BYTE     = 1
         | 
| 5 | 
            +
                  SINT     = 2
         | 
| 6 | 
            +
                  INT      = 3
         | 
| 7 | 
            +
                  SFLOAT   = 4
         | 
| 8 | 
            +
                  FLOAT    = 5
         | 
| 9 9 | 
             
                  SCOMPLEX = 6
         | 
| 10 | 
            -
                  COMPLEX | 
| 11 | 
            -
                  OBJECT | 
| 10 | 
            +
                  COMPLEX  = 7
         | 
| 11 | 
            +
                  OBJECT   = 8
         | 
| 12 12 | 
             
                end
         | 
| 13 13 | 
             
              end
         | 
| 14 14 | 
             
            end
         | 
    
        data/lib/rmatrix/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rmatrix
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Wouter Coppieters
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2018-01-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -154,12 +154,13 @@ files: | |
| 154 154 | 
             
            - Rakefile
         | 
| 155 155 | 
             
            - bin/console
         | 
| 156 156 | 
             
            - bin/setup
         | 
| 157 | 
            +
            - examples/gpu_example.rb
         | 
| 157 158 | 
             
            - lib/rmatrix.rb
         | 
| 158 159 | 
             
            - lib/rmatrix/core.rb
         | 
| 159 160 | 
             
            - lib/rmatrix/indices.rb
         | 
| 160 161 | 
             
            - lib/rmatrix/matrix.rb
         | 
| 161 | 
            -
            - lib/rmatrix/matrix_table.rb
         | 
| 162 | 
            -
            - lib/rmatrix/print_table.rb
         | 
| 162 | 
            +
            - lib/rmatrix/printing/matrix_table.rb
         | 
| 163 | 
            +
            - lib/rmatrix/printing/print_table.rb
         | 
| 163 164 | 
             
            - lib/rmatrix/shortcuts.rb
         | 
| 164 165 | 
             
            - lib/rmatrix/typecode.rb
         | 
| 165 166 | 
             
            - lib/rmatrix/vector.rb
         |