Click here to Skip to main content
15,894,539 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help compiling OpenCV Pin
Jochen Arndt3-Apr-18 23:02
professionalJochen Arndt3-Apr-18 23:02 
QuestionCreating a Simple Employee Database using inheritance in c++. Pin
Tarun Jha2-Apr-18 0:53
Tarun Jha2-Apr-18 0:53 
SuggestionRe: Creating a Simple Employee Database using inheritance in c++. Pin
Richard MacCutchan2-Apr-18 0:57
mveRichard MacCutchan2-Apr-18 0:57 
GeneralRe: Creating a Simple Employee Database using inheritance in c++. Pin
Tarun Jha2-Apr-18 0:59
Tarun Jha2-Apr-18 0:59 
GeneralRe: Creating a Simple Employee Database using inheritance in c++. Pin
Richard MacCutchan2-Apr-18 1:10
mveRichard MacCutchan2-Apr-18 1:10 
GeneralRe: Creating a Simple Employee Database using inheritance in c++. Pin
Tarun Jha2-Apr-18 2:32
Tarun Jha2-Apr-18 2:32 
AnswerRe: Creating a Simple Employee Database using inheritance in c++. Pin
Richard MacCutchan2-Apr-18 1:19
mveRichard MacCutchan2-Apr-18 1:19 
GeneralRe: Creating a Simple Employee Database using inheritance in c++. Pin
Tarun Jha2-Apr-18 1:19
Tarun Jha2-Apr-18 1:19 
GeneralRe: Creating a Simple Employee Database using inheritance in c++. Pin
Richard MacCutchan2-Apr-18 1:26
mveRichard MacCutchan2-Apr-18 1:26 
QuestionIs it possible to link a DLL in another DLL and call its functions? Pin
manoharbalu2-Apr-18 0:29
manoharbalu2-Apr-18 0:29 
AnswerRe: Is it possible to link a DLL in another DLL and call its functions? Pin
Richard MacCutchan2-Apr-18 0:59
mveRichard MacCutchan2-Apr-18 0:59 
QuestionMFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
janaswamy uday30-Mar-18 2:34
janaswamy uday30-Mar-18 2:34 
AnswerRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
Victor Nijegorodov30-Mar-18 3:34
Victor Nijegorodov30-Mar-18 3:34 
GeneralRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
janaswamy uday30-Mar-18 4:37
janaswamy uday30-Mar-18 4:37 
GeneralRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
Victor Nijegorodov30-Mar-18 6:29
Victor Nijegorodov30-Mar-18 6:29 
GeneralRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
janaswamy uday30-Mar-18 7:42
janaswamy uday30-Mar-18 7:42 
GeneralRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
Richard Andrew x6430-Mar-18 15:11
professionalRichard Andrew x6430-Mar-18 15:11 
SuggestionRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
Jochen Arndt30-Mar-18 22:17
professionalJochen Arndt30-Mar-18 22:17 
GeneralRe: MFC DDX_Radio causes debug assertion failure when DoDataExchange is called Pin
janaswamy uday1-Apr-18 21:05
janaswamy uday1-Apr-18 21:05 
QuestionHow to map a matrix index to a memory location Pin
Leif Simon Goodwin29-Mar-18 1:26
Leif Simon Goodwin29-Mar-18 1:26 
We have a device that returns data from a 2D grid thus each data value is indexed by its row and column. The number of rows and columns is not fixed, as the device can be reconfigured, but in normal use the number of rows and columns does not change. We store the data values in memory for subsequent retrieval.

Our problem is how to convert a row + column pair {x,y} into an address in the memory. This sounds trivial:

offset = x * (total_number_of_columns) + y;

However, we have to do this very very quickly, and using as little processor power as possible. A multiplication is not good. We do not need to store the values contiguously as row, row, row etc. We do have limited memory so cannot be too wasteful.

One way is to store the data values in a grid whose number of columns is always a power of 2. Thus if our device generates 20 rows and 50 columns of data, we store them in a 20 rows by 64 columns grid. This means the data is not packed tightly in memory. To convert {x,y} into a memory location:

offset = x << 6 + y;

The quickest way I can think of is to use a look up table:

offset = lookup[x] + y;

Thus lookup is the offset to the start of each row in memory.

So, my question is how can we do this as fast and simply as possible? Is there a quicker way?
AnswerRe: How to map a matrix index to a memory location Pin
Jochen Arndt29-Mar-18 2:39
professionalJochen Arndt29-Mar-18 2:39 
GeneralRe: How to map a matrix index to a memory location Pin
Leif Simon Goodwin29-Mar-18 3:12
Leif Simon Goodwin29-Mar-18 3:12 
GeneralRe: How to map a matrix index to a memory location Pin
harold aptroot29-Mar-18 3:44
harold aptroot29-Mar-18 3:44 
AnswerRe: How to map a matrix index to a memory location Pin
Daniel Pfeffer29-Mar-18 5:06
professionalDaniel Pfeffer29-Mar-18 5:06 
QuestionWhat is the best tool to find C++ Memory issues Pin
ptr_Electron29-Mar-18 1:06
ptr_Electron29-Mar-18 1:06 

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.