private DoubleMatrix getDiffMatrix(int[] size, int k, int indices) { int dim = size.length; DoubleMatrix d = getDiffMatrix(size[indices], k); int preProduct = 1; int postProduct = 1; for (int j = indices + 1; j < dim; j++) { preProduct *= size[j]; } for (int j = 0; j < indices; j++) { postProduct *= size[j]; } DoubleMatrix temp = d; if (preProduct != 1) { temp = (DoubleMatrix) _algebra.kroneckerProduct(DoubleMatrix.identity(preProduct), temp); } if (postProduct != 1) { temp = (DoubleMatrix) _algebra.kroneckerProduct(temp, DoubleMatrix.identity(postProduct)); } return temp; }
DoubleMatrix d = getDiffMatrix(m, differenceOrder); ma = (DoubleMatrix) _algebra.add(ma, _algebra.scale(d, lambda));
DoubleMatrix d = getDiffMatrix(sizes, differenceOrder[i], i); ma = (DoubleMatrix) _algebra.add(ma, _algebra.scale(d, lambda[i]));