com.threerings.opengl.util
Class GlUtil
java.lang.Object
com.threerings.opengl.util.GlUtil
public class GlUtil
- extends Object
Various static methods of general utility.
|
Method Summary |
static
|
divide(T[] a,
Comparator<? super T> comp)
Divides the provided array into two halves, so that the first half contains all of the
elements less than the median, and the second half contains all of the elements equal to
or greater than the median. |
static int |
nextPowerOfTwo(int value)
Returns the smallest power-of-two that is greater than or equal to the supplied (positive)
value. |
GlUtil
public GlUtil()
nextPowerOfTwo
public static int nextPowerOfTwo(int value)
- Returns the smallest power-of-two that is greater than or equal to the supplied (positive)
value.
divide
public static <T> void divide(T[] a,
Comparator<? super T> comp)
- Divides the provided array into two halves, so that the first half contains all of the
elements less than the median, and the second half contains all of the elements equal to
or greater than the median. This code is adapted from Wikipedia's page on
Selection algorithms.
Copyright © 2011. All Rights Reserved.