Documentation of 'org.nd4j.linalg.factory.BaseNDArrayFactory' Java class
BaseNDArrayFactory
org.nd4j.linalg.factory

Class BaseNDArrayFactory

  • All Implemented Interfaces:
    NDArrayFactory
    Direct Known Subclasses:
    JblasNDArrayFactory


    public abstract class BaseNDArrayFactory
    extends java.lang.Object
    implements NDArrayFactory
    Base NDArrayFactory class. Allows specification or data type and row (c) or column(fortran) major order
    • Method Detail

      • setOrder

        public void setOrder(char order)
        Sets the order. Primarily for testing purposes
        Specified by:
        setOrder in interface NDArrayFactory
        Parameters:
        order -
      • setDType

        public void setDType(java.lang.String dtype)
        Sets the data type
        Specified by:
        setDType in interface NDArrayFactory
        Parameters:
        dtype -
      • order

        public char order()
        Returns the order for this ndarray for internal data storage
        Specified by:
        order in interface NDArrayFactory
        Returns:
        the order (c or f)
      • dtype

        public java.lang.String dtype()
        Returns the data type for this ndarray
        Specified by:
        dtype in interface NDArrayFactory
        Returns:
        the data type for this ndarray
      • linspace

        public INDArray linspace(int lower,
                                 int upper,
                                 int num)
        Generate a linearly spaced vector
        Specified by:
        linspace in interface NDArrayFactory
        Parameters:
        lower - upper bound
        upper - lower bound
        num - the step size
        Returns:
        the linearly spaced vector
      • toFlattened

        public INDArray toFlattened(java.util.Collection<INDArray> matrices)
        Returns a vector with all of the elements in every nd array equal to the sum of the lengths of the ndarrays
        Specified by:
        toFlattened in interface NDArrayFactory
        Parameters:
        matrices - the ndarrays to getFloat a flattened representation of
        Returns:
        the flattened ndarray
      • toFlattened

        public INDArray toFlattened(int length,
                                    java.util.Iterator<? extends INDArray>... matrices)
        Description copied from interface: NDArrayFactory
        Returns a flattened ndarray with all of the elements in each ndarray regardless of dimension
        Specified by:
        toFlattened in interface NDArrayFactory
        matrices - the ndarrays to use
        Returns:
        a flattened ndarray of the elements in the order of titerating over the ndarray and the linear view of each
      • eye

        public INDArray eye(int n)
        Create the identity ndarray
        Specified by:
        eye in interface NDArrayFactory
        Parameters:
        n - the number for the identity
        Returns:
      • rot90

        public void rot90(INDArray toRotate)
        Rotate a matrix 90 degrees
        Specified by:
        rot90 in interface NDArrayFactory
        Parameters:
        toRotate - the matrix to rotate
      • rot

        public INDArray rot(INDArray reverse)
        Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
        Specified by:
        rot in interface NDArrayFactory
        Parameters:
        reverse - the matrix to reverse
        Returns:
        the reversed matrix
      • reverse

        public INDArray reverse(INDArray reverse)
        Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc
        Specified by:
        reverse in interface NDArrayFactory
        Parameters:
        reverse - the matrix to reverse
        Returns:
        the reversed matrix
      • arange

        public INDArray arange(double begin,
                               double end)
        Array of evenly spaced values.
        Specified by:
        arange in interface NDArrayFactory
        Parameters:
        begin - the begin of the range
        end - the end of the range
        Returns:
        the range vector
      • createFloat

        public abstract IComplexFloat createFloat(float real,
                                                  float imag)
        Create float
        Specified by:
        createFloat in interface NDArrayFactory
        Parameters:
        real - real component
        imag - imag component
        Returns:
      • createDouble

        public abstract IComplexDouble createDouble(double real,
                                                    double imag)
        Create an instance of a complex double
        Specified by:
        createDouble in interface NDArrayFactory
        Parameters:
        real - the real component
        imag - the imaginary component
        Returns:
        a new imaginary double with the specified real and imaginary components
      • copy

        public void copy(INDArray a,
                         INDArray b)
        Copy a to b
        Specified by:
        copy in interface NDArrayFactory
        Parameters:
        a - the origin matrix
        b - the destination matrix
      • rand

        public INDArray rand(int[] shape,
                             float min,
                             float max,
                             RandomGenerator rng)
        Generates a random matrix between min and max
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        shape - the number of rows of the matrix
        min - the minimum number
        max - the maximum number
        rng - the rng to use
        Returns:
        a random matrix of the specified shape and range
      • rand

        public INDArray rand(int rows,
                             int columns,
                             float min,
                             float max,
                             RandomGenerator rng)
        Generates a random matrix between min and max
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        rows - the number of rows of the matrix
        columns - the number of columns in the matrix
        min - the minimum number
        max - the maximum number
        rng - the rng to use
        Returns:
        a random matrix of the specified shape and range
      • appendBias

        public INDArray appendBias(INDArray... vectors)
        Merge the vectors and append a bias. Each vector must be either row or column vectors. An exception is thrown for inconsistency (mixed row and column vectors)
        Specified by:
        appendBias in interface NDArrayFactory
        Parameters:
        vectors - the vectors to merge
        Returns:
        the merged ndarray appended with the bias
      • createComplex

        public abstract IComplexNDArray createComplex(INDArray arr)
        Create a complex ndarray from the passed in indarray
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        arr - the arr to wrap
        Returns:
        the complex ndarray with the specified ndarray as the real components
      • createComplex

        public abstract IComplexNDArray createComplex(IComplexNumber[] data,
                                                      int[] shape)
        Create a complex ndarray from the passed in indarray
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to wrap
        Returns:
        the complex ndarray with the specified ndarray as the real components
      • createComplex

        public abstract IComplexNDArray createComplex(java.util.List<IComplexNDArray> arrs,
                                                      int[] shape)
        Create a complex ndarray from the passed in indarray
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        arrs - the arr to wrap
        Returns:
        the complex ndarray with the specified ndarray as the real components
      • rand

        public INDArray rand(int rows,
                             int columns,
                             RandomGenerator r)
        Create a random ndarray with the given shape using the given rng
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        public INDArray rand(int rows,
                             int columns,
                             long seed)
        Create a random ndarray with the given shape using the given rng
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        seed - the seed to use
        Returns:
        the random ndarray with the specified shape
      • rand

        public INDArray rand(int rows,
                             int columns)
        Create a random ndarray with the given shape using the current time as the seed
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
        the random ndarray with the specified shape
      • randn

        public INDArray randn(int rows,
                              int columns,
                              RandomGenerator r)
        Random normal using the given rng
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        r - the random generator to use
        Returns:
      • randn

        public INDArray randn(int rows,
                              int columns)
        Random normal using the current time stamp as the seed
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
      • randn

        public INDArray randn(int rows,
                              int columns,
                              long seed)
        Random normal using the specified seed
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the matrix
        Returns:
      • rand

        public INDArray rand(int[] shape,
                             RealDistribution r)
        Create a random ndarray with the given shape using the given rng
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        public INDArray rand(int[] shape,
                             RandomGenerator r)
        Create a random ndarray with the given shape using the given rng
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
        Returns:
        the random ndarray with the specified shape
      • rand

        public INDArray rand(int[] shape,
                             long seed)
        Create a random ndarray with the given shape using the given rng
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        seed - the seed to use
        Returns:
        the random ndarray with the specified shape
      • rand

        public INDArray rand(int[] shape)
        Create a random ndarray with the given shape using the current time as the seed
        Specified by:
        rand in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the random ndarray with the specified shape
      • randn

        public INDArray randn(int[] shape,
                              RandomGenerator r)
        Random normal using the given rng
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        r - the random generator to use
        Returns:
      • randn

        public INDArray randn(int[] shape)
        Random normal using the current time stamp as the seed
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
      • randn

        public INDArray randn(int[] shape,
                              long seed)
        Random normal using the specified seed
        Specified by:
        randn in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
      • create

        public INDArray create(double[] data)
        Creates a row vector with the data
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the columns of the ndarray
        Returns:
        the created ndarray
      • create

        public INDArray create(float[] data)
        Creates a row vector with the data
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the columns of the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(double[] data)
        Creates an ndarray with the specified data
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the number of columns in the row vector
        Returns:
        ndarray
      • create

        public INDArray create(int columns)
        Creates a row vector with the specified number of columns
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(int columns)
        Creates an ndarray
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        columns - the number of columns in the row vector
        Returns:
        ndarray
      • zeros

        public INDArray zeros(int rows,
                              int columns)
        Creates a row vector with the specified number of columns
        Specified by:
        zeros in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • complexZeros

        public IComplexNDArray complexZeros(int rows,
                                            int columns)
        Creates a matrix of zeros
        Specified by:
        complexZeros in interface NDArrayFactory
        Parameters:
        rows - te number of rows in the matrix
        columns - the number of columns in the row vector
        Returns:
        ndarray
      • zeros

        public INDArray zeros(int columns)
        Creates a row vector with the specified number of columns
        Specified by:
        zeros in interface NDArrayFactory
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • complexZeros

        public IComplexNDArray complexZeros(int columns)
        Creates an ndarray
        Specified by:
        complexZeros in interface NDArrayFactory
        Parameters:
        columns - the number of columns in the row vector
        Returns:
        ndarray
      • complexValueOf

        public IComplexNDArray complexValueOf(int[] shape,
                                              IComplexNumber value)
        Creates an shape ndarray with the specified value
        Specified by:
        complexValueOf in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        value - the value to assign
        Returns:
        a complex ndarray of the specified size and value
      • complexValueOf

        public IComplexNDArray complexValueOf(int num,
                                              double value)
        Creates an 1 x num ndarray with the specified value
        Specified by:
        complexValueOf in interface NDArrayFactory
        Parameters:
        num - the number of columns
        value - the value to assign
        Returns:
        a complex ndarray of the specified size and value
      • complexValueOf

        public IComplexNDArray complexValueOf(int[] shape,
                                              double value)
        Creates an shape ndarray with the specified value
        Specified by:
        complexValueOf in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        value - the value to assign
        Returns:
        a complex ndarray of the specified size and value
      • complexValueOf

        public IComplexNDArray complexValueOf(int num,
                                              IComplexNumber value)
        Creates an 1 x num ndarray with the specified value
        Specified by:
        complexValueOf in interface NDArrayFactory
        Parameters:
        num - the number of columns
        value - the value to assign
        Returns:
        a complex ndarray of the specified size and value
      • valueArrayOf

        public INDArray valueArrayOf(int[] shape,
                                     double value)
        Creates an ndarray with the specified value as the only value in the ndarray
        Specified by:
        valueArrayOf in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        value - the value to assign
        Returns:
        the created ndarray
      • valueArrayOf

        public INDArray valueArrayOf(int rows,
                                     int columns,
                                     double value)
        Creates a row vector with the specified number of columns
        Specified by:
        valueArrayOf in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        value - the value to assign
        Returns:
        the created ndarray
      • ones

        public INDArray ones(int rows,
                             int columns)
        Creates a row vector with the specified number of columns
        Specified by:
        ones in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • complexOnes

        public INDArray complexOnes(int rows,
                                    int columns)
        Creates an ndarray
        Specified by:
        complexOnes in interface NDArrayFactory
        Parameters:
        rows - the number of rows in the matrix
        columns - the number of columns in the row vector
        Returns:
        ndarray
      • ones

        public INDArray ones(int columns)
        Creates a row vector with the specified number of columns
        Specified by:
        ones in interface NDArrayFactory
        Parameters:
        columns - the columns of the ndarray
        Returns:
        the created ndarray
      • complexOnes

        public IComplexNDArray complexOnes(int columns)
        Creates an ndarray
        Specified by:
        complexOnes in interface NDArrayFactory
        Parameters:
        columns - the number of columns in the row vector
        Returns:
        ndarray
      • concat

        public INDArray concat(int dimension,
                               INDArray... toConcat)
        concatenate ndarrays along a dimension
        Specified by:
        concat in interface NDArrayFactory
        Parameters:
        dimension - the dimension to concatenate along
        toConcat - the ndarrays to concatenate
        Returns:
        the concatenate ndarrays
      • concat

        public IComplexNDArray concat(int dimension,
                                      IComplexNDArray... toConcat)
        concatenate ndarrays along a dimension
        Specified by:
        concat in interface NDArrayFactory
        Parameters:
        dimension - the dimension to concatenate along
        toConcat - the ndarrays to concatenate
        Returns:
        the concatenate ndarrays
      • hstack

        public INDArray hstack(INDArray... arrs)
        Concatenates two matrices horizontally. Matrices must have identical numbers of rows.
        Specified by:
        hstack in interface NDArrayFactory
        Parameters:
        arrs -
      • vstack

        public INDArray vstack(INDArray... arrs)
        Concatenates two matrices vertically. Matrices must have identical numbers of columns.
        Specified by:
        vstack in interface NDArrayFactory
        Parameters:
        arrs -
      • zeros

        public INDArray zeros(int[] shape)
        Create an ndarray of zeros
        Specified by:
        zeros in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • complexZeros

        public IComplexNDArray complexZeros(int[] shape)
        Create an ndarray of ones
        Specified by:
        complexZeros in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • ones

        public INDArray ones(int[] shape)
        Create an ndarray of ones
        Specified by:
        ones in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • complexOnes

        public IComplexNDArray complexOnes(int[] shape)
        Create an ndarray of ones
        Specified by:
        complexOnes in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        an ndarray with ones filled in
      • createComplex

        public IComplexNDArray createComplex(float[] data,
                                             int rows,
                                             int columns,
                                             int[] stride,
                                             int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with the ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(float[] data,
                               int rows,
                               int columns,
                               int[] stride,
                               int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the data to use with the ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • createComplex

        public abstract IComplexNDArray createComplex(float[] data,
                                                      int[] shape,
                                                      int[] stride,
                                                      int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with the ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public abstract INDArray create(float[] data,
                                        int[] shape,
                                        int[] stride,
                                        int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(double[] data,
                               int[] shape)
        Create an ndrray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • create

        public INDArray create(float[] data,
                               int[] shape)
        Create an ndrray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(double[] data,
                                             int[] shape)
        Create an ndrray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(float[] data,
                                             int[] shape)
        Create an ndrray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(double[] data,
                                             int[] shape,
                                             int[] stride)
        Create an ndrray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(float[] data,
                                             int[] shape,
                                             int[] stride)
        Create an ndrray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        Returns:
        the created ndarray
      • createComplex

        public IComplexNDArray createComplex(double[] data,
                                             int rows,
                                             int columns,
                                             int[] stride,
                                             int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(double[] data,
                               int rows,
                               int columns,
                               int[] stride,
                               int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • createComplex

        public abstract IComplexNDArray createComplex(double[] data,
                                                      int[] shape,
                                                      int[] stride,
                                                      int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public abstract INDArray create(double[] data,
                                        int[] shape,
                                        int[] stride,
                                        int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public abstract INDArray create(java.util.List<INDArray> list,
                                        int[] shape)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int rows,
                                             int columns,
                                             int[] stride,
                                             int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int rows,
                               int columns,
                               int[] stride,
                               int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int[] shape,
                                             int[] stride,
                                             int offset)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int[] shape,
                               int[] stride,
                               int offset)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int rows,
                                             int columns,
                                             int[] stride)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int rows,
                               int columns,
                               int[] stride)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int[] shape,
                                             int[] stride)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int[] shape,
                               int[] stride)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int rows,
                                             int columns)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int rows,
                               int columns)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        rows - the rows of the ndarray
        columns - the columns of the ndarray
        Returns:
        the instance
      • createComplex

        public IComplexNDArray createComplex(int[] shape)
        Creates a complex ndarray with the specified shape
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the instance
      • create

        public INDArray create(int[] shape)
        Creates an ndarray with the specified shape
        Specified by:
        create in interface NDArrayFactory
        Parameters:
        shape - the shape of the ndarray
        Returns:
        the instance
      • scalar

        public INDArray scalar(java.lang.Number value,
                               int offset)
        Create a scalar ndarray with the specified offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        offset - the offset of the ndarray
        Returns:
        the created ndarray
      • complexScalar

        public IComplexNDArray complexScalar(java.lang.Number value,
                                             int offset)
        Create a scalar ndarray with the specified offset
        Specified by:
        complexScalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        offset - the offset of the ndarray
        Returns:
        the created ndarray
      • complexScalar

        public IComplexNDArray complexScalar(java.lang.Number value)
        Create a scalar ndarray with the specified offset
        Specified by:
        complexScalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        Returns:
        the created ndarray
      • scalar

        public INDArray scalar(float value,
                               int offset)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • scalar

        public INDArray scalar(double value,
                               int offset)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • scalar

        public INDArray scalar(java.lang.Number value)
        Create a scalar ndarray with the specified offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        Returns:
        the created ndarray
      • scalar

        public INDArray scalar(float value)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar = * @return the scalar nd array
      • scalar

        public INDArray scalar(double value)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        Returns:
        the scalar nd array
      • scalar

        public IComplexNDArray scalar(IComplexNumber value,
                                      int offset)
        Create a scalar ndarray with the specified offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        offset - the offset of the ndarray
        Returns:
        the created ndarray
      • scalar

        public IComplexNDArray scalar(IComplexFloat value)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        Returns:
        the scalar nd array
      • scalar

        public IComplexNDArray scalar(IComplexDouble value)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        Returns:
        the scalar nd array
      • scalar

        public IComplexNDArray scalar(IComplexNumber value)
        Create a scalar ndarray with the specified offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value to initialize the scalar with
        Returns:
        the created ndarray
      • scalar

        public IComplexNDArray scalar(IComplexFloat value,
                                      int offset)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • scalar

        public IComplexNDArray scalar(IComplexDouble value,
                                      int offset)
        Create a scalar nd array with the specified value and offset
        Specified by:
        scalar in interface NDArrayFactory
        Parameters:
        value - the value of the scalar
        offset - the offset of the ndarray
        Returns:
        the scalar nd array
      • createComplex

        public abstract IComplexNDArray createComplex(double[] data,
                                                      int[] shape,
                                                      int[] stride,
                                                      int offset,
                                                      char ordering)
        Create a complex ndarray with the given data
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data - the data to use with tne ndarray
        shape - the shape of the ndarray
        stride - the stride for the ndarray
        offset - the offset of the ndarray
        ordering - the ordering for the ndarray
        Returns:
        the created complex ndarray
      • createComplex

        public IComplexNDArray createComplex(double[] data,
                                             int[] shape,
                                             int offset,
                                             char ordering)
        Specified by:
        createComplex in interface NDArrayFactory
        Parameters:
        data -
        shape -
        offset -
        ordering -
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.