Gravar e-mail: An RRAM-based implementation of a template matching circuit for low-power analogue classification