Class LSProblem


  • public class LSProblem
    extends Object
    This is the problem of solving a system of linear equations.
    Ax = b
    • Constructor Detail

      • LSProblem

        public LSProblem​(Matrix A,
                         Vector b)
        Constructs a system of linear equations Ax = b.
        Parameters:
        A - the the homogeneous part, the coefficient matrix, of the linear system
        b - the non-homogeneous part, the right-hand side vector, of the linear system
    • Method Detail

      • A

        public ImmutableMatrix A()
        Gets the homogeneous part, the coefficient matrix, of the linear system.
        Returns:
        the coefficient matrix
      • b

        public ImmutableVector b()
        Gets the non-homogeneous part, the right-hand side vector, of the linear system.
        Returns:
        the vector
      • size

        public int size()
        Gets the number of variables in the linear system.
        Returns:
        the number of variables
      • withMaxIteration

        public LSProblem withMaxIteration​(int maxIteration)
        Overrides the maximum count of iterations.
        Parameters:
        maxIteration - the maximum count of iterations
        Returns:
        the new problem with the overriden maximum count of iterations
      • getMaxIteration

        public int getMaxIteration()
        Gets the specified maximum number of iterations.
        Returns:
        the maximum number of iterations
      • withTolerance

        public LSProblem withTolerance​(Tolerance tolerance)
        Overrides the tolerance instance.
        Parameters:
        tolerance - the criteria which determines when the solution converges and the iteration stops
        Returns:
        the new problem with the overriden tolerance
      • withInitialGuess

        public LSProblem withInitialGuess​(Vector initialGuess)
        Overrides the initial guess of the solution.
        Parameters:
        initialGuess - the initial guess of the solution
        Returns:
        the new problem with the overriden initial guess
      • getInitialGuess

        public Vector getInitialGuess()
        Gets the initial guess of the solution for the problem.
        Returns:
        the initial guess
      • withLeftPreconditioner

        public LSProblem withLeftPreconditioner​(Preconditioner preconditioner)
        Overrides the left preconditioner. If right-preconditioning is used, leave this as its default value - IdentityPreconditioner.
        Parameters:
        preconditioner - the preconditioner
        Returns:
        the new problem with the overriden left preconditioner
      • getLeftPreconditioner

        public Preconditioner getLeftPreconditioner()
        Gets the left preconditioner.
        Returns:
        the left preconditioner
      • withRightPreconditioner

        public LSProblem withRightPreconditioner​(Preconditioner preconditioner)
        Overrides the right preconditioner. If left-preconditioning is used, leave this as its default value - IdentityPreconditioner.
        Parameters:
        preconditioner - the preconditioner
        Returns:
        the new problem with the overriden right preconditioner
      • getRightPreconditioner

        public Preconditioner getRightPreconditioner()
        Gets the right preconditioner.
        Returns:
        the right preconditioner