Click here to Skip to main content
15,886,518 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionCreate continuous path from multiple segments Pin
Member 115731191-Apr-15 3:38
Member 115731191-Apr-15 3:38 
AnswerRe: Create continuous path from multiple segments Pin
Frankie-C2-Apr-15 1:27
Frankie-C2-Apr-15 1:27 
GeneralRe: Create continuous path from multiple segments Pin
Member 115731192-Apr-15 6:47
Member 115731192-Apr-15 6:47 
GeneralRe: Create continuous path from multiple segments Pin
Frankie-C2-Apr-15 7:29
Frankie-C2-Apr-15 7:29 
GeneralRe: Create continuous path from multiple segments Pin
Member 115731192-Apr-15 7:34
Member 115731192-Apr-15 7:34 
AnswerRe: Create continuous path from multiple segments Pin
Patrice T28-Jun-15 16:58
mvePatrice T28-Jun-15 16:58 
QuestionECDSA FOR A NOOB Pin
Reversedme28-Mar-15 5:16
Reversedme28-Mar-15 5:16 
QuestionIs there a way to accelerate the following algorithm for hamming distance calculation? By assembly language? Pin
prime_tang23-Mar-15 23:40
prime_tang23-Mar-15 23:40 
The following code is a basic algorithm for hamming distance calculation, but due to the design of my application, it requires many times to use this algorithm, in order to improve application efficiency, I want to improve the efficiency of this algorithm, is there any appropriate methods? Assembly language possible?

C++
unsigned dist(const unsigned char *vec1, const unsigned char *vec2, unsigned dim)
{
    const unsigned char popCountTable[] =
    {
        0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
    };
    unsigned dist_ = 0;
    for (unsigned i = 0; i != dim; ++i)
    {
        dist_ += popCountTable[vec1[i] ^ vec2[i]];
    }
    return dist_;
}

AnswerRe: Is there a way to accelerate the following algorithm for hamming distance calculation? By assembly language? Pin
harold aptroot24-Mar-15 1:16
harold aptroot24-Mar-15 1:16 
AnswerRe: Is there a way to accelerate the following algorithm for hamming distance calculation? By assembly language? Pin
Patrice T30-Jun-15 14:41
mvePatrice T30-Jun-15 14:41 
QuestionUNION FIND Pin
Pratik Naik16-Mar-15 10:26
Pratik Naik16-Mar-15 10:26 
AnswerRe: UNION FIND Pin
Richard Andrew x6416-Mar-15 10:43
professionalRichard Andrew x6416-Mar-15 10:43 
GeneralRe: UNION FIND Pin
Pratik Naik16-Mar-15 10:46
Pratik Naik16-Mar-15 10:46 
AnswerRe: UNION FIND Pin
F-ES Sitecore16-Mar-15 23:55
professionalF-ES Sitecore16-Mar-15 23:55 
QuestionSPOJ DIVCON PROBLEM Pin
Member 114896771-Mar-15 10:54
Member 114896771-Mar-15 10:54 
AnswerRe: SPOJ DIVCON PROBLEM Pin
Richard MacCutchan1-Mar-15 22:47
mveRichard MacCutchan1-Mar-15 22:47 
QuestionLooking for someone to help create an algorithm. Pin
Member 1146989221-Feb-15 19:27
Member 1146989221-Feb-15 19:27 
AnswerRe: Looking for someone to help create an algorithm. Pin
Richard MacCutchan21-Feb-15 21:28
mveRichard MacCutchan21-Feb-15 21:28 
SuggestionRe: Looking for someone to help create an algorithm. Pin
Kornfeld Eliyahu Peter21-Feb-15 22:33
professionalKornfeld Eliyahu Peter21-Feb-15 22:33 
GeneralRe: Looking for someone to help create an algorithm. Pin
Member 1146989222-Feb-15 6:16
Member 1146989222-Feb-15 6:16 
GeneralRe: Looking for someone to help create an algorithm. Pin
Richard MacCutchan22-Feb-15 7:19
mveRichard MacCutchan22-Feb-15 7:19 
GeneralRe: Looking for someone to help create an algorithm. Pin
Member 1146989222-Feb-15 8:15
Member 1146989222-Feb-15 8:15 
GeneralRe: Looking for someone to help create an algorithm. Pin
Richard MacCutchan22-Feb-15 22:01
mveRichard MacCutchan22-Feb-15 22:01 
QuestionRe: Looking for someone to help create an algorithm. Pin
PALLA SURYA KUMAR16-Mar-15 22:28
PALLA SURYA KUMAR16-Mar-15 22:28 
AnswerRe: Looking for someone to help create an algorithm. Pin
Richard MacCutchan21-Mar-15 23:54
mveRichard MacCutchan21-Mar-15 23:54 

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.