Click here to Skip to main content
15,913,722 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionCounting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 4:51
Tadeusz Westawic24-Jun-10 4:51 
AnswerRe: Counting set bits in bitmap [modified] Pin
harold aptroot24-Jun-10 5:14
harold aptroot24-Jun-10 5:14 
GeneralRe: Counting set bits in bitmap [modified] Pin
Tadeusz Westawic24-Jun-10 6:07
Tadeusz Westawic24-Jun-10 6:07 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 6:19
harold aptroot24-Jun-10 6:19 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 7:01
harold aptroot24-Jun-10 7:01 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 7:46
Tadeusz Westawic24-Jun-10 7:46 
GeneralRe: Counting set bits in bitmap Pin
Luc Pattyn24-Jun-10 8:06
sitebuilderLuc Pattyn24-Jun-10 8:06 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 10:27
Tadeusz Westawic24-Jun-10 10:27 
What and why I count could be for any reason that yields meaningful results upon well-defined processing.

Can you do parallel swimming adders?

The generic term is 'collision counting' it is first related to 'collision detection'. Although the old raster arcade games employed these techniques extensively my work is not about games and accomodation in Windows is paltry; so lets say analysis where you want to count hits by vectors against a surface (in simplest form but my work is more mundane).

So, this problem implies we have some loci in discrete 3-space: the surface under test, and one each also for each projectile path, lets say 16 path locii.

Immediately map the discrete loci to congruent 2-space bitmaps, call the size (w x h).
Actuate three new bitmaps bmSRC, bmTGT and bmRSLT each (16w x 16h).
Tile bmSRC with 16 identical copies of the surface bm.
Tile bmTGT as mosaic of the 16 paths.
AND the bms into bmRSLT

The number of bits set in bmRSLT represents the number of paths intersecting the surface.

******************************

That looks like I solved 16 sets of simultaneous equations in parallel but if one needs to know "WHERE?" the collisions occurred then one is in need of an algorithm. So one does not employ thes techniques if one needs to know "WHERE?", but when the yes/no answer to "IF" will suffice.

You would also normally avoid "HOW MANY?", but in the case of a running model, one needs to benchmark and perform some "reality check" routines and count the actual number of bits to compare against a statistical projection.

Blit happens.

Tadeusz Westawic

Sum quid sum.
GeneralRe: Counting set bits in bitmap [modified] Pin
Luc Pattyn24-Jun-10 11:00
sitebuilderLuc Pattyn24-Jun-10 11:00 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 8:07
harold aptroot24-Jun-10 8:07 
GeneralRe: swimming adder Pin
Luc Pattyn24-Jun-10 8:32
sitebuilderLuc Pattyn24-Jun-10 8:32 
GeneralRe: Counting set bits in bitmap [modified] Pin
Tadeusz Westawic24-Jun-10 9:04
Tadeusz Westawic24-Jun-10 9:04 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 11:15
harold aptroot24-Jun-10 11:15 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 11:47
Tadeusz Westawic24-Jun-10 11:47 
GeneralRe: Counting set bits in bitmap Pin
Luc Pattyn24-Jun-10 12:26
sitebuilderLuc Pattyn24-Jun-10 12:26 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 14:12
Tadeusz Westawic24-Jun-10 14:12 
GeneralRe: Counting set bits in bitmap Pin
Member 419459326-Jun-10 17:28
Member 419459326-Jun-10 17:28 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot27-Jun-10 2:28
harold aptroot27-Jun-10 2:28 
GeneralRe: Counting set bits in bitmap Pin
Member 419459327-Jun-10 5:49
Member 419459327-Jun-10 5:49 
AnswerRe: Counting set bits in bitmap Pin
Luc Pattyn24-Jun-10 5:20
sitebuilderLuc Pattyn24-Jun-10 5:20 
Questionhex calculator Pin
Tadeusz Westawic23-Jun-10 2:50
Tadeusz Westawic23-Jun-10 2:50 
AnswerRe: hex calculator Pin
Richard MacCutchan23-Jun-10 2:58
mveRichard MacCutchan23-Jun-10 2:58 
GeneralRe: hex calculator Pin
Tadeusz Westawic23-Jun-10 16:40
Tadeusz Westawic23-Jun-10 16:40 
GeneralRe: hex calculator Pin
Richard MacCutchan23-Jun-10 21:42
mveRichard MacCutchan23-Jun-10 21:42 
GeneralRe: hex calculator Pin
wbgxx29-Jun-10 7:12
wbgxx29-Jun-10 7:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.