예제 #1
0
 public int compareTo(Object obj) {
   F32Vector vec2 = (F32Vector) obj;
   float[] arr1 = data;
   float[] arr2 = vec2.data;
   int n1 = size();
   int n2 = vec2.size();
   IntSequence inds1 = getIndexesForce();
   IntSequence inds2 = vec2.getIndexesForce();
   int n = n1 > n2 ? n2 : n1;
   for (int i = 0; i < n; i++) {
     float v1 = arr1[inds1.intAt(i)];
     float v2 = arr2[inds2.intAt(i)];
     if (v1 != v2) return v1 > v2 ? 1 : -1;
   }
   return n1 - n2;
 }