Questions tagged [population-count]

use this tag when question involves taking a census or counting things, such as people or objects in a collection

Population count may refer to:

  • A census, the process of obtaining information about every member of a population (not necessarily a human population)
  • Hamming weight, the number of non-zero entries ('1' bits) in a byte, string, word, array or other similar data structure
12 questions
9
votes
2 answers

Counting 1 bits (population count) on large data using AVX-512 or AVX-2

I have a long chunk of memory, say, 256 KiB or longer. I want to count the number of 1 bits in this entire chunk, or in other words: Add up the "population count" values for all bytes. I know that AVX-512 has a VPOPCNTDQ instruction which counts the…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
9
votes
3 answers

How to enable support for the POPCNT instruction / intrinsic on my computer?

I tried to run the following program in my computer (Fedora 17 32bit). How can I enable my system to support the popcnt instruction for fast population count? #include #include int main(void) { int pop =…
afancy
  • 673
  • 4
  • 10
  • 18
2
votes
1 answer

Question about bit population count Algorithm

POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; POPCNT_MODULO = 0x3F; number of bits turned on(1) in "num" = ((("num" * POPCNT_MULT)…
imelon2
  • 123
  • 4
2
votes
1 answer

What does the Surv error message "start and stop are different lengths" actually mean?

I am analysing a set of lifespan data based on a population of animals (C. elegans) and I'm not sure if I have the data set up incorrectly or I'm using the Surv function incorrectly. I have a table with the number of days since the start and the…
Linda
  • 21
  • 2
1
vote
2 answers

How to calculate how many bits in a decimal number is 1?

This program I created in RISC-V RARS 1.3 application is designed to take a decimal number and count how many bits are in that number. The one I am testing is the decimal number 5, and this program should work for any positive number I put on t1. …
stevenu
  • 11
  • 2
0
votes
0 answers

State space model for population time series - general worries and fit

First time poster, long time reader. I am also totally new to Bayesian analyses, so please be gentle with me. I am trying to fit a model to observations of adult organisms that are semivoltine--that is, they take two years to reach adulthood and…
0
votes
0 answers

insufficient description of input data for individual CJS mark-recapture model in stan user guide

EDIT This issue appears to have resulted from rstan not having up-to-date stan syntax because of the restrictions that CRAN places on package updates. A more up-to-date rstan package appears to be available at the mc-stan repo, but does not yet have…
ghaines
  • 23
  • 5
0
votes
0 answers

How to compare Shannon index between creeks with a different treatment (ungrazed versus grazed)?

Here are my data: A) 9 different creeks. B) 3 different treatments (Intensively grazed, Extensively grazed, Ungrazed) C) Sampling: fish, insects, "crabs & shrimp" (let's call this group shellfish) and benthos D) There are 3 creeks for each…
Tamas
  • 1
  • 2
0
votes
0 answers

Calculate population size with multiple sub-annual projection matrices

I have a population vector with juveniles and adults that I would like to record new population size after each sub-annual transition. The expected output would have the original population vector on the first row, and population at each following…
hnguyen
  • 772
  • 6
  • 17
0
votes
1 answer

How do I remove negative X axis labels in a population pyramid?

I have a population pyramid but the x axis on one side is negative, is there a way to rename just the negative x axis so that it is positive? # Draw Plot plt.figure(figsize=(13,10), dpi= 80) group_col = 't1_gender' order_of_bars =…
Sanch
  • 367
  • 2
  • 11
-1
votes
1 answer

Population Growth in Python

I have an assignment and I can't figure out what is wrong: Write a Python program that calculates population growth. read the initial population read how many generations will be calculated ask if user wants to calculate another population For each…
-2
votes
1 answer

Bit scan forward / back and popcount in pure Pascal? Porting from asm versions

I am porting a Delphi 32bit app to a Pascal Script - which does not support asm, and I only have 64bit machines so I cannot even run the code and mimic it. {$ASMMODE INTEL} function BitScanForward(var BB:Int64):Integer; assembler; asm bsf eax,…
Ozz Nixon
  • 159
  • 1
  • 8