Here you can find the source of expandSplineRoots(int n)
private static synchronized void expandSplineRoots(int n)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.atomic.AtomicReference; public class Main { /**//from w w w . ja v a2s . c om * The spline coefficient cache */ private final static AtomicReference<float[][][]> coeffRoot = new AtomicReference<float[][][]>(); private static synchronized void expandSplineRoots(int n) { float[][][] oldRoot = coeffRoot.get(); if (oldRoot != null && oldRoot.length > n) { return; } float[][][] newRoot = new float[n + 1][][]; // Coefficient for zeroth order spline newRoot[0] = new float[][] { { 1.0F } }; // Compute coefficients for each spline order based on the coefficients from the previous order for (int o = 1; o < n + 1; o++) { newRoot[o] = new float[o + 1][o + 1]; for (int i = 0; i < o; i++) { for (int p = 0; p < o; p++) { newRoot[o][i][p + 1] += newRoot[o - 1][i][p] / (p + 1); newRoot[o][i + 1][p + 1] -= newRoot[o - 1][i][p] / (p + 1); newRoot[o][i + 1][0] += newRoot[o - 1][i][p] / (p + 1); } } } coeffRoot.set(newRoot); } }