Class ComplexMatrix
java.lang.Object
|
+--ComplexMatrix
- class ComplexMatrix
- extends java.lang.Object
Represents a 2x2 matrix of complex numbers. The implementation is such
that instances of ComplexMatrix are immutable; operations
should be combined through composition and cascading of method
invokations.
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
a
protected Complex a
b
protected Complex b
c
protected Complex c
d
protected Complex d
IDENTITY
public static final ComplexMatrix IDENTITY
ComplexMatrix
public ComplexMatrix(Complex a,
Complex b,
Complex c,
Complex d)
- Creates a new complex matrix. Entries are as pictured:
/ a b \
\ c d /
ComplexMatrix
public ComplexMatrix(double a,
double b,
double c,
double d)
- Creates a real-valued complex matrix. Entries are as pictured:
/ a b \
\ c d /
ComplexMatrix
public ComplexMatrix()
- Creates a new identity matrix
multiply
public ComplexMatrix multiply(ComplexMatrix m)
- Computes the product of two matrices. The product M = ABC should be
coded as
M = A.multiply(B.multiply(C)) or
M = A.multiply(B).multiply(C); these are equivalent due
to associativity.
- Returns:
- this*m
multiply
public ComplexMatrix multiply(double v)
- Scales all entries in this matric by a real number
- Parameters:
v - The scaling factor- Returns:
- The scaled matrix
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
- Returns:
- A string representation of this matrix, of the form
(a,b,c,d)