SystemSolver constructor
SystemSolver({})
Given an equation in the form Ax = b
, A
is a square matrix containing
n
equations in n
unknowns and b
is the vector of the known values.
size
is the total number of equationsA
is the matrix containing the equationsb
is the vector with the known values
Implementation
SystemSolver({
required int size,
required List<List<double>> A,
required List<double> b,
this.precision = 1.0e-10,
}) {
// Building the matrix
equations = RealMatrix.fromData(
rows: size,
columns: size,
data: A,
);
// The vector of known values must match the size of the matrix
if (equations.rowCount != b.length) {
throw const SystemSolverException('The known values vector must have the '
'same size as the matrix.');
}
// Copying and storing internally the list of known values
_knownValues = b.map((value) => value).toList();
}