@Test
public void testBasics() {

  Matrix a = new UpperTriangular(new double[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, false);
  assertEquals(0, a.viewDiagonal().minus(new DenseVector(new double[]{1, 5, 8, 10})).norm(1), 1.0e-10);
  assertEquals(0, a.viewPart(0, 3, 1, 3).viewDiagonal().minus(
      new DenseVector(new double[]{2, 6, 9})).norm(1), 1.0e-10);
  assertEquals(4, a.get(0, 3), 1.0e-10);
  print(a);
  Matrix m = new DenseMatrix(4, 4).assign(a);
  assertEquals(0, m.minus(a).aggregate(Functions.PLUS, Functions.ABS), 1.0e-10);
  print(m);
  assertEquals(0, m.transpose().times(m).minus(a.transpose().times(a)).aggregate(
      Functions.PLUS, Functions.ABS), 1.0e-10);
  assertEquals(0, m.plus(m).minus(a.plus(a)).aggregate(Functions.PLUS, Functions.ABS), 1.0e-10);
}