vmm.pseudospherical
Class ComplexMatrix2D

java.lang.Object
  extended by vmm.pseudospherical.ComplexMatrix2D

public class ComplexMatrix2D
extends java.lang.Object

This class implements a complex two-by-two matrix. if A is an object of this class, then the (i,j)-th entry of the matrix is A.entries[i,j] Here i and j can be 1 or 2


Constructor Summary
ComplexMatrix2D()
          default constructor, initializes all entries to 0
ComplexMatrix2D(ComplexMatrix2D inp)
          constructor that copies the content of inp
 
Method Summary
 ComplexMatrix2D add(ComplexMatrix2D inp)
          compute and return the result of adding the matrix with inp
 ComplexMatrix2D conjugate()
          compute and return the conjugate of the matrix
 Complex determinant()
          return the determinant of the matrix.
 boolean equals(ComplexMatrix2D inp)
          test for equality two matrices are equal if and only if all their corresponding entries are equal
 Complex getMatrixEntry(int i, int j)
          return the entry at location (i,j) in the matrix where 1 <= i,j <= 2
static ComplexMatrix2D getProj(ComplexVector2D v)
          static method returning an object of type ComplexMatrix2D that is the projection matrix onto the direction of vector v
 void initialize()
           
 ComplexMatrix2D inverse()
          compute the inverse of the matrix if the matrix is not invertible, return null
 ComplexMatrix2D multiply(ComplexMatrix2D inp)
          multiply to the right by matrix inp return the product
 ComplexMatrix2D scalarMul(Complex c)
          compute and return the result of multiplying the matrix with the complex number c
 void setMatrixEntry(Complex val, int i, int j)
          set the entry (i,j) in the matrix to the value of val
 ComplexMatrix2D subtract(ComplexMatrix2D inp)
          compute and return the result of subtracting inp from the matrix
 java.lang.String toString()
          print the content of the matrix in the format {{a11,a12},{a21,a22}}
 Complex trace()
          return the trace of the matrix.
 ComplexMatrix2D transpose()
          compute and return the transpose of the matrix
 ComplexVector2D vectMul(ComplexVector2D v)
          return an object of type ComplexVector2D that is the result of multiplying the matrix with a complex vector v
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexMatrix2D

public ComplexMatrix2D()
default constructor, initializes all entries to 0


ComplexMatrix2D

public ComplexMatrix2D(ComplexMatrix2D inp)
constructor that copies the content of inp

Method Detail

initialize

public void initialize()

getMatrixEntry

public Complex getMatrixEntry(int i,
                              int j)
return the entry at location (i,j) in the matrix where 1 <= i,j <= 2


setMatrixEntry

public void setMatrixEntry(Complex val,
                           int i,
                           int j)
set the entry (i,j) in the matrix to the value of val


inverse

public ComplexMatrix2D inverse()
compute the inverse of the matrix if the matrix is not invertible, return null


multiply

public ComplexMatrix2D multiply(ComplexMatrix2D inp)
multiply to the right by matrix inp return the product


transpose

public ComplexMatrix2D transpose()
compute and return the transpose of the matrix


conjugate

public ComplexMatrix2D conjugate()
compute and return the conjugate of the matrix


add

public ComplexMatrix2D add(ComplexMatrix2D inp)
compute and return the result of adding the matrix with inp


subtract

public ComplexMatrix2D subtract(ComplexMatrix2D inp)
compute and return the result of subtracting inp from the matrix


scalarMul

public ComplexMatrix2D scalarMul(Complex c)
compute and return the result of multiplying the matrix with the complex number c


equals

public boolean equals(ComplexMatrix2D inp)
test for equality two matrices are equal if and only if all their corresponding entries are equal


toString

public java.lang.String toString()
print the content of the matrix in the format {{a11,a12},{a21,a22}}

Overrides:
toString in class java.lang.Object

getProj

public static ComplexMatrix2D getProj(ComplexVector2D v)
static method returning an object of type ComplexMatrix2D that is the projection matrix onto the direction of vector v


vectMul

public ComplexVector2D vectMul(ComplexVector2D v)
return an object of type ComplexVector2D that is the result of multiplying the matrix with a complex vector v


trace

public Complex trace()
return the trace of the matrix. the trace of a matrix is the sum of its entries along the diagonal


determinant

public Complex determinant()
return the determinant of the matrix. the determinant of a 2x2 matrix of the form {{a,b},{c,d}} is ad-bc