Toward memristive in-memory computing: principles and applications