Click here to Skip to main content
15,867,686 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: SSE and multi-core processors Pin
epitalon23-Apr-09 22:19
epitalon23-Apr-09 22:19 
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 
Hi,

Wow. Quite a question.

not sure why you are doing all this in assembly, but whatever the language, this would be my approach:
for each comparison, calculate a difference, which is negative if object1<object2, zero if equal, and positive-non-zero when object1>object2

then multiply that difference by a factor which is +1 for ascending and -1 for descending. The result indicates precede (negative), don't know (zero), or follow (positive-non-zero).

When you have multiple sort criteria, handle the primary one first, if that results in "don't know", continue with the next criterion.

[EDITED because of HTML eater]

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Tuesday, April 7, 2009 9:14 PM

GeneralRe: Best coding practice. Pin
Member 41945937-Apr-09 14:40
Member 41945937-Apr-09 14:40 
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 

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.