support generate random matrix in memory

modify Marlin project  structure.