if(hasNoParents(continuousNode)){ // special case when it is a root node
Matrix h = new Matrix(continuousNode.getGHK().getGhkPot().getH().gethMatrix());
Matrix k = new Matrix(continuousNode.getGHK().getGhkPot().getK().getkMatrix());
g = continuousNode.getGHK().getGhkPot().getG() + h.transpose().times(d).det() - (k.times(d).times(d).times(0.5)).det();
continuousNode.getGHK().getGhkPot().setG(g);
double[][] hMat = new double[1][1];
hMat[0][0]=0;
hc.sethMatrix(hMat);