@Override public IComplexNDArray rdivi(Number n, INDArray result) { return rdivi(Nd4j.createDouble(n.doubleValue(), 0), result); }
@Override public IComplexNDArray divi(Number n, INDArray result) { return divi(Nd4j.createDouble(n.doubleValue(), 0), result); }
@Override public IComplexNDArray muli(Number n, INDArray result) { return muli(Nd4j.createDouble(n.doubleValue(), 0), result); }
@Override public IComplexNDArray addi(Number n, INDArray result) { return addi(Nd4j.createDouble(n.doubleValue(), 0), result); }
/** * Set the value of the ndarray to the specified value * * @param value the value to assign * @return the ndarray with the values */ @Override public IComplexNDArray assign(Number value) { IComplexNDArray one = linearView(); for (int i = 0; i < one.length(); i++) one.putScalar(i, Nd4j.createDouble(value.doubleValue(), 0)); return this; }
/** * Return the absolute value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber abs(IComplexNumber num) { double c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).abs(); return Nd4j.createDouble(c, 0); }
/** * Return the sin value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber asin(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).asin(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the cos of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber cos(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).cos(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber tanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the sin value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber sin(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).sin(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the log value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber log(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).log(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the log value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber neg(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).negate(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the sin value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber atan(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).atan(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the sin value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber acos(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).acos(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the absolute value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber sqrt(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).sqrt(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the ceiling value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber ceil(IComplexNumber num) { Complex c = new Complex(FastMath.ceil(num.realComponent().doubleValue()), FastMath.ceil(num.imaginaryComponent().doubleValue())); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the floor value of the given complex number * * @param num the number to getScalar the absolute value for * @return the absolute value of this complex number */ public static IComplexNumber floor(IComplexNumber num) { Complex c = new Complex(FastMath.floor(num.realComponent().doubleValue()), FastMath.floor(num.imaginaryComponent().doubleValue())); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber hardTanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); if (c.getReal() < -1.0) c = new Complex(-1.0, c.getImaginary()); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Compute complex conj (in-place). */ @Override public IComplexNDArray conji() { IComplexNDArray reshaped = linearView(); IComplexDouble c = Nd4j.createDouble(0.0, 0); for (int i = 0; i < length(); i++) { IComplexNumber conj = reshaped.getComplex(i, c).conj(); reshaped.putScalar(i, conj); } return this; }
@Override public IComplexNDArray hermitian() { IComplexNDArray result = Nd4j.createComplex(shape()); IComplexDouble c = Nd4j.createDouble(0, 0); for (int i = 0; i < slices(); i++) for (int j = 0; j < columns(); j++) result.putScalar(j, i, getComplex(i, j, c).conji()); return result; }