@@ -223,22 +223,58 @@ class ImplicitResidualNorm : public ResidualNormBase<ValueType> {
223223};
224224
225225
226- deferred_factory_parameter<CriterionFactory> abs_residual_norm (
226+ /* *
227+ * Creates the precursor to a ResidualNorm stopping criterion factory, to be
228+ * used in conjunction with `.with_criteria(...)` function calls when building a
229+ * solver factory. This stopping criterion will stop the iteration after the
230+ * residual norm has decreased below the specified value or by the specified
231+ * amount.
232+ *
233+ * Full usage example: Stop after 100 iterations or when the absolute residual
234+ * norm is below $10^{-10}$, whichever happens first.
235+ * ```cpp
236+ * auto factory = gko::solver::Cg<double>::build()
237+ * .with_criteria(
238+ * gko::stop::max_iters(100),
239+ * gko::stop::absolute_residual_norm(1e-10))
240+ * .on(exec);
241+ * ```
242+ *
243+ * @param tolerance the value the residual norm needs to be below.
244+ * With residual $r$, initial guess $x_0$, right-hand side $b$, matrix $A$,
245+ * `absolute` means the exact value of the norm $||r||$,
246+ * `relative` means the norm relative to the right-hand side $||r||/||b||$,
247+ * `initial` means the norm relative to the initial residual
248+ * $||r||/||b - A x_0||$.
249+ * An implicit stopping criterion is only available with some solvers, and
250+ * refers to either the energy norm $||r||_A$ in short-recurrence solvers
251+ * like Cg or the euclidian norm $||r||$ in solvers like GMRES.
252+ * Implicit residual norms are cheaper to compute, but may be less precise
253+ * due to accumulating rounding errors.
254+ * @return a deferred_factory_parameter that can be passed to the
255+ * `with_criteria` function when building a solver.
256+ */
257+ deferred_factory_parameter<CriterionFactory> absolute_residual_norm (
227258 double tolerance);
228259
229- deferred_factory_parameter<CriterionFactory> rel_residual_norm (
260+ /* * @copydoc absolute_residual_norm */
261+ deferred_factory_parameter<CriterionFactory> relative_residual_norm (
230262 double tolerance);
231263
232- deferred_factory_parameter<CriterionFactory> residual_norm_reduction (
264+ /* * @copydoc absolute_residual_norm */
265+ deferred_factory_parameter<CriterionFactory> initial_residual_norm (
233266 double tolerance);
234267
235- deferred_factory_parameter<CriterionFactory> implicit_abs_residual_norm (
268+ /* * @copydoc absolute_residual_norm */
269+ deferred_factory_parameter<CriterionFactory> absolute_implicit_residual_norm (
236270 double tolerance);
237271
238- deferred_factory_parameter<CriterionFactory> implicit_rel_residual_norm (
272+ /* * @copydoc absolute_residual_norm */
273+ deferred_factory_parameter<CriterionFactory> relative_implicit_residual_norm (
239274 double tolerance);
240275
241- deferred_factory_parameter<CriterionFactory> implicit_residual_norm_reduction (
276+ /* * @copydoc absolute_residual_norm */
277+ deferred_factory_parameter<CriterionFactory> initial_implicit_residual_norm (
242278 double tolerance);
243279
244280
0 commit comments