p = DoubleMatrix.concatHorizontally(DoubleMatrix.concatHorizontally(a, b),DoubleMatrix.concatHorizontally(c, d));
q = DoubleMatrix.concatVertically(DoubleMatrix.concatHorizontally(a, b),DoubleMatrix.concatHorizontally(c, d));
DoubleMatrix x = p.transpose().mmul(p);
x = x.mmul(x);
x = x.mmul(x);
v.data[i]=x.diag().sum();
x = q.transpose().mmul(q);
x = x.mmul(x);