Click here to Skip to main content
16,016,570 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: I Completely agree with DQNOK Pin
Luc Pattyn16-Nov-07 6:08
sitebuilderLuc Pattyn16-Nov-07 6:08 
GeneralRe: How is BitBlt implemented Pin
Dan Neely15-Nov-07 10:48
Dan Neely15-Nov-07 10:48 
GeneralRe: How is BitBlt implemented Pin
DQNOK16-Nov-07 3:46
professionalDQNOK16-Nov-07 3:46 
GeneralRe: How is BitBlt implemented Pin
Luc Pattyn16-Nov-07 3:55
sitebuilderLuc Pattyn16-Nov-07 3:55 
GeneralRe: How is BitBlt implemented Pin
Force Code16-Nov-07 7:49
Force Code16-Nov-07 7:49 
GeneralRe: How is BitBlt implemented Pin
Luc Pattyn16-Nov-07 8:27
sitebuilderLuc Pattyn16-Nov-07 8:27 
GeneralRe: How is BitBlt implemented Pin
Skippums16-Nov-07 9:02
Skippums16-Nov-07 9:02 
GeneralRe: How is BitBlt implemented Pin
Force Code16-Nov-07 9:59
Force Code16-Nov-07 9:59 
OK, it looks like maybe I was mistaken:

#include < iostream >
#include < windows.h >

using namespace std;

BYTE ROP[256][256][256];
BYTE ROP2[256][256][256];

int main(int argc, char *argv[])
{
  DWORD time = GetCurrentTime();
  for (int x=0; x<256; x++)
    for (int y=0; y<256; y++)
      for (int z=0; z<256; z++)
        ROP[x][y][z] = (x&y) | (x^z) | (!y&z);
  cout << "test 1: " << GetCurrentTime()-time << endl;
  
  time = GetCurrentTime();
  for (int x=0; x<256; x++)
    for (int y=0; y<256; y++)
      for (int z=0; z<256; z++)  
        ROP2[x][y][z] = ROP[x][y][z];      
  cout << "test 2: " << GetCurrentTime()-time << endl;

  //
  time = GetCurrentTime();
  memcpy((void*)ROP2,(void*)ROP,16777216);
  cout << "test 3: " << GetCurrentTime()-time << endl;

}


and the results:

C:\dev-cpp\examples\test>test
test 1: 191
test 2: 310
test 3: 250

But the really strange thing is, in the third case, its just a block transfer of data from ROP to ROP2, but even that's slower than iterating through the entire array and calculating each value one at a time. I'll admit that makes no sense to me.
GeneralRe: How is BitBlt implemented Pin
Jheriko++17-Nov-07 17:18
Jheriko++17-Nov-07 17:18 
GeneralRe: How is BitBlt implemented Pin
Alan Balkany29-Nov-07 4:46
Alan Balkany29-Nov-07 4:46 
GeneralRe: How is BitBlt implemented Pin
Mark Churchill19-Nov-07 14:58
Mark Churchill19-Nov-07 14:58 
GeneralRe: How is BitBlt implemented Pin
Force Code19-Nov-07 20:24
Force Code19-Nov-07 20:24 
AnswerRe: How is BitBlt implemented Pin
Chris Losinger19-Nov-07 4:36
professionalChris Losinger19-Nov-07 4:36 
AnswerRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 5:04
El Corazon20-Nov-07 5:04 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 6:14
Force Code20-Nov-07 6:14 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 6:30
El Corazon20-Nov-07 6:30 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 7:05
Force Code20-Nov-07 7:05 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 7:12
El Corazon20-Nov-07 7:12 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 7:35
Force Code20-Nov-07 7:35 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 7:50
El Corazon20-Nov-07 7:50 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 8:07
Force Code20-Nov-07 8:07 
GeneralRe: How is BitBlt implemented Pin
Dexterus29-Nov-07 4:18
Dexterus29-Nov-07 4:18 
AnswerRe: How is BitBlt implemented Pin
The Nightcoder27-Nov-07 11:47
The Nightcoder27-Nov-07 11:47 
QuestionAny one know c4.5 Pin
ibnoe13-Nov-07 14:27
ibnoe13-Nov-07 14:27 
GeneralRe: Any one know c4.5 Pin
John_Adams10-Dec-07 23:36
John_Adams10-Dec-07 23:36 

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.