QuantEcon/QuantEcon.jl

random_stochastic_matrix and random_markov_chain support sparse output

Closed

#102 opened on 2016年3月17日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Julia (300 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (495 stars)
PR merge metrics
 (平均マージ 1d 1h) (30d で 2 merged PRs)

説明

This might look like this:

random_markov_chain{T}(n::Int, k::Int=n, ::Type{Matrix{T}})  # ==> return dense array
random_markov_chain{T}(n::Int, k::Int=n, ::Type{SparseMatrixCSC{Int,T}})  # ==> return sparse array

Also, having Union{Int,Void} shouldn't be necessary here as it is in python because default arguments can depend on one another. (e.g. def f(n, k=n): is n't possible in python but function f(n, k=n) is possible in Julia)

コントリビューターガイド