In an attempt to see if I can clean up some of my math code, mostly matrix stuff, I am trying to use some Java Generics. I have the following method:
private <
Ye olde (reference) arrays do not play well with generics. In this case arrays are also likely to be inefficient. You are creating an array of arrays, so there is unnecessary indirection and bounds checking. Better to make a class Matrix
. You may also want to add to the Matrix
an reference to an instance of T
that represents a zero.