We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eltype
Distribution
Now we use the Base.eltype option to determine the sample type of some Distribution. For example:
Base.eltype
Distribution.
eltype(NormalMeanVariance(...)) === Float64
eltype(MvNormalMeanCovariance(...)) === Vector{Float64}
eltype(Wishart(...)) === Matrix{Float64}
This leads to ambiguities with the SampleList "distribution", which defines eltype both over its sample type and weight type, e.g.:
SampleList
Tuple{Float64, Float64}
Tuple{Vector{Float64}, Float64}
Tuple{Matrix{Float64}, Float64}
We cannot really change the behaviour of the eltype function for the SampleList, because eltype is used by the Julia language itself for iteration.
To circumvent this ambiguity we probably need to implement sampletype function, where we can fallback:
sampletype
sampletype(::Type{ T }) where {T} = eltype(T)
The text was updated successfully, but these errors were encountered:
Fixed in #229
Sorry, something went wrong.
Nimrais
No branches or pull requests
Now we use the
Base.eltype
option to determine the sample type of someDistribution.
For example:eltype(NormalMeanVariance(...)) === Float64
eltype(MvNormalMeanCovariance(...)) === Vector{Float64}
eltype(Wishart(...)) === Matrix{Float64}
This leads to ambiguities with the
SampleList
"distribution", which defineseltype
both over its sample type and weight type, e.g.:Tuple{Float64, Float64}
Tuple{Vector{Float64}, Float64}
Tuple{Matrix{Float64}, Float64}
We cannot really change the behaviour of the
eltype
function for theSampleList
, becauseeltype
is used by the Julia language itself for iteration.To circumvent this ambiguity we probably need to implement
sampletype
function, where we can fallback:The text was updated successfully, but these errors were encountered: