Julia convert BitArray to Integer array

791 views
Skip to first unread message

Sweta Yamini

unread,
Sep 28, 2015, 1:01:47 AM9/28/15
to julia-users


Hi,

I am new to Julia. I have an N X N BitArray that I want to pack to Uint8 of size N X ceil(N/8)

I tried to reinterpret the array as

packed = reinterpret(Uint8, mybitarray)

but it gives me an error "auto_unbox: unable to determine argument type"

I tried

packed = convert(Array{Uint8}, bitpack(mybitarray))

but it just gives me an N X N Uint8 array with 0 and 1.

Could you help me with this?

Sweta

wil...@gmail.com

unread,
Sep 28, 2015, 8:10:53 AM9/28/15
to julia-users
Try `reinterpret(UInt8, x.chunks)`
Reply all
Reply to author
Forward
0 new messages