Wrote string compaction functions in matrix_math.cu

all the functions from project2 are in matrx_math.cu