JacobiSolver class
Solves a system of linear equations using the Jacobi iterative method. The given input matrix, representing the system of linear equations, must be square.
This algorithm only works with strictly diagonally dominant systems of equations.
- Inheritance
-
- Object
- SystemSolver
- JacobiSolver
Constructors
-
JacobiSolver({required List<
List< equations, required List<double> >double> constants, required List<double> x0, int maxSteps = 30, double precision = 1.0e-10}) -
Given an equation in the form
Ax = b
,A
is a square matrix containingn
equations inn
unknowns andb
is the vector of the known values.factory -
JacobiSolver.flatMatrix({required List<
double> equations, required List<double> constants, required List<double> x0, int maxSteps = 30, double precision = 1.0e-10}) -
Given an equation in the form
Ax = b
,A
is a square matrix containingn
equations inn
unknowns andb
is the vector of the known values.factory
Properties
- equations ↔ RealMatrix
-
The equations of the system to be solved.
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
-
knownValues
→ List<
double> -
The vector containing the known values of the equation.
no setterinherited
- maxSteps → int
-
The maximum number of iterations to be made by the algorithm.
final
- precision → double
-
The accuracy of the algorithm.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The dimension of the system (which is N equations in N unknowns).
no setterinherited
-
x0
→ List<
double> -
The initial guess
x
(a vector) needed to start the algorithm.final
Methods
-
determinant(
) → double -
Computes the determinant of the associated matrix.
inherited
-
hasSolution(
) → bool -
Computes whether the system can be solved or not.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
solve(
) → List< double> -
Solves the
Ax = b
equation and returns thex
vector containing the solutions of the system.override -
toString(
) → String -
A string representation of this object.
inherited
-
toStringAugmented(
) → String -
Prints the augmented matrix of this instance, which is the equations matrix
plus the known values vector to the right. For example, if...
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override