Class GenMinResEx2

java.lang.Object
com.imsl.test.example.math.GenMinResEx2
All Implemented Interfaces:
GenMinRes.Function, GenMinRes.Norm, GenMinRes.VectorProducts

public class GenMinResEx2 extends Object implements GenMinRes.Function, GenMinRes.Norm

Solves a small linear system with user supplied inner product.

A solution to a small linear system is found. The coefficient matrix is stored as a full matrix and no preconditioning is used. Typically, preconditioning is required to achieve convergence in a reasonable number of iterations. The user supplies a function to compute the inner product and norm within the Gram-Schmidt implementation.
See Also:
  • Constructor Details

    • GenMinResEx2

      public GenMinResEx2()
  • Method Details

    • amultp

      public void amultp(double[] p, double[] z)
      Multiplies the matrix a and the input vector p. The result is returned in z.
      Specified by:
      amultp in interface GenMinRes.Function
      Parameters:
      p - a double array with p.length=a[0].length
      z - a double array
    • innerproduct

      public double innerproduct(double[] x, double[] y)
      Computes the inner product of x and y. The inner product \( < x, y > \) = \( \sum_{i=1}^{x.length} x[i]*y[i] \), where x.length \( \le \) y.length.
      Specified by:
      innerproduct in interface GenMinRes.VectorProducts
      Parameters:
      x - a double array with x.length \( \le \) y.length
      y - a double array
      Returns:
      the inner product
    • norm

      public double norm(double[] x)
      Computes the Euclidean norm of x. The Euclidean norm of a vector, \(x \) is defined as \(\sqrt{\sum_{i=1}^{n} x_i*x_i} = \sqrt{ < x , x >} \) where \( < \cdot,\cdot > \) denotes the inner product operation.
      Specified by:
      norm in interface GenMinRes.Norm
      Parameters:
      x - a double array
      Returns:
      a double, the Euclidean norm of x
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception