for (int i = 0; i < n; i++) {
int span = uKnots.findSpan(uk[i]);
double[] tmp = uKnots.basisFunctions(span, uk[i]);
System.arraycopy(tmp, 0, A, i * n + span - degree, tmp.length);
}
final GMatrix a = new GMatrix(n, n, A);
final GVector perm = new GVector(n);
final GMatrix lu = new GMatrix(n, n);
a.computeLUD(lu, perm);
final Vec4D[] cps = new Vec4D[n];
for (int i = 0; i < cps.length; i++) {
cps[i] = new Vec4D(0, 0, 0, 1);