All Packages Class Hierarchy This Package Previous Next Index
Class Jampack.Z
java.lang.Object
|
+----Jampack.Z
- public class Z
- extends Object
Z is a mutable complex variable class. It is designed to
perform complex arithmetic without creating a new Z at
each operation. Specifically, binary operations have the
form c.op(a,b), in which a, b, and c need not be different.
The method places the complex number a.op.b in
c. The method also returns a pointer to c. Thus the
class supports two styles of programming. For example
to compute e = a*b + c*d you can write
z1.Times(a,b)
z2.Times(c,d)
e.Plus(z1,z2)
or
e.Plus(z1.Times(a,b), z2.Times(a,b))
Since objects of class Z are mutable, the use of the assignment
operator "=" with these objects is deprecated. Use Eq.
The functions are reasonably resistent to overflow and underflow.
But the more complicated ones could almost certainly be improved.
-
I
- Imaginary unit.
-
im
- The imaginary part of Z.
-
ONE
- Complex 1.
-
re
- The real part of Z.
-
ZERO
- Complex 0.
-
Z()
- Creates a Z and initializes it to zero.
-
Z(double)
- Creates a Z and initializes its real part.
-
Z(double, double)
- Creates a Z and initializes its real and imaginary parts.
-
Z(Z)
- Creates a Z and initializes it to another Z.
-
abs(Z)
- Computes the absolute value of a Z.
-
abs1(Z)
- Computes the 1-norm of a Z
-
Conj(Z)
- Computes the conjugate of a Z.
-
Div(Z, double)
- Computes the quotient of a Z and a double.
-
Div(Z, Z)
- Computes the quotient of two Z's.
-
Eq(double, double)
- Resets the real and imaginary parts of a Z.
-
Eq(Z)
- Resets the real and imaginary parts of a Z to those of another Z.
-
Exch(Z)
- Interchanges the real and imaginary parts of two Z's.
-
IsEqual(Z, Z)
- Tests two Z'z for equality.
-
Minus(Z)
- Computes unary minus of a Z.
-
Minus(Z, Z)
- Computes the difference of two Z's.
-
Plus(Z, Z)
- Computes the sum of two Z's.
-
Sqrt(Z)
- Computes the principal value of the square root of a Z.
-
Times(double, Z)
- Computes the product of a double and a Z.
-
Times(Z, Z)
- Computes the product of two Z's.
ONE
public static final Z ONE
- Complex 1.
ZERO
public static final Z ZERO
- Complex 0.
I
public static final Z I
- Imaginary unit.
re
public double re
- The real part of Z.
im
public double im
- The imaginary part of Z.
Z
public Z()
- Creates a Z and initializes it to zero.
- Returns:
- a Z initialized to zero.
Z
public Z(double x,
double y)
- Creates a Z and initializes its real and imaginary parts.
- Parameters:
- x - a double
- y - a double
- Returns:
- x + iy
Z
public Z(double x)
- Creates a Z and initializes its real part.
- Parameters:
- x - a double
- Returns:
- x + i*0
Z
public Z(Z a)
- Creates a Z and initializes it to another Z.
- Parameters:
- a - a Z
- Returns:
- a
IsEqual
public boolean IsEqual(Z z1,
Z z2)
- Tests two Z'z for equality.
- Parameters:
- z1 - a Z
- z2 - a Z
- Returns:
- true if z1=z2, otherwise false
Eq
public Z Eq(Z a)
- Resets the real and imaginary parts of a Z to those of another Z.
- Parameters:
- a - a Z
- Returns:
- this = a;
Eq
public Z Eq(double a,
double b)
- Resets the real and imaginary parts of a Z.
- Parameters:
- a - a double
- b - a double
- Returns:
- this = a + ib
Exch
public Z Exch(Z a)
- Interchanges the real and imaginary parts of two Z's.
- Parameters:
- a - a Z
- Returns:
- this = a, with a set to the original
value of this.
abs1
public static double abs1(Z z)
- Computes the 1-norm of a Z
abs
public static double abs(Z z)
- Computes the absolute value of a Z.
- Parameters:
- z - a Z
- Returns:
- the absolute vaue of Z
Conj
public Z Conj(Z a)
- Computes the conjugate of a Z.
- Parameters:
- a - a Z
- Returns:
- this = conj(a);
Minus
public Z Minus(Z a)
- Computes unary minus of a Z.
- Parameters:
- a - a Z
- Returns:
- this = -a;
Plus
public Z Plus(Z a,
Z b)
- Computes the sum of two Z's.
- Parameters:
- a - a Z
- b - a Z
- Returns:
- this = a + b
Minus
public Z Minus(Z a,
Z b)
- Computes the difference of two Z's.
- Parameters:
- a - a Z
- b - a Z
- Returns:
- this = a - b
Times
public Z Times(Z a,
Z b)
- Computes the product of two Z's.
- Parameters:
- a - a Z
- b - a Z
- Returns:
- this = ab
Times
public Z Times(double a,
Z b)
- Computes the product of a double and a Z.
- Parameters:
- a - a double
- b - a Z
- Returns:
- this = ab
Div
public Z Div(Z a,
Z b) throws JampackException
- Computes the quotient of two Z's. Throws a JampackException if
the denominator is zero.
- Parameters:
- a - a Z
- b - a Z
- Returns:
- this = a/b
- Throws: JampackException
- Thrown if b is zero.
Div
public Z Div(Z a,
double b) throws JampackException
- Computes the quotient of a Z and a double. Throws a JampackException
if the denominator is zero.
- Parameters:
- a - a Z
- b - a double
- Returns:
- this = a/b
- Throws: JampackException
- Thrown if b is zero.
Sqrt
public Z Sqrt(Z a)
- Computes the principal value of the square root of a Z.
- Parameters:
- a - a Z
- this - = sqrt(a)
All Packages Class Hierarchy This Package Previous Next Index