Sha256: f0a90c99082fd062f2edea71df479935f45af53c83134ec4e6709102a0e8477a

Contents?: true

Size: 881 Bytes

Versions: 18

Compression:

Stored size: 881 Bytes

Contents

begin
  require "numru/nusdas"
rescue LoadError
end
require "numru/gphys/varray"

module NumRu

  class VArrayNuSDaS < VArray

    def initialize(var)
      unless NuSDaSVar === var
        raise ArgumentError, "Not a NuSDaSVar"
      end
      @name = var.name
      @mapping = nil
      @varray = nil
      @ary = var
      @attr = Attribute.new
      var.att_names.each{|name|
        @attr[name] = var.att(name)
      }
    end

    def inspect
      "<'#{name}' in '#{@ary.nusdas.root}' [#{@ary.shape.join(", ")}]>"
    end

    def val
      @ary.get
    end

    def shape
      @ary.shape
    end
    alias shape_ul0 shape
    alias shape_current shape

    def total
      @ary.total
    end
    alias length total

    def rank
      @ary.rank
    end

    undef reshape!

    def dim_names
      @ary.dim_names
    end

    def file
      @ary.nusdas
    end

  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
gphys-1.5.6 lib/numru/gphys/varraynusdas.rb
gphys-1.5.5 lib/numru/gphys/varraynusdas.rb
gphys-1.5.4 lib/numru/gphys/varraynusdas.rb
gphys-1.5.3 lib/numru/gphys/varraynusdas.rb
gphys-1.5.2 lib/numru/gphys/varraynusdas.rb
gphys-1.5.1 lib/numru/gphys/varraynusdas.rb
gphys-1.5.0 lib/numru/gphys/varraynusdas.rb
gphys-1.4.3.2 lib/numru/gphys/varraynusdas.rb
gphys-1.4.3.1 lib/numru/gphys/varraynusdas.rb
gphys-1.4.3 lib/numru/gphys/varraynusdas.rb
gentooboontoo-gphys-1.3.1.1 lib/numru/gphys/varraynusdas.rb
gentooboontoo-gphys-0.6.1.3 lib/numru/gphys/varraynusdas.rb
gphys-1.2.2.1a lib/numru/gphys/varraynusdas.rb
gphys-1.2.2.1 lib/numru/gphys/varraynusdas.rb
gphys-1.2.2 lib/numru/gphys/varraynusdas.rb
gphys-1.1.1b lib/numru/gphys/varraynusdas.rb
gphys-1.1.1a lib/numru/gphys/varraynusdas.rb
gphys-1.1.1 lib/numru/gphys/varraynusdas.rb