Skip to content
Rodrigo Botafogo edited this page May 20, 2013 · 45 revisions

Welcome to the MDArray wiki!

MDArray is a multi dimensional array implemented for JRuby with similar functionalities (but still less) to numpy and narray by Masahiro Tanaka. MDArray targets specifically JRuby as it uses Java-NetCDF library from Unidata (http://www.unidata.ucar.edu).

MDArray main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers.

  • MDArray Properties

    • Easy calculation for large numerical multi dimensional arrays;
    • Basic types are: boolean, byte, short, int, long, float, double, string, structure;
    • Based on JRuby, which allows importing Java libraries. Version 0.4.0 only imports Java-NetCDF;
    • Operator: +,-,*,/,%,**, >, >=, etc.
    • Functions: abs, ceil, floor, truncate, is_zero, square, cube, fourth;
    • Binary Operators: &, |, ^, ~ (binary_ones_complement), <<, >>;
    • Ruby Math functions: acos, acosh, asin, asinh, atan, atan2, atanh, cbrt, cos, erf, exp, gamma, hypot, ldexp, log, log10, log2, sin, sinh, sqrt, tan, tanh, neg;
    • Boolean operations on boolean arrays: and, or, not;
    • Simple statistics: sum, min, max, mean, weighted_mean;
    • Easy manipulation of arrays: reshape, reduce dimension, permute, section, slice, etc.
  • MDArray is similar to:

    • Ruby/NArray, Python/NumPy, Perl/PDL, Yorick, IDL
  • MDArray is far from completed!

    • Experimental! Specification may be changed;
    • Far from completed;
    • Bugs may be included;
    • No documentation;
    • Performance needs improvement.
  • Tested Platform

    • JRuby 1.7.3
    • Java 7
  • Installation

    • Needs JRuby installed
    • jruby -S gem install mdarray
  • Author

    Rodrigo Botafogo: [email protected]

Introduction

In MDArray dimensions are called axes. The number of axes is its rank. For example, the coordinates of a point in 3D space [1, 2, 1] is an array of rank 1, because it has one axis. That axis has a length of 3. In the example pictured below, the array has rank 2 (it is 2-dimensional). The first dimension (axis) has a length of 2, the second dimension has a length of 3.

[ [1, 2, 3], [4, 5, 6] ]

Using MDArray

Clone this wiki locally