Skip to content

Instantly share code, notes, and snippets.

type Type1
a::Matrix{Float64} # why not vector of vectors?
b::Vector{Matrix{Float64}}
c::Vector{Float64}
d::Float64
e::Int64
end
type Type2{T}
a::Matrix{T} # why not vector of vectors?
type Type1
a::Matrix{Float64} # why not vector of vectors?
b::Vector{Matrix{Float64}}
c::Vector{Float64}
d::Float64
e::Int64
end
type Type2{T}
a::Matrix{T} # why not vector of vectors?
type ML
vector
phat
end
ml = ML(rand(8000), zeros(8000))
function test6(a)
@time for i = 1:1000
for j = 1:8000
@pkofod
pkofod / devec.jl
Last active October 7, 2015 20:20
using Devectorize
function test0()
vector = rand(8000)
phat = zeros(8000)
@time for i = 1:1000
for j = 1:8000
phat[j] = 1./(1+exp(-vector [j]))
end
end
#Create matrix
A = rand(3,9)
#Sum over rows -> matrix
typeof(sum(A, 1)) == Matrix{Float64} #true
#Sum over cols -> matrix
typeof(sum(A,2)) == Matrix{Float64} #true
#This is expected, but what is the best way to extract the vector? This?