# bitarray

##### 将 (0/1) 字符串加载到位数组中(Load a (0/1) string into a bit array)

2021-06-09 10:50:27    分类:技术分享    c#   string   bitarray

##### How do I implement a bit array in C / Objective C

iOS / Objective-C: I have a large array of boolean values. This is an inefficient way to store these values – at least eight bits are used for each element when only one is needed. How can I optimise?

2021-06-01 20:11:16    分类:问答    objective-c   c   ios   core-foundation   bitarray

##### Convert a byte or int to bitset

I have the following: int num=Integer.parseInt(lineArray[0]); byte numBit= num & 0xFF; Is there any very simple way to convert numBit to a bit array? Or even better, is there a way to bypass the byte conversion of the int and go straigh from num to a bit array? Thanks

2021-06-01 18:31:09    分类:问答    java   type-conversion   bitarray

##### 慢按位运算(Slow bitwise operations)

2021-06-01 16:04:51    分类:技术分享    python   numpy   bitwise-operators   bitarray   bitstring

##### Julia中的Array {Bool}和BitArray有什么区别，它们之间有何关系？(What's the difference between Array{Bool} and BitArray in Julia and how are they related?)

2021-06-01 11:07:54    分类:技术分享    arrays   boolean   julia   bitarray

##### Fastest way to calculate primes in C#?

I actually have an answer to my question but it is not parallelized so I am interested in ways to improve the algorithm. Anyway it might be useful as-is for some people. int Until = 20000000; BitArray PrimeBits = new BitArray(Until, true); /* * Sieve of Eratosthenes * PrimeBits is a simple BitArray where all bit is an integer * and we mark composite numbers as false */ PrimeBits.Set(0, false); // You don't actually need this, just PrimeBits.Set(1, false); // remindig you that 2 is the smallest prime for (int P = 2; P < (int)Math.Sqrt(Until) + 1; P++) if (PrimeBits.Get(P)) // These are going to

2021-05-17 07:46:02    分类:问答    c#   .net   performance   algorithm   bitarray

##### 用于在位数组中搜索连续的置位/清除位的快速代码？(Fast code for searching bit-array for contiguous set/clear bits?)

2021-05-13 14:47:25    分类:技术分享    c++   c   bitarray   bitvector

##### Load a (0/1) string into a bit array

What is the smartest way to load a string like "10101011101010" directly into a new bit array? (not a byte array) (The bits should remain in the same order as in the list.)

2021-05-01 16:46:20    分类:问答    c#   string   bitarray

##### Unset the most significant bit in a word (int32) [C]

How can I unset the most significant setted bit of a word (e.g. 0x00556844 -> 0x00156844)? There is a __builtin_clz in gcc, but it just counts the zeroes, which is unneeded to me. Also, how should I replace __builtin_clz for msvc or intel c compiler? Current my code is int msb = 1<< ((sizeof(int)*8)-__builtin_clz(input)-1); int result = input & ~msb; UPDATE: Ok, if you says that this code is rather fast, I'll ask you, how should I add a portability to this code? This version is for GCC, but MSVC & ICC?

2021-04-30 03:32:05    分类:问答    c   micro-optimization   bitarray

##### python位数组（性能）(python bit array (performant))

2021-04-29 18:19:53    分类:技术分享    python   performance   bitarray   bloom-filter