Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLib Linking warning [modified] Pin
transoft14-May-09 6:14
transoft14-May-09 6:14 
AnswerRe: Lib Linking warning Pin
Stuart Dootson14-May-09 9:03
professionalStuart Dootson14-May-09 9:03 
GeneralRe: Lib Linking warning Pin
transoft14-May-09 10:49
transoft14-May-09 10:49 
GeneralRe: Lib Linking warning Pin
Stuart Dootson14-May-09 13:13
professionalStuart Dootson14-May-09 13:13 
QuestionHow to find input array index from sorted output? Pin
Jaguks14-May-09 5:43
Jaguks14-May-09 5:43 
AnswerRe: How to find input array index from sorted output? Pin
CPallini14-May-09 6:59
mveCPallini14-May-09 6:59 
GeneralRe: How to find input array index from sorted output? Pin
Member 419459314-May-09 17:17
Member 419459314-May-09 17:17 
AnswerRe: How to find input array index from sorted output? [modified] Pin
Member 419459315-May-09 3:22
Member 419459315-May-09 3:22 
Jaguks,

Sorry for the double post, but I figured out what went wrong.

The second block of code is just reporting which gradient elements are in their original positions (as created). Only one remains in the same place, gradient[1][1][3] created from R[1][1][3] and S[1][1][3].

To do what you want to do (report the initial creating index values) you must save the creating index values along with the gradient value, either in a structure containing all four of the items (an array of structures instead of an array of gradient values), or else in a separate array of structures (each structure containing the index values) that is built along with building the gradient value array. When swapping the gradient values, you must also swap the index values structures if they are a separate array, or else swap the four element structure instead of just the gradient value if they are in a combined stricture.

The reporting code block can then eliminate the test and then just report the gradient and its associated generating index values, and the R and S values. The generating index values would come from either from the combined 4 element array of structures, or from using both the gradient array and the index values array of structures. In the new report, i,j,l would be used only to select the gradient value and its associated saved index values, the saved index values would be used to select the R and S values for reporting, and for reporting the i,j,l values.

In general, you must save the index values with each created value to be sorted in order to be able to report which index created any sorted value.

Dave.

modified on Friday, May 15, 2009 10:52 AM

QuestionGlobal custom cursor that never change? Pin
Tommy Svensson14-May-09 4:39
Tommy Svensson14-May-09 4:39 
AnswerRe: Global custom cursor that never change? Pin
Madhu Nair14-May-09 7:59
Madhu Nair14-May-09 7:59 
Questionhow to resize, rename, drag... the VC widget(dialog,button etc.) in runtime like in ide status? Pin
JustinChen00714-May-09 4:35
JustinChen00714-May-09 4:35 
QuestionRe: how to resize, rename, drag... the VC widget(dialog,button etc.) in runtime like in ide status? Pin
Maximilien14-May-09 5:14
Maximilien14-May-09 5:14 
AnswerRe: how to resize, rename, drag... the VC widget(dialog,button etc.) in runtime like in ide status? Pin
JustinChen00714-May-09 15:04
JustinChen00714-May-09 15:04 
GeneralRe: how to resize, rename, drag... the VC widget(dialog,button etc.) in runtime like in ide status? Pin
JustinChen00717-May-09 23:58
JustinChen00717-May-09 23:58 
QuestionTool Bar Question Pin
Software200714-May-09 3:52
Software200714-May-09 3:52 
QuestionRe: Tool Bar Question Pin
Maximilien14-May-09 5:01
Maximilien14-May-09 5:01 
Questionabout the data input conversion Pin
lalit kumar jayswal14-May-09 3:51
lalit kumar jayswal14-May-09 3:51 
AnswerRe: about the data input conversion [modified] Pin
jeron114-May-09 4:11
jeron114-May-09 4:11 
QuestionRe: about the data input conversion Pin
David Crow14-May-09 4:48
David Crow14-May-09 4:48 
AnswerRe: about the data input conversion Pin
David Crow14-May-09 4:49
David Crow14-May-09 4:49 
QuestionStarting and stopping service as a standard user Pin
andypandy214-May-09 3:44
andypandy214-May-09 3:44 
AnswerRe: Starting and stopping service as a standard user Pin
Madhu Nair14-May-09 8:39
Madhu Nair14-May-09 8:39 
QuestionVS8: how to link C static library in Windows Forms Pin
sakthii14-May-09 3:31
sakthii14-May-09 3:31 
AnswerRe: VS8: how to link C static library in Windows Forms Pin
Stuart Dootson14-May-09 4:21
professionalStuart Dootson14-May-09 4:21 
GeneralRe: VS8: how to link C static library in Windows Forms Pin
sakthii14-May-09 22:40
sakthii14-May-09 22:40 

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.