Math-Matrix
view release on metacpan or search on metacpan
and the relative error
||$A*$x - $y|| / ||$y|| = ||$r|| / ||$y||
are computed and compared to the tolerances. Once one of the stopping
criteria is satisfied, the algorithm terminates.
Stopping criteria
The algorithm stops when at least one of the errors are within the
specified tolerances or the maximum number of iterations is reached. If
the maximum number of iterations is reached, but noen of the errors are
within the tolerances, a warning is displayed and the best solution so
far is returned.
Parameters
MaxIter
The maximum number of iterations to perform. The value must be a
positive integer. The default is 20.
RelTol
The limit for the relative error. The value must be a non-negative.
The default value is 1e-19 when perl is compiled with long doubles
or quadruple precision, and 1e-9 otherwise.
AbsTol
The limit for the absolute error. The value must be a non-negative.
The default value is 0.
and the relative error
||$A*$x - $y|| / ||$y|| = ||$r|| / ||$y||
are computed and compared to the tolerances. Once one of the stopping criteria
is satisfied, the algorithm terminates.
## Stopping criteria
The algorithm stops when at least one of the errors are within the specified
tolerances or the maximum number of iterations is reached. If the maximum number
of iterations is reached, but noen of the errors are within the tolerances, a
warning is displayed and the best solution so far is returned.
## Parameters
- MaxIter
The maximum number of iterations to perform. The value must be a positive
integer. The default is 20.
- RelTol
The limit for the relative error. The value must be a non-negative. The default
value is 1e-19 when perl is compiled with long doubles or quadruple precision,
and 1e-9 otherwise.
- AbsTol
lib/Math/Matrix.pm view on Meta::CPAN
$iter_best = $iter;
$abs_err_best = $abs_err;
$rel_err_best = $rel_err;
}
if ($abs_err_best <= $abs_tol || $rel_err_best <= $rel_tol) {
last;
} else {
# If we still haven't got the desired result, but have reached
# the maximum number of iterations, display a warning.
if ($iter == $max_iter) {
carp "mldiv() stopped because the maximum number of",
" iterations (max. iter = $max_iter) was reached without",
" converging to any of the desired tolerances (",
"rel_tol = ", $rel_tol, ", ",
"abs_tol = ", $abs_tol, ").",
" The best iterate (iter. = ", $iter_best, ") has",
" a relative residual of ", $rel_err_best, " and",
" an absolute residual of ", $abs_err_best, ".";
last;
}
}
lib/Math/Matrix.pm view on Meta::CPAN
and the relative error
||$A*$x - $y|| / ||$y|| = ||$r|| / ||$y||
are computed and compared to the tolerances. Once one of the stopping criteria
is satisfied, the algorithm terminates.
=head2 Stopping criteria
The algorithm stops when at least one of the errors are within the specified
tolerances or the maximum number of iterations is reached. If the maximum number
of iterations is reached, but noen of the errors are within the tolerances, a
warning is displayed and the best solution so far is returned.
=head2 Parameters
=over 4
=item MaxIter
The maximum number of iterations to perform. The value must be a positive
integer. The default is 20.
=item RelTol
The limit for the relative error. The value must be a non-negative. The default
value is 1e-19 when perl is compiled with long doubles or quadruple precision,
and 1e-9 otherwise.
=item AbsTol
( run in 1.116 second using v1.01-cache-2.11-cpan-71847e10f99 )