An abstract class that represents a system of equations, which can be solved using various algorithms that manipulate the data of a matrix and a vector.
System solvers of linear equations require the coefficients to be real
numbers and there must be n
equations in n
unknowns.
The coefficients of the various equations are put inside a square matrix,
generally called A
. The known values are represented by a vector, usually
known as b
. From this, we get an equation in the form Ax = b
.
The method solve returns the x
vector of the Ax = b
equation.
Constructors
-
SystemSolver({required RealMatrix matrix, required List<
double> knownValues, 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. This class can only be built with square matrices. In particular:
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
-
knownValues
→ List<
double> -
The vector containing the known values of the equations.
final
- matrix → RealMatrix
-
The equations to be solved.
final
- precision → double
-
The algorithm accuracy.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The dimension of the system (N equations in N unknowns).
no setter
Methods
-
determinant(
) → double - Computes the determinant of the associated matrix.
-
hasSolution(
) → bool - Computes whether the system can be solved or not.
-
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. -
toString(
) → String -
A string representation of this object.
override
-
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...
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
backSubstitution(
List< List< source, List<double> >double> vector) → List<double> -
Back substitution is an iterative process that solves equation matrices
in the form
Ux = b
, whereU
is an upper triangular matrix. -
forwardSubstitution(
List< List< source, List<double> >double> vector) → List<double> -
Forward substitution is an iterative process that solves equation matrices
in the form
Lx = b
, whereL
is a lower triangular matrix.