Search in sources :

Example 71 with IComplexNDArray

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

the class BooleanIndexing method and.

/**
 * And
 *
 * @param n
 * @param cond
 * @return
 */
public static boolean and(IComplexNDArray n, Condition cond) {
    boolean ret = true;
    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 72 with IComplexNDArray

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

the class Nd4j method createComplex.

/**
 * @param data
 * @param shape
 * @param offset
 * @param ordering
 * @return
 */
public static IComplexNDArray createComplex(DataBuffer data, int[] shape, long offset, char ordering) {
    shape = getEnsuredShape(shape);
    checkShapeValues(shape);
    IComplexNDArray ret = INSTANCE.createComplex(data, shape, offset, ordering);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 73 with IComplexNDArray

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

the class Nd4j method createComplex.

/**
 * @param data
 * @param shape
 * @param offset
 * @param ordering
 * @return
 */
public static IComplexNDArray createComplex(double[] data, int[] shape, long offset, char ordering) {
    shape = getEnsuredShape(shape);
    checkShapeValues(shape);
    IComplexNDArray ret = INSTANCE.createComplex(data, shape, offset, ordering);
    logCreationIfNecessary(ret);
    return ret;
}
Also used : IComplexNDArray(org.nd4j.linalg.api.complex.IComplexNDArray)

Example 74 with IComplexNDArray

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

the class Nd4j method createComplex.

/**
 * @param data
 * @param shape
 * @param newStrides
 * @param offset
 * @return
 */
public static IComplexNDArray createComplex(DataBuffer data, int[] shape, int[] newStrides, long offset) {
    shape = getEnsuredShape(shape);
    checkShapeValues(shape);
    IComplexNDArray ret = INSTANCE.createComplex(data, shape, newStrides, offset);
    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