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.Constructor and Description |
---|
GenMinResEx2() |
Modifier and Type | Method and Description |
---|---|
void |
amultp(double[] p,
double[] z)
Multiplies the matrix
a and the input vector
p . |
double |
innerproduct(double[] x,
double[] y)
Computes the inner product of
x and y . |
static void |
main(String[] args) |
double |
norm(double[] x)
Computes the Euclidean norm of
x . |
public void amultp(double[] p, double[] z)
a
and the input vector
p
. The result is returned in z
.amultp
in interface GenMinRes.Function
p
- a double
array with
p.length
=a[0].length
z
- a double
arraypublic double innerproduct(double[] x, double[] y)
x
and y
.
The inner product \( < x, y > \) = \( \sum_{i=1}^{x.length} x[i]*y[i] \), where
x.length
\( \le \) y.length
.innerproduct
in interface GenMinRes.VectorProducts
x
- a double
array with x.length
\( \le \) y.length
y
- a double
arraypublic double norm(double[] x)
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.norm
in interface GenMinRes.Norm
x
- a double
arraydouble
, the Euclidean norm of xCopyright © 2020 Rogue Wave Software. All rights reserved.