This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract UTree{T} | |
immutable UTreeBranch{T} <: UTree{T} | |
left::UTree{T} | |
right::UTree{T} | |
end | |
immutable UTreeLeaf{T} <: UTree{T} | |
v::T | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Base.convert | |
bitstype 64 IBMFloat64 | |
# ibm float format is hex based: | |
# * bit 1 = sign | |
# * bits 2-8 = exponent to the power of 16, with bias of 64 | |
# * bits 9-64 = mantissa: no implied leading 1 (unlike ieee), | |
# typically normalised (hex of bits 9-12 is non-zero), though this need | |
# not be the case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("extras/distributions.jl") | |
require("slicesampler.jl") | |
import Distributions.* | |
macro buildslicesampler(model) | |
# pull apart the model into variables and distributions | |
variables = Dict{Symbol,Expr}() | |
unboundvars = Set{Symbol}() | |
for line in model.args |
NewerOlder