Added adaptive and sparse random matrices. Fixed distributed matrix generation.