Reputation: 440
I find I am frequently copying part of one matrix into another, does ojAlgo have any functionality for copying of a matrix into a portion of another matrix? e.g. I have 3 matrices I need to copy into one larger matrix containing all 3 results
Upvotes: 0
Views: 28
Reputation: 1320
If the "matrices" you want to copy happen to be 1D, then you just use fillRow(...), fillColumn(...) or fillDialgonal(...), otherwise you use fillMatching(...) or fillCompatible(...).
To shift or point to a sub-region of a matrix you call one of the regionBy-methods.
target.regionByOffsets(1, 2).fillMatching(block1);
target.regionByOffsets(5, 4).fillMatching(block2);
target.regionByOffsets(9, 7).fillMatching(block3);
When you ask questions it help if you include code describing what you have tried.
Upvotes: 0