Skip to content

Instantly share code, notes, and snippets.

@jiahao
jiahao / m012.jl
Last active May 21, 2017 06:02
Matvecs with matrices in PLINK v1 BEM format
import Base: convert, rand, size, getindex, A_mul_B!
immutable PLINK1Matrix <: AbstractMatrix{UInt8}
m :: Int
n :: Int
data :: Array{UInt8}
end
size(M::PLINK1Matrix, i::Int) = i==1 ? M.m : i==2 ? M.n : error()
size(M::PLINK1Matrix) = (M.m, M.n)