A CPU and GPU-accelerated matrix library for data mining