Modified matrix.c include some optimizations (cahce and intrinsics).