Giter Club home page Giter Club logo

bitvector's People

Contributors

danielecook avatar marcazar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zeeev danielecook

bitvector's Issues

Please consider making Base public

Base: seq[T]

Base is not public so it's not very convenient to directly map a chunk of data, like a string, that is already the bitfield we want:

  bitField = newBitVector[uint](strBitField.len*8)
  copyMem(bitField.Base[0].addr, strBitField[0].unsafeAddr, strBitField.len)

That, or make helper procs to init bitfield from most common sequential data structures. But still I see no harm in making Base public so people can do whatever they want to it.

cap size

Hi @MarcAzar,

Sorry to bother you again, but I'm not sure the constructor is working properly. Here is my code:

 echo "bits requested:", ovls[0].l1
 var aCoverage = newBitVector[uint](ovls[0].l1)
 echo aCoverage
 for i in 0..(ovls[0].l1 - 1):
   echo i, " ", ovls[0].l1 - 1
   aCoverage[i] = 0

here is my printed info:

bits requested:10278
BitVector with capacity of 10240 bits and 160 unique elements

Hitting the assert:

Error: unhandled exception: /home/zkronenberg/tools/nim-pb/nimbleDir/pkgs/BitVector-0.4.8/bitvector.nim(67, 9) `i < b.cap and
  0 <= i` Index out of range [AssertionError]

Warning when installing with nimble

nimble install bitvector
Downloading https://github.com/MarcAzar/BitVector using git
Warning: Package 'BitVector' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'BitVector.nim', but a file named 'bloom.nim' was found. This will be an error in the future.
Hint: If this is the primary source file in the package, rename it to 'BitVector.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'BitVector', then move it into a 'BitVector/' subdirectory. If it's a test file or otherwise not required to build the the package 'BitVector.nim', prevent its installation by adding skipFiles = @["bloom.nim"] to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.

Bit vector constructor

Hi @MarcAzar,

It appears that this code yields the wrong size of bit vector, or did I call the API wrong?


var len = 100
var ba = newBitVector[uint](len)
echo ba

return:

BitVector with capacity of 64 bits and 1 unique elements

then :


proc printBv*(bv: BitVector, n: int) =
 for i in 0..n-1:
  stdout.write(bv[i])
 stdout.write('\n')
var len = 100
var ba = newBitVector[uint](len)
echo ba
printBv(ba, len)

result:

Error: unhandled exception: /Users/zkronenberg/.nimble/pkgs/BitVector-0.4.8/bitvector.nim(63, 9) `i < b.cap and 0 <= i` Index out of range [AssertionError] 0000000000000000000000000000000000000000000000000000000000000000Error: execution of an external program failed: '/Users/zkronenberg/Desktop/testbv '

Bloom Filter Fails

I am getting this error when trying to build.

Error: execution of an external compiler program 'clang -c  -w -pthread  -I/usr/local/Cellar/nim/0.20.0/nim/lib -I'/Users/dancook/Dropbox (Personal)/GIT/seq-collection' -o /Users/dancook/.cache/nim/sc_d/murmur3.c.o murmur3.c' failed with exit code: 1

clang: error: no such file or directory: 'murmur3.c'
clang: error: no input files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.