Class MatlabInt64Array<T>

  • Type Parameters:
    T - long array type, ex. long[], long[][], long[][][], ...

    public class MatlabInt64Array<T>
    extends java.lang.Object
    Since:
    4.2.0
    • Method Detail

      • getInstance

        public static <T> MatlabInt64Array<T> getInstance​(T real,
                                                          T imaginary)
      • getElementAtLinearIndex

        public MatlabInt64 getElementAtLinearIndex​(int index)
        Gets the element at index treating this array as a MATLAB column vector. This is equivalent to indexing into a MATLAB array with just one subscript.
        Returns:
        element at index
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds
      • getElementAtIndices

        public MatlabInt64 getElementAtIndices​(int row,
                                               int column,
                                               int... pages)
        Gets the element at the specified row, column, and pages.
        Returns:
        element at row, column, and pages
        Throws:
        java.lang.IllegalArgumentException - if number of indices does not equal this array's number of dimensions
        java.lang.ArrayIndexOutOfBoundsException - if the indices are out of bound
      • isReal

        public boolean isReal()
        Returns true if the array has no imaginary values, false otherwise. Equivalent to the MATLAB isreal function.
        Returns:
      • toRealArray

        public T toRealArray()
        Returns an array that holds the real values from the MATLAB array. Each call returns a new copy which may be used in any manner; modifications to it will have no effect on this instance.
        Returns:
        real array
      • toImaginaryArray

        public T toImaginaryArray()
        Returns an array that holds the imaginary values from the MATLAB array. Each call returns a new copy which may be used in any manner; modifications to it will have no effect on this instance. If this array is real then the returned array will be have 0 as all of its base elements.
        Returns:
        imaginary array
      • getNumberOfElements

        public int getNumberOfElements()
        The number of elements in the array. The real and imaginary components of a number are together considered one element. This is equivalent to MATLAB's numel function.
        Returns:
        number of elements
      • getLengthOfDimension

        public int getLengthOfDimension​(int dimension)
        Returns the length of the dimension specified by dimension. Dimensions use 0-based indexing. So the first dimension, which is dimension 0, is the row length. The second dimension is the column length. The third dimension and beyond are pages.
        Parameters:
        dimension -
        Returns:
        length of dimension
        Throws:
        java.lang.IllegalArgumentException - if dimension is not a dimension of the array
      • getNumberOfDimensions

        public int getNumberOfDimensions()
        Returns the number of dimensions of the array.
        Returns:
        number of dimensions
      • toString

        public java.lang.String toString()
        Returns a brief description of this array. The exact details of this representation are unspecified and are subject to change.
        Overrides:
        toString in class java.lang.Object
        Returns:
      • 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