How to operate on bit strings > 64 bits

This is a discussion on How to operate on bit strings > 64 bits within the C Programming forums, part of the General Programming Boards category; Hi all, I have a matrix of 300 by 15,000 which is intended for my problem of: 300 data items ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    1

    How to operate on bit strings > 64 bits

    Hi all,

    I have a matrix of 300 by 15,000 which is intended for my problem of:

    300 data items to be distributed to 15,000 receivers, with
    each data item may go to one or more (up to 15,000) receivers, and
    each receiver may receive one or more (up to 300) data items.


    The actual distribution mechanism has the capability to deliver
    multiple data items to multiple receivers in one same round,
    this may be unusual but it's something I definitely should take
    advantage of.

    So I need to figure out a good set of distribution grouping
    in order to utilize the distribution mechanism advantage to
    minimize my total distribution cost - time especially.

    It seems like that whichever heuristic that I may choose to work on,
    I will need to operate on the data/receiver relationship matrix
    extensively. This matrix is large but simple, i.e. it's a binary
    relationship matrix, each entry simply indicates that
    "if this data goes to this receiver or not".

    I certainly will have a lot of groupings to explore, and if these
    data/receiver relationship can be expressed in one long bit string
    for each data or each receiver, and if I can AND/OR/XOR... on
    these long bit strings straightforwardly... My exploration will
    at least have a computational feasibility.

    My problems at hand are thus:

    1. How do I represent a bit string that carries more than 64 bits in C?
    And which will allow me to -

    2. Operate on these bit strings with primitive C logical operators efficiently?

    I've looked into packed structures, but found no way to operate
    on a structuralized long bit string with primitive C logical operators.

    Suggestions, advice, tutorials please?

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,047
    Use three or more bitfields to store the > 64 bit strings.
    Google "disk bitmaps" which should give be a starting point.
    Bitmaps are stored on disk and tell the OS which sectors are free.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File IO
    By Jack1982 in forum C++ Programming
    Replies: 9
    Last Post: 10-15-2007, 01:14 AM
  2. binary numbers
    By watshamacalit in forum C Programming
    Replies: 4
    Last Post: 01-14-2003, 10:06 PM
  3. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 03:59 PM
  4. 64 bit variables
    By Yawgmoth in forum C Programming
    Replies: 11
    Last Post: 12-19-2002, 12:55 PM
  5. 64 bit
    By stormbringer in forum C Programming
    Replies: 2
    Last Post: 10-29-2002, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21