}
public void testPackedArray() throws Throwable
{
double matrixData[][] = {{1.0,2.0},{3.0,4.0}};
Matrix matrix = new Matrix(matrixData);
Double matrixData2[] = matrix.toPackedArray();
TestCase.assertEquals(4, matrixData2.length);
TestCase.assertEquals(1.0,matrix.get(0, 0));
TestCase.assertEquals(2.0,matrix.get(0, 1));
TestCase.assertEquals(3.0,matrix.get(1, 0));
TestCase.assertEquals(4.0,matrix.get(1, 1));
Matrix matrix2 = new Matrix(2,2);
matrix2.fromPackedArray(matrixData2, 0);
TestCase.assertTrue(matrix.equals(matrix2));
}