Search in sources :

Example 6 with IComplexNDArray

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

the class BooleanIndexing method or.

/**
 * Or over the whole ndarray given some condition
 *
 * @param n
 * @param cond
 * @return
 */
public static boolean or(IComplexNDArray n, Condition cond) {
    boolean ret = false;
    IComplexNDArray linear = n.linearView();
    for (int i = 0; i < linear.length(); i++) {
        ret = ret || cond.apply(linear.getComplex(i));
    }
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 7 with IComplexNDArray

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

the class Nd4j method scalar.

/**
 * Create a scalar nd array with the specified value and offset
 *
 * @param value  the value of the scalar
 * @param offset the offset of the ndarray
 * @return the scalar nd array
 */
public static IComplexNDArray scalar(IComplexFloat value, long offset) {
    IComplexNDArray ret = INSTANCE.scalar(value, offset);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 8 with IComplexNDArray

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

the class Nd4j method createComplex.

/**
 * Creates an ndarray
 *
 * @param columns the number of columns in the row vector
 * @return ndarray
 */
public static IComplexNDArray createComplex(int columns, char order) {
    int[] shape = new int[] { 1, columns };
    IComplexNDArray ret = INSTANCE.createComplex(new int[] { 1, columns }, Nd4j.getComplexStrides(shape, order), 0, order);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 9 with IComplexNDArray

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

the class Nd4j method complexValueOf.

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

Example 10 with IComplexNDArray

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

the class Nd4j method createComplex.

private static IComplexNDArray createComplex(float[] data, char order) {
    IComplexNDArray ret = INSTANCE.createComplex(data, order);
    logCreationIfNecessary(ret);
    return ret;
}
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