Search in sources :

Example 46 with IComplexNDArray

use of org.nd4j.linalg.api.complex.IComplexNDArray in project nd4j by deeplearning4j.

the class Nd4j method createComplex.

/**
 * Creates a complex ndarray with the specified shape
 *
 * @param shape  the shape of the ndarray
 * @param stride the stride for the ndarray
 * @param offset the offset of the ndarray
 * @return the instance
 */
public static IComplexNDArray createComplex(int[] shape, int[] stride, long offset, char ordering) {
    checkShapeValues(shape);
    IComplexNDArray ret = INSTANCE.createComplex(shape, stride, offset, ordering);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 47 with IComplexNDArray

use of org.nd4j.linalg.api.complex.IComplexNDArray in project nd4j by deeplearning4j.

the class Nd4j method complexValueOf.

/**
 * @param num
 * @param value
 * @return
 */
public static IComplexNDArray complexValueOf(int num, IComplexNumber value) {
    IComplexNDArray ret = INSTANCE.complexValueOf(num, value);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 48 with IComplexNDArray

use of org.nd4j.linalg.api.complex.IComplexNDArray in project nd4j by deeplearning4j.

the class Nd4j method repeat.

/**
 * Create an n x (shape)
 * ndarray where the ndarray is repeated num times
 *
 * @param n   the ndarray to replicate
 * @param num the number of copies to repeat
 * @return the repeated ndarray
 */
public static IComplexNDArray repeat(IComplexNDArray n, int num) {
    List<IComplexNDArray> list = new ArrayList<>();
    for (int i = 0; i < num; i++) list.add(n.dup());
    IComplexNDArray ret = Nd4j.createComplex(list, Ints.concat(new int[] { num }, n.shape()));
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 49 with IComplexNDArray

use of org.nd4j.linalg.api.complex.IComplexNDArray in project nd4j by deeplearning4j.

the class Nd4j method concat.

/**
 * Concatneate ndarrays along a dimension
 *
 * @param dimension the dimension to concatneate along
 * @param toConcat  the ndarrays to concat
 * @return the concatted ndarrays with an output shape of
 * the ndarray shapes save the dimension shape specified
 * which is then the sum of the sizes along that dimension
 */
public static IComplexNDArray concat(int dimension, IComplexNDArray... toConcat) {
    IComplexNDArray ret = INSTANCE.concat(dimension, toConcat);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 50 with IComplexNDArray

use of org.nd4j.linalg.api.complex.IComplexNDArray in project nd4j by deeplearning4j.

the class Nd4j method complexScalar.

/**
 * Create a scalar ndarray with the specified offset
 *
 * @param value  the value to initialize the scalar with
 * @param offset the offset of the ndarray
 * @return the created ndarray
 */
public static IComplexNDArray complexScalar(Number value, long offset) {
    IComplexNDArray arr = INSTANCE.complexScalar(value, offset);
    logCreationIfNecessary(arr);
    return arr;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Aggregations

IComplexNDArray (org.nd4j.linalg.api.complex.IComplexNDArray)74 ND4JIllegalStateException (org.nd4j.linalg.exception.ND4JIllegalStateException)6 INDArray (org.nd4j.linalg.api.ndarray.INDArray)5 IComplexNumber (org.nd4j.linalg.api.complex.IComplexNumber)3 DecimalFormat (java.text.DecimalFormat)2 INDArrayIndex (org.nd4j.linalg.indexing.INDArrayIndex)2 AllocationPoint (org.nd4j.jita.allocator.impl.AllocationPoint)1 DataBuffer (org.nd4j.linalg.api.buffer.DataBuffer)1 IComplexDouble (org.nd4j.linalg.api.complex.IComplexDouble)1