73 int lastVarIndex = -1;
75 for (Map.Entry<Integer, Long> entry : coefficients.entrySet()) {
76 if (entry.getValue() != 0) {
78 lastVarIndex = entry.getKey();
79 lastCoeff = entry.getValue();
82 if (numElements == 0) {
84 }
else if (numElements == 1) {
87 int[] varIndices =
new int[numElements];
88 long[] coeffs =
new long[numElements];
90 for (Map.Entry<Integer, Long> entry : coefficients.entrySet()) {
91 if (entry.getValue() != 0) {
92 varIndices[index] = entry.getKey();
93 coeffs[index] = entry.getValue();