ConjugateGradient
The conjugate gradient method for A x = b with A symmetric positive definite, given only as a function: the harmonic smoothing of CircularCoordinates solves a graph Laplacian system this way, never forming the matrix.
Attributes
- Experimental
- true
- Source
- ConjugateGradient.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ConjugateGradient.type
Members list
Type members
Classlikes
The residual did not get small enough within the iteration limit.
The residual did not get small enough within the iteration limit.
Attributes
- Source
- ConjugateGradient.scala
- Supertypes
-
class RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Raised when checking is on and the operator is not symmetric, or has non-positive curvature.
Raised when checking is on and the operator is not symmetric, or has non-positive curvature.
Attributes
- Source
- ConjugateGradient.scala
- Supertypes
-
class IllegalArgumentExceptionclass RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
The solution of operator(x) = b for a symmetric positive definite operator, stopping at the first iterate whose residual b - operator(x) has norm at most tolerance * |b|.
The solution of operator(x) = b for a symmetric positive definite operator, stopping at the first iterate whose residual b - operator(x) has norm at most tolerance * |b|.
With check on, the operator is tested for symmetry once (two extra applications: against for two fixed vectors) and every step for positive curvature (> 0); either failure raises NotSymmetricPositiveDefiniteException saying which. The tests catch an operator that is plainly not symmetric positive definite; they do not prove that it is. With check off a bad operator typically ends in NotConvergedException.
Value parameters
- b
-
the right-hand side.
- check
-
whether to test the operator as described above.
- initial
-
where to start (default: the zero vector, which also saves the application of
operatorto it). - maxIterations
-
the most iterations to run; NotConvergedException if the tolerance is not reached by then. One iteration is one application of
operator. - operator
-
x => A x, for the symmetric positive definiteAof the system. It is given a fresh vector each time. - tolerance
-
relative residual to reach,
|b - A x| <= tolerance * |b|.
Attributes
- Source
- ConjugateGradient.scala