Function mod_fvec

Function Documentation

arma::fvec mod_fvec(const arma::fvec &x, float y)

Computes the floating-point modulo of each element in a vector.

Applies a modulo operation element-wise to the input vector x with respect to the scalar y. The result is always in the range [0, y).

This is useful for periodic computations like angle wrapping where the standard % or std::fmod are not sufficient.

Parameters:
  • x – Input vector of values.

  • y – Modulus value (should be positive).

Returns:

arma::fvec Vector of x mod y, each in the range [0, y).