/** * Removes the specified view from the list of views. If it's not contained in the list * an exception is thrown * @param which Index of the view which is to be removed */ public void removeView( int which ) { int index = views.indexOf(which); if( index == -1 ) throw new RuntimeException("BUG. Could not find in list of views. which="+which); views.remove(index); }
/** * Removes the feature and observation at the specified element */ public void remove(int index ) { point.remove(index); index *= 2; observations.remove(index,index+1); }
if( viewIdx < 0 ) throw new RuntimeException("Bug in structure. view has point but point doesn't have view"); structure.points[pointId].views.remove(viewIdx);
SceneStructureProjective.View v = structure.views[viewsIn.get(i)]; if( v.width == -2 ) { viewsIn.remove(i);
/** * Look for two corners which point to the same point and removes one of them from the corner list */ void removeDuplicates( GrowQueue_I32 corners ) { // remove duplicates for (int i = 0; i < corners.size(); i++) { Point2D_I32 a = contour.get(corners.get(i)); // start from the top so that removing a corner doesn't mess with the for loop for (int j = corners.size()-1; j > i; j--) { Point2D_I32 b = contour.get(corners.get(j)); if( a.x == b.x && a.y == b.y ) { // this is still ok if j == 0 because it wrapped around. 'i' will now be > size corners.remove(j); } } } }
colors.remove(i);
contourCorners.remove(index);
@Test public void remove_two() { GrowQueue_I32 alg = new GrowQueue_I32(10); alg.push(1); alg.push(3); alg.push(4); alg.push(5); alg.push(6); alg.remove(1,1); assertEquals(4,alg.size); assertEquals(1,alg.get(0)); assertEquals(4,alg.get(1)); assertEquals(5,alg.get(2)); assertEquals(6,alg.get(3)); alg.remove(0,1); assertEquals(2,alg.size); assertEquals(5,alg.get(0)); assertEquals(6,alg.get(1)); }
@Test public void remove_one() { GrowQueue_I32 alg = new GrowQueue_I32(10); alg.push(1); alg.push(3); alg.push(4); alg.push(5); alg.remove(1); assertEquals(3,alg.size); assertEquals(1,alg.get(0)); assertEquals(4,alg.get(1)); assertEquals(5,alg.get(2)); }