gnu.math
Class DComplex

java.lang.Object
  extended by java.lang.Number
      extended by gnu.math.Numeric
          extended by gnu.math.Quantity
              extended by gnu.math.Complex
                  extended by gnu.math.DComplex
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class DComplex
extends Complex
implements java.io.Externalizable

A complex number using rectangular (Cartesian) plain double values.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gnu.math.Numeric
CEILING, FLOOR, ROUND, TRUNCATE
 
Constructor Summary
DComplex()
           
DComplex(double real, double imag)
           
 
Method Summary
 Numeric add(java.lang.Object y, int k)
          Return this + k * obj.
static DComplex div(double x_re, double x_im, double y_re, double y_im)
          Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore.
 Numeric div(java.lang.Object y)
           
 double doubleImagValue()
          The value of the imaginary component, as a double.
 double doubleValue()
          The value of the real component, as a double.
 boolean equals(java.lang.Object obj)
           
static double hypot(double x, double y)
           
 RealNum im()
          The value of the imaginary component, as a RealNum.
static Complex log(double x_re, double x_im)
           
 Numeric mul(java.lang.Object y)
           
 Numeric neg()
           
static DComplex power(double x_re, double x_im, double y_re, double y_im)
           
 RealNum re()
          The value of the real component, as a RealNum.
 void readExternal(java.io.ObjectInput in)
           
static Complex sqrt(double x_re, double x_im)
           
 java.lang.String toString()
           
 java.lang.String toString(int radix)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.math.Complex
abs, add, addReversed, angle, compare, compare, divide, divReversed, doubleRealValue, equals, exp, imMinusOne, imOne, isExact, isZero, log, longValue, make, make, mulReversed, neg, number, polar, polar, power, sqrt, times
 
Methods inherited from class gnu.math.Quantity
add, compare, compareReversed, dimensions, divide, imValue, make, make, make, reValue, times, unit
 
Methods inherited from class gnu.math.Numeric
add, div_inv, floatValue, geq, grt, intValue, mul_ident, power, sub
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DComplex

public DComplex()

DComplex

public DComplex(double real,
                double imag)
Method Detail

re

public RealNum re()
Description copied from class: Quantity
The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component.

Overrides:
re in class Quantity

doubleValue

public double doubleValue()
Description copied from class: Quantity
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.

Overrides:
doubleValue in class Complex

im

public RealNum im()
Description copied from class: Quantity
The value of the imaginary component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true imaginary component.

Overrides:
im in class Quantity

doubleImagValue

public double doubleImagValue()
Description copied from class: Quantity
The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.

Overrides:
doubleImagValue in class Complex

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Complex

toString

public java.lang.String toString()
Overrides:
toString in class Numeric

toString

public java.lang.String toString(int radix)
Overrides:
toString in class Complex

neg

public final Numeric neg()
Overrides:
neg in class Complex

add

public Numeric add(java.lang.Object y,
                   int k)
Description copied from class: Numeric
Return this + k * obj.

Overrides:
add in class Complex

mul

public Numeric mul(java.lang.Object y)
Overrides:
mul in class Complex

div

public Numeric div(java.lang.Object y)
Overrides:
div in class Complex

power

public static DComplex power(double x_re,
                             double x_im,
                             double y_re,
                             double y_im)

log

public static Complex log(double x_re,
                          double x_im)

div

public static DComplex div(double x_re,
                           double x_im,
                           double y_re,
                           double y_im)
Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the names of AT&T Bell Laboratories or Bellcore or any of their entities not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. AT&T and Bellcore disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall AT&T or Bellcore be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.


sqrt

public static Complex sqrt(double x_re,
                           double x_im)

hypot

public static double hypot(double x,
                           double y)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException