Is your feature request related to a problem? Please describe.
Implement caching in the sample function using preallocated memory.
Describe the solution you’d like
Define a sample! API, which takes a sample matrix as the argument and similar arguments as the sample one.