Armadillo implementation