Methods for working with two-dimensional matrices stored as arrays of doubles. The code here is based in part on the following existing matrix libraries for Java.