small cpp optimization

TP.compute() replace for-loop with memcpy()