prototype for array based random matrix generator and deallocator.