for (int i = 0; i < featureVectors.length; i++) {
Set<Integer> indices = featureVectors[i].getIndices();
prob.x[i] = new FeatureNode[(bias >= 0) ? indices.size() + 1 : indices.size()];
int j = 0;
for (int index : indices) {
prob.x[i][j] = new FeatureNode(index, featureVectors[i].getValue(index));
maxIndex = Math.max(maxIndex, index);
j++;
}
}
if (bias >= 0) {
maxIndex++;
for (int i = 0; i < featureVectors.length; i++) {
prob.x[i][prob.x[i].length - 1] = new FeatureNode(maxIndex, bias);
}
}
prob.n = maxIndex;
prob.bias = (bias >= 0) ? 1 : -1;