Package com.imsl.test.example.math
Class GenMinResEx2
java.lang.Object
com.imsl.test.example.math.GenMinResEx2
- All Implemented Interfaces:
GenMinRes.Function,GenMinRes.Norm,GenMinRes.VectorProducts
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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidamultp(double[] p, double[] z) Multiplies the matrixaand the input vectorp.doubleinnerproduct(double[] x, double[] y) Computes the inner product ofxandy.static voiddoublenorm(double[] x) Computes the Euclidean norm ofx.
-
Constructor Details
-
GenMinResEx2
public GenMinResEx2()
-
-
Method Details
-
amultp
public void amultp(double[] p, double[] z) Multiplies the matrixaand the input vectorp. The result is returned inz.- Specified by:
amultpin interfaceGenMinRes.Function- Parameters:
p- adoublearray withp.length=a[0].lengthz- adoublearray
-
innerproduct
public double innerproduct(double[] x, double[] y) Computes the inner product ofxandy. The inner product \( < x, y > \) = \( \sum_{i=1}^{x.length} x[i]*y[i] \), wherex.length\( \le \)y.length.- Specified by:
innerproductin interfaceGenMinRes.VectorProducts- Parameters:
x- adoublearray withx.length\( \le \)y.lengthy- adoublearray- Returns:
- the inner product
-
norm
public double norm(double[] x) Computes the Euclidean norm ofx. 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:
normin interfaceGenMinRes.Norm- Parameters:
x- adoublearray- Returns:
- a
double, the Euclidean norm of x
-
main
- Throws:
Exception
-