Class WRMSComputer

Class Documentation

class WRMSComputer

Computes the weighted root-mean-square norm.

This class is used to compute the weighted root-mean-square of the residuals and maintains its work space to avoid reallocation.

Public Functions

inline WRMSComputer(int const n, SUNContext const sunctx, realtype const atol, realtype const rtol, AmiVector mask)

Constructor.

Parameters:
  • n – The length of the vectors for which to compute the WRMS.

  • sunctx – A SUNDIALS context for the NVector.

  • atol – Absolute tolerance to compute error weights.

  • rtol – Relative tolerance to compute error weights.

  • mask – Mask for entries to include in the WRMS norm. Positive value: include; non-positive value: exclude; empty: include all.

realtype wrms(AmiVector const &x, AmiVector const &x_ref)

Compute the weighted root-mean-square of the residuals.

Parameters:
  • x – Vector to compute the WRMS for.

  • x_ref – The reference vector from which to compute the error weights.

Returns:

The WRMS norm.