final int nData = xValues.length;
if (nData == 2) {
final DoubleMatrix2D[] res = new DoubleMatrix2D[nData];
final double[][] coef = new double[][] {{yValues[1] / intervals[0] - yValues[0] / intervals[0], yValues[0] } };
res[0] = new DoubleMatrix2D(coef);
final double[][] coefSense = new double[2][];
coefSense[0] = new double[] {-1. / intervals[0], 1. / intervals[0] };
coefSense[1] = new double[] {1., 0. };
res[1] = new DoubleMatrix2D(coefSense);
return res;
}
if (nData == 3) {
final DoubleMatrix2D[] res = new DoubleMatrix2D[2];
final DoubleMatrix1D[] soln = combinedMatrixEqnSolver(toBeInv, vector, vecSensitivity);
final double[][] coef = new double[][] {{soln[0].getData()[0] / 2.,
yValues[1] / intervals[0] - yValues[0] / intervals[0] - intervals[0] * soln[0].getData()[0] / 2., yValues[0] } };
res[0] = new DoubleMatrix2D(coef);
final double[][] coefSense = new double[3][0];
coefSense[0] = new double[] {soln[1].getData()[0] / 2., soln[2].getData()[0] / 2., soln[3].getData()[0] / 2. };
coefSense[1] = new double[]
{-1. / intervals[0] - intervals[0] * soln[1].getData()[0] / 2., 1. / intervals[0] - intervals[0] * soln[2].getData()[0] / 2., -intervals[0] * soln[3].getData()[0] / 2. };
coefSense[2] = new double[] {1., 0., 0. };
res[1] = new DoubleMatrix2D(coefSense);
return res;
}
final DoubleMatrix2D[] res = new DoubleMatrix2D[nData];
final DoubleMatrix1D[] soln = combinedMatrixEqnSolver(toBeInv, vector, vecSensitivity);
res[0] = getCommonSplineCoeffs(xValues, yValues, intervals, soln[0].getData());