Package matrix

Class ProfileMatrix

java.lang.Object
matrix.ProfileMatrix

public class ProfileMatrix
extends java.lang.Object
Class Class of ProfileMatrix realisation
  • Field Summary

    Fields 
    Modifier and Type Field Description
    double[] al
    profile rows of lower triangle
    private double[] au
    profile columns of upper triangle
    private double[] d
    matrix diagonal
    int[] ia
    index array for al, au
    (package private) boolean isLU
    is matrix LU decompositioned
    private static java.lang.String[] NAME_OF_FILES
    Set of files for reading and setting ProfileMatrix.
  • Constructor Summary

    Constructors 
    Constructor Description
    ProfileMatrix​(java.lang.String pathOfMatrix)
    Constructor for ProfileMatrix, that reads readFromPath(String) it from directory.
    ProfileMatrix​(java.lang.String pathOfMatrix, boolean isLU)
    Constructor for ProfileMatrix, that reads readFromPath(String) it from directory.
  • Method Summary

    Modifier and Type Method Description
    private void assertLU()
    Asserting that matrix is LU.
    void changeToLU()
    Decomposition of a matrix into LU
    double getHighTriangle​(int i, int j)
    Getter for specified element from upper triangle
    double getIJ​(int i, int j)
    Getter for specified element.
    private double getIJWithoutException​(int i, int j)
    Getter for specified element.
    double getL​(int i, int j)
    Getter for specified element from L matrix (A = LU)
    double getLowTriangle​(int i, int j)
    Getter for specified element from lower triangle
    double getU​(int i, int j)
    Getter for specified element from U matrix (A = LU)
    private double profileGet​(int i, int j, double[] profile)
    Getter for specified element from specified profile
    private void readFromPath​(java.lang.String pathOfMatrix)
    Reading Matrix from directory.
    void setL​(int i, int j, double value)
    Setter of specified element in L
    private void setProfile​(int i, int j, double value, double[] profile)
    Setter of specified profile element for specified profile
    void setU​(int i, int j, double value)
    Setter of specified element in U
    void showByGetters()
    Writing matrix in "square" format to System.out
    void showL()
    Writing L part os Matrix in "square" format to System.out
    void showU()
    Writing U part os Matrix in "square" format to System.out
    int size()
    Getter of matrix dimension.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • al

      public double[] al
      profile rows of lower triangle
    • au

      private double[] au
      profile columns of upper triangle
    • d

      private double[] d
      matrix diagonal
    • ia

      public int[] ia
      index array for al, au
    • isLU

      boolean isLU
      is matrix LU decompositioned
    • NAME_OF_FILES

      private static final java.lang.String[] NAME_OF_FILES
      Set of files for reading and setting ProfileMatrix.
  • Constructor Details

    • ProfileMatrix

      public ProfileMatrix​(java.lang.String pathOfMatrix)
      Constructor for ProfileMatrix, that reads readFromPath(String) it from directory.
      Parameters:
      pathOfMatrix - - path to directory, that contains files for matrix
    • ProfileMatrix

      public ProfileMatrix​(java.lang.String pathOfMatrix, boolean isLU)
      Constructor for ProfileMatrix, that reads readFromPath(String) it from directory. Can specify that matrix is already LU decompositioned
      Parameters:
      pathOfMatrix - - path to directory, that contains files for matrix
      isLU - - is matrix already LU
  • Method Details

    • readFromPath

      private void readFromPath​(java.lang.String pathOfMatrix)
      Reading Matrix from directory. Using following files: au.txt, al.txt, ia.txt, d.txt.
      Parameters:
      pathOfMatrix - - path to directory, that contains files for matrix
      See Also:
      MatrixGenerator
    • getIJ

      public double getIJ​(int i, int j)
      Getter for specified element. Works before LU decomposition
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element
    • getIJWithoutException

      private double getIJWithoutException​(int i, int j)
      Getter for specified element.
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element
    • size

      public int size()
      Getter of matrix dimension.
      Returns:
      - size of diagonal(=dimension)
    • profileGet

      private double profileGet​(int i, int j, double[] profile)
      Getter for specified element from specified profile
      Parameters:
      i - - row if match to upper triangle
      j - - column if match to upper triangle
      profile - - upper or lower a
      Returns:
      - value of ij element of a
    • getLowTriangle

      public double getLowTriangle​(int i, int j)
      Getter for specified element from lower triangle
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element from lower triangle
    • getHighTriangle

      public double getHighTriangle​(int i, int j)
      Getter for specified element from upper triangle
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element from upper triangle
    • assertLU

      private void assertLU()
      Asserting that matrix is LU.
    • getL

      public double getL​(int i, int j)
      Getter for specified element from L matrix (A = LU)
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element from L
    • getU

      public double getU​(int i, int j)
      Getter for specified element from U matrix (A = LU)
      Parameters:
      i - - row
      j - - column
      Returns:
      - value of ij element from U
    • setProfile

      private void setProfile​(int i, int j, double value, double[] profile)
      Setter of specified profile element for specified profile
      Parameters:
      i - - row if matched to upper triangle
      j - - column if matched to upper triangle
      value - - setting value
      profile - - upper or lower a
    • setL

      public void setL​(int i, int j, double value)
      Setter of specified element in L
      Parameters:
      i - - row
      j - - column
      value - - setting value
    • setU

      public void setU​(int i, int j, double value)
      Setter of specified element in U
      Parameters:
      i - - row
      j - - column
      value - - setting value
    • changeToLU

      public void changeToLU()
      Decomposition of a matrix into LU
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
      Returns:
      - string representation of matrix
    • showByGetters

      public void showByGetters()
      Writing matrix in "square" format to System.out
    • showL

      public void showL()
      Writing L part os Matrix in "square" format to System.out
    • showU

      public void showU()
      Writing U part os Matrix in "square" format to System.out