public class BitCount extends Object
int.
Derived from http ://dalkescientific.com/writings/diary/popcnt.c
| Constructor and Description |
|---|
BitCount() |
| Modifier and Type | Method and Description |
|---|---|
static int |
count_2(int[] buffer)
Population count, skipping words at even positions
|
static int |
count_2(int[] buffer,
int n)
Population count, skipping words at even positions
|
static int |
count(int[] buffer)
Population count
|
static int |
count(int[] buffer,
int n)
Population count
|
static void |
main(String[] args)
Test
|
public static int count(int[] buffer)
buffer - array of intpublic static int count(int[] buffer,
int n)
It counts 24 words at a time, then 3 at a time, then 1 at a time
buffer - array of intn - number of elements of buffer to countpublic static int count_2(int[] buffer)
buffer - array of intpublic static int count_2(int[] buffer,
int n)
It counts 24 words at a time, then 3 at a time, then 1 at a time
buffer - array of intn - number of elements of buffer to countpublic static void main(String[] args)
args - Copyright © 2011–2017. All rights reserved.