List of usage examples for org.apache.commons.math3.complex Complex isNaN
boolean isNaN
To view the source code for org.apache.commons.math3.complex Complex isNaN.
Click Source Link
From source file:org.nd4j.linalg.util.ComplexUtil.java
/** * Raise a complex number to a power// w ww. ja v a 2s . com * * @param num the number to raise * @param power the power to raise to * @return the number raised to a power */ public static IComplexNumber pow(IComplexNumber num, IComplexNumber power) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()) .pow(new Complex(power.realComponent().doubleValue(), power.imaginaryComponent().doubleValue())); if (c.isNaN()) c = new Complex(Nd4j.EPS_THRESHOLD, 0.0); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
From source file:org.nd4j.linalg.util.ComplexUtil.java
/** * Raise a complex number to a power/*from ww w . j a va2 s. c om*/ * * @param num the number to raise * @param power the power to raise to * @return the number raised to a power */ public static IComplexNumber pow(IComplexNumber num, double power) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()) .pow(power); if (c.isNaN()) c = new Complex(Nd4j.EPS_THRESHOLD, 0.0); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }