Jump to content


Photo
- - - - -

Hamming Weight and Distance


  • Please log in to reply
10 replies to this topic

#1 Wouter

Wouter

    Very Active

  • Members
  • PipPipPip
  • 103 posts
  • Version:LabVIEW 2011
  • Since:2006

Posted 23 December 2011 - 09:40 PM

VI Name:
Hamming Weight and Hamming Distance

Total VIs:
2

Description:
One VI calculates the hamming weight, the other the hamming distance,

Note:
-

Blockdiagram:

Hamming weight (two versions, one with parallel loop, other without, didn't tested which one was faster)
Posted Image

Hamming distance:
Posted Image


What are you thoughts on this VI?

  • Would you like to see such a function in OpenG?
  • Can you optimize the code?
  • In which package should it be included?
  • Should it be rejected?


#2 Darin

Darin

    Very Active

  • Members
  • PipPipPip
  • 168 posts
  • Version:LabVIEW 2009
  • Since:1992

Posted 23 December 2011 - 09:45 PM

Given that the OpenG standard is LV9, we should be posting VIs and snippets in that version. It is important to optimize for that version as well.

#3 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,397 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 24 December 2011 - 12:25 AM

Given that the OpenG standard is LV9, we should be posting VIs and snippets in that version. It is important to optimize for that version as well.


Yes, please post in LabVIEW 2009 (however, I understand that you may not be able to)
It's just going to make the reviewing process more difficult.
Additionally proposals should be VIs not snippets.

Cheers
-JG

#4 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 801 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 24 December 2011 - 02:23 AM

*
POPULAR

Yes, please post in LabVIEW 2009 (however, I understand that you may not be able to)

You can if you use the Code Capture Tool. Something could be said about eating dog food...

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#5 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,397 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 24 December 2011 - 02:28 AM

You can if you use the Code Capture Tool. Something could be said about eating dog food...


As mentioned above - VIs should be posted, as well as (or opposed) to snippets, for reviews.
Save for Previous would be a better workaround to host the VI.
Snippets are good to view the code in the browser (same as posting an image).

#6 Wouter

Wouter

    Very Active

  • Members
  • PipPipPip
  • 103 posts
  • Version:LabVIEW 2011
  • Since:2006

Posted 24 December 2011 - 02:31 PM

Okay, well here are the VI's then :-) (I could not edit the opening posts)

Attached Files



#7 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,652 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 25 December 2011 - 02:25 PM

You can if you use the Code Capture Tool. Something could be said about eating dog food...

Jon isn't one of the CCT developers. That would be Ton (mostly) and me.

#8 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,397 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 25 December 2011 - 03:29 PM

Jon isn't one of the CCT developers. That would be Ton (mostly) and me.


I could be wrong but I didn't take that as what jcarmody was saying (as in the context of the conversation I would not be the one using the CCT to post a snippet, Wouter would be) - I took it more as eating the LAVA community's dog food.
And yes, I am not a CCT developer - all props to Ton and Yair :)

#9 Wouter

Wouter

    Very Active

  • Members
  • PipPipPip
  • 103 posts
  • Version:LabVIEW 2011
  • Since:2006

Posted 26 December 2011 - 11:10 PM

Euh ontopic :P?

#10 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,980 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 28 December 2011 - 01:54 PM

Yes, back on topic...

So the 'hamming distance' is that it counts the non-zero characters?

Perhaps any of these implementations are faster:
HammingWeightAlternatives.png

Ton

#11 Wouter

Wouter

    Very Active

  • Members
  • PipPipPip
  • 103 posts
  • Version:LabVIEW 2011
  • Since:2006

Posted 28 December 2011 - 02:32 PM

@Ton: you mean the hamming weight... http://en.wikipedia..../Hamming_weight, and yes.

not the hamming distance ;-) http://en.wikipedia....amming_distance