Class NArray
In: src/narray.c
narray_ext.rb
Parent: Object

Numerical Array Extention for Ruby

  (C) Copyright 2000-2008 by Masahiro TANAKA

This program is free software. You can distribute/modify this program under the same terms as Ruby itself. NO WARRANTY.

Methods

==   []   all?   any?   byte   cast   clone   coerce   collect   collect!   complex   complex?   dcomplex   delete_at   dfloat   dim   dimension   dup   each   element_size   empty?   eql?   fill   fill!   flatten   flatten!   float   hash   indgen   indgen!   inspect   int   integer?   length   lint   map   map!   mean   median   new   newdim   newdim!   newdim=   newrank   newrank!   newrank=   none?   object   original   randomn   randomn!   rank   rank_total   ref   refer   refer   reshape   reshape!   reverse   rms   rmsdev   rot90   scomplex   sfloat   shape   shape=   sint   size   sizes   stddev   to_binary   to_f   to_i   to_na   to_narray   to_s   to_string   to_type   to_type_as_binary   total   typecode   where   where2  

Constants

NARRAY_VERSION = rb_str_new2(NARRAY_VERSION)
BYTE = INT2FIX(NA_BYTE)
SINT = INT2FIX(NA_SINT)
LINT = INT2FIX(NA_LINT)
INT = INT2FIX(NA_LINT)
SFLOAT = INT2FIX(NA_SFLOAT)
DFLOAT = INT2FIX(NA_DFLOAT)
FLOAT = INT2FIX(NA_DFLOAT)
SCOMPLEX = INT2FIX(NA_SCOMPLEX)
DCOMPLEX = INT2FIX(NA_DCOMPLEX)
COMPLEX = INT2FIX(NA_DCOMPLEX)
ROBJ = INT2FIX(NA_ROBJ)
OBJECT = INT2FIX(NA_ROBJ)
NONE = INT2FIX(NA_NONE)
CLASS_DIMENSION = INT2FIX(0)
ENDIAN = INT2FIX(1)
ENDIAN = INT2FIX(-1)
ENDIAN = INT2FIX(0)

Public Class methods

singleton method: NArray[object]

class method: byte(size1,size2,…,sizeN)

class method: complex(size1,size2,…,sizeN)

class method: complex(size1,size2,…,sizeN)

class method: float(size1,size2,…,sizeN)

class method: float(size1,size2,…,sizeN)

class method: int(size1,size2,…,sizeN)

class method: int(size1,size2,…,sizeN)

class method: new(type, size1,size2,…,sizeN)

class method: object(size1,size2,…,sizeN)

singleton method: NArray.refer( other )

singleton method: NArray.refer( other )

class method: scomplex(size1,size2,…,sizeN)

class method: sfloat(size1,size2,…,sizeN)

class method: sint(size1,size2,…,sizeN)

singleton method: NArray.to_na( string, type, size1,size2,…,sizeN ) NArray.to_na( array )

singleton method: NArray.to_na( string, type, size1,size2,…,sizeN ) NArray.to_na( array )

Public Instance methods

method: dup()

method: coerce(other)

iterator: collect()

delete rows/columns

dim()

Alias for rank

dimension()

Alias for rank

dup()

Alias for clone

iterator: each()

method: element_size — returns the element size of the array type

method: empty? — returns true if empty array

fill(p1)

Alias for fill!

method: fill!(val)

indgen(...)

Alias for indgen!

method: indgen!([start,[step]])

method: inspect() — returns the inspect of the array

length()

Alias for size

map()

Alias for collect

map!()

Alias for collect!

Statistics

method: newdim(size1,size2,…,sizeN)

method: newdim!(size1,size2,…,sizeN)

newdim=(...)

Alias for newdim!

newrank(...)

Alias for newdim

newrank!(...)

Alias for newdim!

newrank=(...)

Alias for newdim!

method: self.original

Normal distributed random number; valid for floating point types

method: rank() — returns the rank of the array

method: self.refer

method: reshape(size1,size2,…,sizeN)

method: reshape!(size1,size2,…,sizeN)

method: shape() — returns an array of shape of each rank

shape=(...)

Alias for reshape!

method: size() — returns the total number of elements

sizes()

Alias for shape

method: to_binary — convert the data contents to a BYTE type NArray

method: to_f()

method: to_i()

method: to_s — convert the data contents to a binary string

method: to_type(type)

total()

Alias for size

method: typecode — returns the type of the array

method: where idx_true = narray.where

method: where2 idx_true, idx_false = narray.where2

[Validate]