Package com.imsl.test.example.math
Class ConjugateGradientEx1
java.lang.Object
com.imsl.test.example.math.ConjugateGradientEx1
- All Implemented Interfaces:
ConjugateGradient.Function
Solves a positive definite linear system using the conjugate gradient method.
The solution to a positive definite linear system is found. The coefficient matrix is stored as a full matrix. The system is \(Ax = b\) where $$ A=\begin{bmatrix} 1.0 & -3.0 & 2.0 \\ -3.0 & 10.0 & -5.0 \\ 2.0 & -5.0 & 6.0 \end{bmatrix} $$and \( b = (27.0, -78.0, 64.0)^T\)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ConjugateGradientEx1
public ConjugateGradientEx1()
-
-
Method Details
-
amultp
public void amultp(double[] p, double[] z) Description copied from interface:ConjugateGradient.FunctionA user-supplied function which computes z=Ap.- Specified by:
amultpin interfaceConjugateGradient.Function- Parameters:
p- an inputdoublevector of length dimension of A.z- an outputdoublevector containing the matrix-vector product Ap.
-
main
- Throws:
Exception
-