NDArray
Date: 2015-08-04

jep

## Class NDArray<T>

- java.lang.Object
- - jep.NDArray<T>

-     public class NDArray<T>
      extends java.lang.Object

  Represents a numpy.ndarray in Java. If Jep was compiled with numpy support, this object will not be wrapped as a PyJobject in the Python sub-interpreter(s), it will instead be transformed into a numpy.ndarray automatically (and vice versa). The transformation in either direction occurs with a `memcpy`, therefore changes in the array in one language will not affect the array in the other language.

  NDArrays only support Java primitive arrays as the underlying type of data. The data can conceptually be multi-dimensional, but it must be represented as a one-dimensional array in Java to ensure the memory is contiguous.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected T` | `data`
    `protected int[]` | `dimensions`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NDArray(T data)` Constructor for a Java NDArray.
    `NDArray(T data, int... dimensions)` Constructor for a Java NDArray.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `T` | `getData()`
    `int[]` | `getDimensions()`
    `int` | `hashCode()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### data

          protected final T data

    - #### dimensions

          protected final int[] dimensions

  - ### Constructor Detail

    - #### NDArray

          public NDArray(T data)

      Constructor for a Java NDArray. Presumes the data is one dimensional.
      Parameters:
        `data` - a one-dimensional primitive array such as float[], int[]

    - #### NDArray

          public NDArray(T data,
                 int... dimensions)

      Constructor for a Java NDArray.
      Parameters:
        `data` - a one-dimensional primitive array such as float[], int[]
        `dimensions` - the conceptual dimensions of the data (corresponds to the numpy.ndarray dimensions in C-contiguous order)

  - ### Method Detail

    - #### getDimensions

          public int[] getDimensions()

    - #### getData

          public T getData()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`