Click here to Skip to main content
15,896,429 members
Home / Discussions / C#
   

C#

 
AnswerRe: Application Domain Pin
EliottA15-Jan-10 2:44
EliottA15-Jan-10 2:44 
AnswerRe: Application Domain Pin
Eddy Vluggen15-Jan-10 3:11
professionalEddy Vluggen15-Jan-10 3:11 
GeneralRe: Application Domain Pin
dataminers15-Jan-10 9:50
dataminers15-Jan-10 9:50 
GeneralRe: Application Domain Pin
Eddy Vluggen15-Jan-10 11:17
professionalEddy Vluggen15-Jan-10 11:17 
GeneralRe: Application Domain Pin
dataminers16-Jan-10 2:23
dataminers16-Jan-10 2:23 
GeneralRe: Application Domain Pin
Eddy Vluggen16-Jan-10 8:50
professionalEddy Vluggen16-Jan-10 8:50 
GeneralRe: Application Domain Pin
dataminers15-Jan-10 10:31
dataminers15-Jan-10 10:31 
QuestionCaching powers of 2 -- performance consideration Pin
Lutosław14-Jan-10 22:36
Lutosław14-Jan-10 22:36 
I have implemented my own "BitVecto64" class. I just wanted to have an indexer which would return a boolean value, use 64-bit integers, and have no length limit (eg. up to 64) - a true vector where all elements are from a set {0,1}.

The indexer is implemented as following (length of a vector unlimited, so I use an array of int64 insted of a single one):

public bool GetBit(int bit)
{
    if (bit < 0 || bit >= BitCount)
        throw new ArgumentOutOfRangeException("bit");
    return (table[bit / BITS_IN_WORD] & CreateMask(bit)) > 0;
}
public static ulong CreateMask(int i)
{
    return (ulong)1 << (i % BITS_IN_WORD);
}


My question: Is there any sens in caching masks? that is: {0x0, 0x1, 0x2,... ,0x10, 0x20,....0x100000...}. It would take 0,5 kB.

Greetings - Jacek

AnswerRe: BitVector performance question [modified] Pin
Covean14-Jan-10 23:00
Covean14-Jan-10 23:00 
GeneralRe: BitVector performance question Pin
Lutosław14-Jan-10 23:55
Lutosław14-Jan-10 23:55 
GeneralRe: BitVector performance question Pin
Covean15-Jan-10 0:09
Covean15-Jan-10 0:09 
GeneralRe: BitVector performance question Pin
Lutosław15-Jan-10 0:33
Lutosław15-Jan-10 0:33 
JokeRe: BitVector performance question Pin
Covean15-Jan-10 0:54
Covean15-Jan-10 0:54 
GeneralRe: BitVector performance question Pin
Lutosław15-Jan-10 0:04
Lutosław15-Jan-10 0:04 
GeneralRe: BitVector performance question Pin
Lutosław15-Jan-10 0:09
Lutosław15-Jan-10 0:09 
GeneralRe: BitVector performance question Pin
Luc Pattyn15-Jan-10 1:47
sitebuilderLuc Pattyn15-Jan-10 1:47 
AnswerRe: Caching powers of 2 -- performance consideration Pin
harold aptroot15-Jan-10 4:38
harold aptroot15-Jan-10 4:38 
GeneralRe: Caching powers of 2 -- performance consideration Pin
Lutosław15-Jan-10 11:24
Lutosław15-Jan-10 11:24 
GeneralRe: Caching powers of 2 -- performance consideration Pin
harold aptroot15-Jan-10 11:51
harold aptroot15-Jan-10 11:51 
QuestionGenerate Color Book File Format (.acb file) for Photoshop using .NET or Other Language Pin
shaktisinh14-Jan-10 19:13
shaktisinh14-Jan-10 19:13 
Questionhow to inflate GDI+ Regoins Pin
VCsamir14-Jan-10 19:02
VCsamir14-Jan-10 19:02 
QuestionAny one having code to compare two xml files....? Pin
koolprasad200314-Jan-10 18:48
professionalkoolprasad200314-Jan-10 18:48 
AnswerRe: Any one having code to compare two xml files....? Pin
VCsamir14-Jan-10 18:56
VCsamir14-Jan-10 18:56 
GeneralRe: Any one having code to compare two xml files....? Pin
koolprasad200314-Jan-10 20:39
professionalkoolprasad200314-Jan-10 20:39 
GeneralRe: Any one having code to compare two xml files....? Pin
VCsamir14-Jan-10 21:17
VCsamir14-Jan-10 21:17 

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.