C# 클래스 Lucene.Net.Util.BitUtil

A variety of high efficiencly bit twiddling routines.
파일 보기 프로젝트 열기: synhershko/lucene.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ntzTable byte[]

공개 메소드들

메소드 설명
IsPowerOfTwo ( int v ) : bool

returns true if v is a power of two or zero

IsPowerOfTwo ( long v ) : bool

returns true if v is a power of two or zero

NextHighestPowerOfTwo ( int v ) : int

returns the next highest power of two, or the current value if it's already a power of two or zero

NextHighestPowerOfTwo ( long v ) : long

returns the next highest power of two, or the current value if it's already a power of two or zero

Ntz ( int val ) : int

Returns number of trailing zeros in a 32 bit int value.

Ntz ( long val ) : int

Returns number of trailing zeros in a 64 bit long value.

Ntz2 ( long x ) : int

returns 0 based index of first set bit (only works for x!=0)
This is an alternate implementation of ntz()

Ntz3 ( long x ) : int

returns 0 based index of first set bit
This is an alternate implementation of ntz()

Pop ( long x ) : int

Returns the number of bits set in the long

Pop_andnot ( long A, long B, int wordOffset, int numWords ) : long

Returns the popcount or cardinality of A & ~B Neither array is modified.

Pop_array ( long A, int wordOffset, int numWords ) : long

Returns the number of set bits in an array of longs.

Pop_intersect ( long A, long B, int wordOffset, int numWords ) : long

Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified.

Pop_union ( long A, long B, int wordOffset, int numWords ) : long

Returns the popcount or cardinality of the union of two sets. Neither array is modified.

Pop_xor ( long A, long B, int wordOffset, int numWords ) : long

메소드 상세

IsPowerOfTwo() 공개 정적인 메소드

returns true if v is a power of two or zero
public static IsPowerOfTwo ( int v ) : bool
v int
리턴 bool

IsPowerOfTwo() 공개 정적인 메소드

returns true if v is a power of two or zero
public static IsPowerOfTwo ( long v ) : bool
v long
리턴 bool

NextHighestPowerOfTwo() 공개 정적인 메소드

returns the next highest power of two, or the current value if it's already a power of two or zero
public static NextHighestPowerOfTwo ( int v ) : int
v int
리턴 int

NextHighestPowerOfTwo() 공개 정적인 메소드

returns the next highest power of two, or the current value if it's already a power of two or zero
public static NextHighestPowerOfTwo ( long v ) : long
v long
리턴 long

Ntz() 공개 정적인 메소드

Returns number of trailing zeros in a 32 bit int value.
public static Ntz ( int val ) : int
val int
리턴 int

Ntz() 공개 정적인 메소드

Returns number of trailing zeros in a 64 bit long value.
public static Ntz ( long val ) : int
val long
리턴 int

Ntz2() 공개 정적인 메소드

returns 0 based index of first set bit (only works for x!=0)
This is an alternate implementation of ntz()
public static Ntz2 ( long x ) : int
x long
리턴 int

Ntz3() 공개 정적인 메소드

returns 0 based index of first set bit
This is an alternate implementation of ntz()
public static Ntz3 ( long x ) : int
x long
리턴 int

Pop() 공개 정적인 메소드

Returns the number of bits set in the long
public static Pop ( long x ) : int
x long
리턴 int

Pop_andnot() 공개 정적인 메소드

Returns the popcount or cardinality of A & ~B Neither array is modified.
public static Pop_andnot ( long A, long B, int wordOffset, int numWords ) : long
A long
B long
wordOffset int
numWords int
리턴 long

Pop_array() 공개 정적인 메소드

Returns the number of set bits in an array of longs.
public static Pop_array ( long A, int wordOffset, int numWords ) : long
A long
wordOffset int
numWords int
리턴 long

Pop_intersect() 공개 정적인 메소드

Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified.
public static Pop_intersect ( long A, long B, int wordOffset, int numWords ) : long
A long
B long
wordOffset int
numWords int
리턴 long

Pop_union() 공개 정적인 메소드

Returns the popcount or cardinality of the union of two sets. Neither array is modified.
public static Pop_union ( long A, long B, int wordOffset, int numWords ) : long
A long
B long
wordOffset int
numWords int
리턴 long

Pop_xor() 공개 정적인 메소드

public static Pop_xor ( long A, long B, int wordOffset, int numWords ) : long
A long
B long
wordOffset int
numWords int
리턴 long

프로퍼티 상세

ntzTable 공개적으로 정적으로 프로퍼티

table of number of trailing zeros in a byte
public static byte[] ntzTable
리턴 byte[]