@Test public void sortObject() { int numBins = 150; float tolerance = 15.0f/numBins; float[] data = random(-5,10,4,200); SortableParameter_F32[] objs = convert(data); ApproximateSort_F32 alg = new ApproximateSort_F32(-5,10,numBins); alg.sortObject(objs, 4, 200); // see if the sort was to within the expected tolerance for( int i = 5; i < objs.length; i++ ) { assertTrue( objs[i].sortValue > objs[i-1].sortValue -tolerance ); } }
sorterApprox.sortObject(edges.data,0,edges.size); } else { sorter.sort(edges.data,edges.size);