coins.backend.util
クラス Misc

java.lang.Object
  |
  +--coins.backend.util.Misc

public class Misc
extends java.lang.Object

Miscellaneous functions


コンストラクタの概要
Misc()
           
 
メソッドの概要
static int binlog(int pattern)
          Return rightmost 1's position
static int binlog(long pattern)
          Return binary logarithm.
static int clp2(int x)
          Round up to next powers of 2.
static int count1s(int x)
          Return number of 1's in x.
static boolean powersOf2(long x)
          Return true if x is powers of 2.
static void sort(int[] a, int n)
          Sort integer vector in ascending order.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Misc

public Misc()
メソッドの詳細

sort

public static void sort(int[] a,
                        int n)
Sort integer vector in ascending order.


clp2

public static int clp2(int x)
Round up to next powers of 2.

パラメータ:
x - number to be rounded up.
戻り値:
next powers of 2 greater than or equal to x.

powersOf2

public static boolean powersOf2(long x)
Return true if x is powers of 2.


binlog

public static int binlog(long pattern)
Return binary logarithm.


binlog

public static int binlog(int pattern)
Return rightmost 1's position


count1s

public static int count1s(int x)
Return number of 1's in x.