Class ComplexMatrix2D

  • public class ComplexMatrix2Dextends 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 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
      • transpose

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

        public ComplexMatrix2D conjugate()
        compute and return the conjugate of 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 String toString()
        print the content of the matrix in the format {{a11,a12},{a21,a22}}
        toString in class 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

SCaVis 2.2 © jWork.ORG