@Test public void testArray() { System.out.println("Complex.Array"); Complex.Array array = Complex.Array.of(a, b); System.out.println("a = " + a); System.out.println("b = " + b); assertEquals(a.re, array.get(0).re, 1E-15); assertEquals(a.im, array.get(0).im, 1E-15); assertEquals(b.re, array.get(1).re, 1E-15); assertEquals(b.im, array.get(1).im, 1E-15); Complex c = Complex.of(3.0); array.set(1, c); assertEquals(a.re, array.get(0).re, 1E-15); assertEquals(a.im, array.get(0).im, 1E-15); assertEquals(c.re, array.get(1).re, 1E-15); assertEquals(c.im, array.get(1).im, 1E-15); }
public static Complex of(double real) { return new Complex(real, 0.0); }
Complex implements Serializable { public static Complex of(double real) { return new Complex(real, 0.0); } }
Complex implements Serializable { public static Complex of(double real) { return new Complex(real, 0.0); } Complex(double real, double imag); }
Complex implements Serializable { public static Complex of(double real) { return new Complex(real, 0.0); } Complex(double real, double imag); static Complex of(double real); static Complex of(double real, double imag); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); Complex add(Complex b); Complex sub(Complex b); Complex mul(Complex b); Complex scale(double b); Complex div(Complex b); double abs(); double phase(); Complex conjugate(); Complex reciprocal(); Complex exp(); Complex sin(); Complex cos(); Complex tan(); }
Complex implements Serializable { public static Complex of(double real) { return new Complex(real, 0.0); } Complex(double real, double imag); static Complex of(double real); static Complex of(double real, double imag); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); Complex add(Complex b); Complex sub(Complex b); Complex mul(Complex b); Complex scale(double b); Complex div(Complex b); double abs(); double phase(); Complex conjugate(); Complex reciprocal(); Complex exp(); Complex sin(); Complex cos(); Complex tan(); final double re; final double im; }