assertEquals (10.0, a.value (idx1), 1e-12);
}
public void testIndexing3d ()
{
SparseMatrixn a = make3dMatrix ();
int[] idx1 = new int[3];
a.singleToIndices (21, idx1);
int[] trueIdx = new int[]{1, 2, 1};
assertTrue (Arrays.equals (trueIdx, idx1));
assertEquals (21, a.singleIndex (idx1));
assertEquals (0, a.value (idx1), 1e-12);
int[] idx2 = new int[]{1, 2, 2};
assertEquals (22, a.singleIndex (idx2));
assertEquals (44.0, a.value (idx2), 1e-12);
}