Click here to Skip to main content
15,887,812 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: SSE and multi-core processors Pin
led mike24-Apr-09 4:49
led mike24-Apr-09 4:49 
Questionrow major and column major order Pin
Sadaiyappan8-Apr-09 10:49
Sadaiyappan8-Apr-09 10:49 
AnswerRe: row major and column major order Pin
Luc Pattyn8-Apr-09 11:19
sitebuilderLuc Pattyn8-Apr-09 11:19 
GeneralRe: row major and column major order Pin
Sadaiyappan8-Apr-09 11:51
Sadaiyappan8-Apr-09 11:51 
GeneralRe: row major and column major order Pin
Luc Pattyn8-Apr-09 12:34
sitebuilderLuc Pattyn8-Apr-09 12:34 
QuestionBest coding practice. Pin
Member 41945936-Apr-09 18:08
Member 41945936-Apr-09 18:08 
AnswerRe: Best coding practice. [modified] Pin
Luc Pattyn7-Apr-09 4:27
sitebuilderLuc Pattyn7-Apr-09 4:27 
GeneralRe: Best coding practice. Pin
Member 41945937-Apr-09 14:40
Member 41945937-Apr-09 14:40 
Luc,

Thank you for the reply.

And I was worried about adding two XCHGs, and you want me to put in a MUL? OMG! Smile | :)

Actually, you can get the same effect for descending by just changing the ordering of the compare arguments, i.e. compare object2 to object1. This is exactly what C++ does for an IF, it keeps your comparison code (i.e. >=, generates a jae or jge depending on sign) but reverses the compared values and skips around the body of the IF if it is not >=. This, however, leaves the code much different than the code for an ascending sort, somewhat harder to maintain and enhance. That was why I was thinking about XCHG'ing the indices and keeping the same code for both sort types.

Another difficulty with that approach is that floating compares do not affect the usual flags, only the flags in the FPU. You have to extract the FPU flags and make special compares to effect a ja or a jb, and the tests are of a TEST nature with a je or jne, not a ja or jb. I have all of this working, and I am now testing the tie-breaker/secondary_key code.

Dave Augustine.
GeneralRe: Best coding practice. Pin
Luc Pattyn7-Apr-09 15:21
sitebuilderLuc Pattyn7-Apr-09 15:21 
GeneralRe: Best coding practice. Pin
Member 41945937-Apr-09 16:23
Member 41945937-Apr-09 16:23 
GeneralRe: Best coding practice. Pin
Member 419459310-Apr-09 19:55
Member 419459310-Apr-09 19:55 
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 0:39
Luc 64801111-Apr-09 0:39 
GeneralRe: Best coding practice. Pin
Member 419459311-Apr-09 5:51
Member 419459311-Apr-09 5:51 
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 6:18
Luc 64801111-Apr-09 6:18 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 8:29
Member 419459315-Apr-09 8:29 
GeneralRe: Best coding practice. Pin
Luc 64801115-Apr-09 8:39
Luc 64801115-Apr-09 8:39 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 9:45
Member 419459315-Apr-09 9:45 
QuestionRotation of Bitmap Pin
CodeOfLife5-Apr-09 16:21
CodeOfLife5-Apr-09 16:21 
AnswerRe: Rotation of Bitmap [modified] Pin
Luc Pattyn5-Apr-09 16:30
sitebuilderLuc Pattyn5-Apr-09 16:30 
GeneralRe: Rotation of Bitmap Pin
CodeOfLife6-Apr-09 6:37
CodeOfLife6-Apr-09 6:37 
GeneralRe: Rotation of Bitmap Pin
Luc Pattyn6-Apr-09 6:59
sitebuilderLuc Pattyn6-Apr-09 6:59 
QuestionCreating RSOM from SOM Pin
Jasmine Pomelo4-Apr-09 14:04
Jasmine Pomelo4-Apr-09 14:04 
QuestionRe: Creating RSOM from SOM Pin
CPallini6-Apr-09 21:39
mveCPallini6-Apr-09 21:39 
AnswerRe: Creating RSOM from SOM Pin
Jasmine Pomelo9-Apr-09 9:38
Jasmine Pomelo9-Apr-09 9:38 
QuestionSingle Elimination - Tournament Brackets Pin
aslamc2-Apr-09 9:32
aslamc2-Apr-09 9:32 

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.