80 int lastVarIndex = -1;
82 for (Map.Entry<Integer, Double> entry : coefficients.entrySet()) {
83 if (entry.getValue() != 0) {
85 lastVarIndex = entry.getKey();
86 lastCoeff = entry.getValue();
89 if (numElements == 0) {
91 }
else if (numElements == 1) {
94 int[] varIndices =
new int[numElements];
95 double[] coeffs =
new double[numElements];
97 for (Map.Entry<Integer, Double> entry : coefficients.entrySet()) {
98 if (entry.getValue() != 0) {
99 varIndices[index] = entry.getKey();
100 coeffs[index] = entry.getValue();