Add new matrix initialization helper function
Implement data partitioning