merge af_math.h from dev branch
replace matrices with Mat for MatrixMan