MatVecModM returns v = A*s % m. Assumes that -m < s[i] < m. Works even if v = s.
function MatVecModM input Real[3, 3] A; input Real[3] s; output Real[3] v; input Real m; end MatVecModM;