4. 誰がなぜ作ったか
•
I'm a data scientist and applied mathematician.
I've previously worked at Akamai, Citrix Online,
Jeff Bezanson, Stefan Karpinski, Viral Shah, Alan Edelman
and Etsy.
• Matlabユーザ、Lispハッカー、Rの描画
• We want the speed of C with the dynamism of Ruby
• Cのように速く、Pythonのように使えるやつで、Rubyのように易し
く…Perl…MatLab…
• We want to write A*B and launch a thousand computations on a thousand
machines, calculating a vast matrix product together
• http://julialang.org/blog/2012/02/why-we-created-julia/
10. 2日目
• Permutations()が動いたので、generate & testで8-Queensを書く
• ソースの解説
qs=reshape(1:n,n)
p = permutations(qs)
state = start(p)
while !done(p, state)
(q, state) = next(p, state)
if (safe(q))
count += 1
pp(q,count)
end
end
Permutations()はiteratorを返す
q は[1,2,3,4,5,6,7,8]の置換を順に得る
Safe()はクイーン達が置けてるかど
うか
11. 繰り返しの一般形
state = start(I)
while !done(I, state)
(i, state) = next(I, state)
# body
end
for i = … もこういう風に実行される
•
Range, Tuple, AbstractArray,String, Set,Dict などで使える
1:n (1,2,3) *1,2,3.0+ “abc” set hash table