Class DiagonalPreconditioner

  • All Implemented Interfaces:
    Preconditioner

    public class DiagonalPreconditioner
    extends java.lang.Object
    implements Preconditioner
    Diagonal preconditioner. Uses the inverse of the diagonal as preconditioner
    • Constructor Summary

      Constructors 
      Constructor Description
      DiagonalPreconditioner​(int n)
      Constructor for DiagonalPreconditioner
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Vector apply​(Vector b, Vector x)
      Solves the approximate problem with the given right hand side.
      void setMatrix​(Matrix A)
      Sets the operator matrix for the preconditioner.
      Vector transApply​(Vector b, Vector x)
      Solves the approximate transpose problem with the given right hand side.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DiagonalPreconditioner

        public DiagonalPreconditioner​(int n)
        Constructor for DiagonalPreconditioner
        Parameters:
        n - Problem size (number of rows)
    • Method Detail

      • apply

        public Vector apply​(Vector b,
                            Vector x)
        Description copied from interface: Preconditioner
        Solves the approximate problem with the given right hand side. Result is stored in given solution vector
        Specified by:
        apply in interface Preconditioner
        Parameters:
        b - Right hand side of problem
        x - Result is stored here
        Returns:
        x
      • transApply

        public Vector transApply​(Vector b,
                                 Vector x)
        Description copied from interface: Preconditioner
        Solves the approximate transpose problem with the given right hand side. Result is stored in given solution vector
        Specified by:
        transApply in interface Preconditioner
        Parameters:
        b - Right hand side of problem
        x - Result is stored here
        Returns:
        x
      • setMatrix

        public void setMatrix​(Matrix A)
        Description copied from interface: Preconditioner
        Sets the operator matrix for the preconditioner. This method must be called before a preconditioner is used by an iterative solver
        Specified by:
        setMatrix in interface Preconditioner
        Parameters:
        A - Matrix to setup the preconditioner for. Not modified