Function mod_fvec
Defined in File costs_utils.hpp
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
xwith respect to the scalary. The result is always in the range [0, y).This is useful for periodic computations like angle wrapping where the standard
%orstd::fmodare 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).