Skip to content

Commit

Permalink
Make matrix/vector value type configureable
Browse files Browse the repository at this point in the history
  • Loading branch information
takuti committed Jul 22, 2019
1 parent 2457dcb commit 0169c95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ mutable struct Event
value::Float64 # e.g. rating, 0/1
end

function matrix(m::Int, n::Int)
Array{Union{Nothing, Float64}}(nothing, m, n)
function matrix(m::Int, n::Int, t::Type{<:Number}=Float64)
Array{Union{Nothing, t}}(nothing, m, n)
end

function vector(m::Int)
Array{Union{Nothing, Float64}}(nothing, m)
function vector(m::Int, t::Type{<:Number}=Float64)
Array{Union{Nothing, t}}(nothing, m)
end

function isfilled(a::AbstractArray)
Expand Down

0 comments on commit 0169c95

Please sign in to comment.