Class MDFloatArray

    • Constructor Summary

      Constructors 
      Constructor Description
      MDFloatArray​(float[][] matrix)
      Creates a MDFloatArray from the given matrix of rank 2.
      MDFloatArray​(float[][] matrix, int[] dimensions)
      Creates a MDFloatArray from the given matrix of rank 2 and the dimension which need to be less or equal the dimensions of matrix.
      MDFloatArray​(float[] flattenedArray, int[] dimensions)
      Creates a MDFloatArray from the given flattenedArray and dimensions.
      MDFloatArray​(float[] flattenedArray, int[] dimensions, boolean checkdimensions)
      Creates a MDFloatArray from the given flattenedArray and dimensions.
      MDFloatArray​(float[] flattenedArray, long[] dimensions)
      Creates a MDFloatArray from the given flattenedArray and dimensions.
      MDFloatArray​(float[] flattenedArray, long[] dimensions, boolean checkdimensions)
      Creates a MDFloatArray from the given flattenedArray and dimensions.
      MDFloatArray​(int[] dimensions)
      Creates an empty MDFloatArray with the dimensions.
      MDFloatArray​(int[] dimensions, int capacityHyperRows)
      Creates an empty MDFloatArray with the dimensions.
      MDFloatArray​(long[] dimensions)
      Creates an empty MDIntArray with the dimensions.
      MDFloatArray​(long[] dimensions, long capacityHyperRows)
      Creates an empty MDFloatArray with the dimensions.
      MDFloatArray​(MDFloatArray template)
      Creates an independent copy (clone) of the template provided.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void adaptCapacityHyperRows()  
      int capacity()
      Returns the capacity of elements in the array.
      MDFloatArray clone()  
      boolean equals​(java.lang.Object obj)  
      float get​(int index)
      Returns the value of a one-dimensional array at the position defined by index.
      float get​(int... indices)
      Returns the value of array at the position defined by indices.
      float get​(int indexX, int indexY)
      Returns the value of a two-dimensional array at the position defined by indexX and indexY.
      float get​(int indexX, int indexY, int indexZ)
      Returns the value of a three-dimensional array at the position defined by indexX, indexY and indexZ.
      float[] getAsFlatArray()
      Returns the array in flattened form.
      java.lang.Float getAsObject​(int linearIndex)
      Return an object which has the same value as the element of the array specified by linearIndex.
      java.lang.Float getAsObject​(int... indices)
      Return an object which has the same value as the element of the array specified by indices.
      float[] getCopyAsFlatArray()
      Returns a copy of the array in flattened form.
      int hashCode()  
      void set​(float value, int index)
      Sets the value of a one-dimension array at the position defined by index.
      void set​(float value, int... indices)
      Sets the value of array at the position defined by indices.
      void set​(float value, int indexX, int indexY)
      Sets the value of a two-dimensional array at the position defined by indexX and indexY.
      void set​(float value, int indexX, int indexY, int indexZ)
      Sets the value of a three-dimensional array at the position defined by indexX, indexY and indexZ.
      void setToObject​(java.lang.Float value, int linearIndex)
      Sets the element of the array specified by linearIndex to the particular value.
      void setToObject​(java.lang.Float value, int... indices)
      Sets the element of the array specified by indices to the particular value.
      float[][] toMatrix()
      Creates and returns a matrix from a two-dimensional array.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • MDFloatArray

        public MDFloatArray​(long[] dimensions)
        Creates an empty MDIntArray with the dimensions. Convenience method if dimensions are available as long[].
      • MDFloatArray

        public MDFloatArray​(long[] dimensions,
                            long capacityHyperRows)
        Creates an empty MDFloatArray with the dimensions. If capacityHyperRows > dimensions[0], then it will create an array with a capacity of capacityHyperRows hyper-rows. Convenience method if dimensions are available as long[].
      • MDFloatArray

        public MDFloatArray​(float[] flattenedArray,
                            long[] dimensions)
        Creates a MDFloatArray from the given flattenedArray and dimensions. It is checked that the arguments are compatible. Convenience method if dimensions are available as long[].
      • MDFloatArray

        public MDFloatArray​(float[] flattenedArray,
                            long[] dimensions,
                            boolean checkdimensions)
        Creates a MDFloatArray from the given flattenedArray and dimensions. If checkDimensions is true, it is checked that the arguments are compatible. Convenience method if dimensions are available as long[].
      • MDFloatArray

        public MDFloatArray​(int[] dimensions)
        Creates an empty MDFloatArray with the dimensions.
      • MDFloatArray

        public MDFloatArray​(int[] dimensions,
                            int capacityHyperRows)
        Creates an empty MDFloatArray with the dimensions. If capacityHyperRows > dimensions[0], then it will create an array with a capacity of capacityHyperRows hyper-rows.
      • MDFloatArray

        public MDFloatArray​(float[] flattenedArray,
                            int[] dimensions)
        Creates a MDFloatArray from the given flattenedArray and dimensions. It is checked that the arguments are compatible.
      • MDFloatArray

        public MDFloatArray​(float[] flattenedArray,
                            int[] dimensions,
                            boolean checkdimensions)
        Creates a MDFloatArray from the given flattenedArray and dimensions. If checkDimensions is true, it is checked that the arguments are compatible.
      • MDFloatArray

        public MDFloatArray​(float[][] matrix)
        Creates a MDFloatArray from the given matrix of rank 2. Note that the values in matrix will be copied and thus the created MDIntArray will be independent from matrix after construction.
      • MDFloatArray

        public MDFloatArray​(float[][] matrix,
                            int[] dimensions)
        Creates a MDFloatArray from the given matrix of rank 2 and the dimension which need to be less or equal the dimensions of matrix. Note that the values in matrix will be copied and thus the created MDIntArray will be independent from matrix after construction.
      • MDFloatArray

        public MDFloatArray​(MDFloatArray template)
        Creates an independent copy (clone) of the template provided.
    • Method Detail

      • capacity

        public int capacity()
        Description copied from class: MDAbstractArray
        Returns the capacity of elements in the array.
        Specified by:
        capacity in class MDAbstractArray<java.lang.Float>
      • getAsObject

        public java.lang.Float getAsObject​(int... indices)
        Description copied from class: MDAbstractArray
        Return an object which has the same value as the element of the array specified by indices.
        Specified by:
        getAsObject in class MDAbstractArray<java.lang.Float>
      • setToObject

        public void setToObject​(java.lang.Float value,
                                int... indices)
        Description copied from class: MDAbstractArray
        Sets the element of the array specified by indices to the particular value.
        Specified by:
        setToObject in class MDAbstractArray<java.lang.Float>
      • getAsObject

        public java.lang.Float getAsObject​(int linearIndex)
        Description copied from class: MDAbstractArray
        Return an object which has the same value as the element of the array specified by linearIndex.
        Specified by:
        getAsObject in class MDAbstractArray<java.lang.Float>
        Parameters:
        linearIndex - The index in the linear array returned by MDAbstractArray.getAsFlatArray().
        Returns:
        The value at the specified index.
      • setToObject

        public void setToObject​(java.lang.Float value,
                                int linearIndex)
        Description copied from class: MDAbstractArray
        Sets the element of the array specified by linearIndex to the particular value.
        Specified by:
        setToObject in class MDAbstractArray<java.lang.Float>
        Parameters:
        value - The new value to set.
        linearIndex - The index in the linear array returned by MDAbstractArray.getAsFlatArray().
      • getAsFlatArray

        public float[] getAsFlatArray()
        Description copied from class: MDAbstractArray
        Returns the array in flattened form. Changes to the returned object will change the multi-dimensional array directly.
        Specified by:
        getAsFlatArray in class MDAbstractArray<java.lang.Float>
      • getCopyAsFlatArray

        public float[] getCopyAsFlatArray()
        Description copied from class: MDAbstractArray
        Returns a copy of the array in flattened form. Changes to the returned object will not change the multi-dimensional array directly.
        Specified by:
        getCopyAsFlatArray in class MDAbstractArray<java.lang.Float>
      • get

        public float get​(int... indices)
        Returns the value of array at the position defined by indices.
      • get

        public float get​(int index)
        Returns the value of a one-dimensional array at the position defined by index.

        Do not call for arrays other than one-dimensional!

      • get

        public float get​(int indexX,
                         int indexY)
        Returns the value of a two-dimensional array at the position defined by indexX and indexY.

        Do not call for arrays other than two-dimensional!

      • get

        public float get​(int indexX,
                         int indexY,
                         int indexZ)
        Returns the value of a three-dimensional array at the position defined by indexX, indexY and indexZ.

        Do not call for arrays other than three-dimensional!

      • set

        public void set​(float value,
                        int... indices)
        Sets the value of array at the position defined by indices.
      • set

        public void set​(float value,
                        int index)
        Sets the value of a one-dimension array at the position defined by index.

        Do not call for arrays other than one-dimensional!

      • set

        public void set​(float value,
                        int indexX,
                        int indexY)
        Sets the value of a two-dimensional array at the position defined by indexX and indexY.

        Do not call for arrays other than two-dimensional!

      • set

        public void set​(float value,
                        int indexX,
                        int indexY,
                        int indexZ)
        Sets the value of a three-dimensional array at the position defined by indexX, indexY and indexZ.

        Do not call for arrays other than three-dimensional!

      • toMatrix

        public float[][] toMatrix()
        Creates and returns a matrix from a two-dimensional array.

        Do not call for arrays other than two-dimensional!

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • clone

        public MDFloatArray clone()
        Overrides:
        clone in class java.lang.Object