|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.sphinx.util.Complex
public class Complex
Implements complex types and arythmetics
| Constructor Summary | |
|---|---|
Complex()
Create a default complex number |
|
Complex(double real)
Create a complex number from a real one |
|
Complex(double real,
double imaginary)
Create a complex number from the real and imaginary parts |
|
| Method Summary | |
|---|---|
void |
addComplex(Complex a,
Complex b)
Method to add two complex numbers. |
void |
divideComplex(Complex a,
Complex b)
Method to divide two complex numbers. |
double |
getImaginary()
Returns the imaginary part of this Complex number. |
double |
getReal()
Returns the real part of this Complex number. |
void |
multiplyComplex(Complex a,
Complex b)
Method to multiply two complex numbers. |
void |
reset()
Sets both the real and imaginary parts of this complex number to zero. |
void |
scaleComplex(Complex a,
double b)
Method to scale a complex number by a real one. |
void |
set(double real,
double imaginary)
Sets the real and imaginary parts of this complex number. |
double |
squaredMagnitudeComplex()
Method to compute the squared magnitude of a complex number. |
void |
subtractComplex(Complex a,
Complex b)
Method to subtract two complex numbers. |
java.lang.String |
toString()
Returns this complex number as a string in the format (real, imaginary). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Complex()
public Complex(double real)
public Complex(double real,
double imaginary)
| Method Detail |
|---|
public double getReal()
public double getImaginary()
public void reset()
public void set(double real,
double imaginary)
real - the value of the real partimaginary - the value of the imaginary part
public void addComplex(Complex a,
Complex b)
a - the first element to be addedb - the second element to be added
public void subtractComplex(Complex a,
Complex b)
a - the element we subtract fromb - the element to be subtracted
public void multiplyComplex(Complex a,
Complex b)
a - the first element to multiplyb - the second element to multiply
public void divideComplex(Complex a,
Complex b)
a - the numeratorb - the denominator
public void scaleComplex(Complex a,
double b)
a - the complex numberb - the real scaling factorpublic double squaredMagnitudeComplex()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||