Skip to content

Commit

Permalink
transitioned to Julia 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Aug 11, 2018
1 parent 9c9d5b6 commit cc2bfd0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions REQUIRE
@@ -1,3 +1,2 @@
julia 0.6
julia 0.7
Combinatorics
Compat 0.34
1 change: 0 additions & 1 deletion appveyor.yml
Expand Up @@ -7,7 +7,6 @@ environment:

matrix:
allow_failures:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.7/julia-0.7-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

Expand Down
5 changes: 3 additions & 2 deletions src/Dendriform.jl
Expand Up @@ -4,7 +4,7 @@ module Dendriform
# This file is part of Dendriform.jl. It is licensed under the GPL license
# Dendriform Copyright (C) 2017 Michael Reed

using Combinatorics, Compat
using Combinatorics

export PBTree, Grove, GroveBin, ==, Cn, grovesort, grovesort!, σ, print, grovecomposition, grovedisplay

Expand Down Expand Up @@ -125,6 +125,7 @@ Grove(d::UI8I) = convert(Grove,d)
Grove(d::UI8I,s::BitArray{1}) = TreeLoday(d,s)
Grove(g::GroveBin) = convert(Grove,g)
Grove(s::BitArray{1}) = Grove(CnInv(length(s)),s)
Grove(g::Grove) = g

"""
Grove(degree::Int, index::Integer)
Expand Down Expand Up @@ -242,7 +243,7 @@ function GroveExtend!(Y::Array{Grove,1},R::Array{Array{Int,1},1},deg::UInt8)
# initialize total grove
Yn = Grove(Array{UInt8,2}(undef,Cn(n),n))
# loop over left-branch grove
n==1 ? (Yn.Y[τ,1] .= n) : (Yn.Y[τ:lYn,n] .= n)
n==1 ? (Yn.Y[τ,1] = n) : (Yn.Y[τ:lYn,n] .= n)
for λ 1:lYn
Yn.Y[τ,1:n-1] = Y[n].Y[λ,:]
τ += 1
Expand Down
8 changes: 4 additions & 4 deletions src/morphism.jl
Expand Up @@ -108,7 +108,7 @@ grovebit(g::Union{Ar1UI8I,Ar2UI8I}) = grovebit(Grove(g))
grovebit(g::GroveBin) = grovebit(g.degr,g.gbin)

function grovebit(d::UI8I,s::Integer)
gb = '1' .== reverse(collect(string(s,base=2)),dims=1)
gb = Ref('1') .== reverse(collect(string(s,base=2)),dims=1)
return vcat(gb,falses(Cn(d)-length(gb)))
end

Expand All @@ -128,7 +128,7 @@ function groveindex(d::UI8I,l::Int,g::Ar2UI8I)
s += BigInt(2)^(findfirst(v.==gt[c])-1)
end
catch
treecheck(g) ? throw(DomainError()) : s=BigInt(-1)
treecheck(g) ? throw(DomainError(g)) : s=BigInt(-1)
end
return s
end
Expand Down Expand Up @@ -193,7 +193,7 @@ TreeLoday(d::UI8I,s::Integer) = Grove(d,s)
Returns BaseTree objects for any AbstractGrove
"""
TreeBase(d::UI8I,s::Integer) = TreeBase(d,grovebit(findall(s)))
TreeBase(d::UI8I,s::Integer) = TreeBase(d,grovebit(findall(x->x!=0,s)))

function TreeBase(d::UI8I,ind::BitArray) # from treeindex
y = Υ(d).Y
Expand Down Expand Up @@ -317,7 +317,7 @@ function TreeRational(d::UI8I,indb::BitArray) # from treeindex
end

TreeRational::BaseTree) = (s=treeshift(); s+((-1)^s)*ΘInt.μ)//ΘMax(length.μ)))
TreeRational(deg::UI8I::Array{Int,1}) = (s=treeshift(); 1-s-((-1)^s)*Θ.//ΘMax(deg))
TreeRational(deg::UI8I::Array{Int,1}) = (s=treeshift(); 1-s.-((-1)^s)*Θ.//ΘMax(deg))

function TreeRational(Y::Array{BaseTree,1})
γ = length(Y)
Expand Down
4 changes: 2 additions & 2 deletions src/poset.jl
Expand Up @@ -226,7 +226,7 @@ function intcomp(d::Int)
for i 1:Int(groveindex(Grove(q))), j 1:Int(groveindex(Grove(d-q)))
z = GroveBin(Grove(q,i) + Grove(d-q,j))
f = findall(s->s==z.gbin, ins)
length(f) == 0 ? (cn += 1) : (cc[f] += 1)
length(f) == 0 ? (cn += 1) : (cc[f] .+= 1)
end
end
@info "Non-intervals: $cn"
Expand All @@ -242,7 +242,7 @@ function intcompt(d::Int)
for i 1:Int(Cn(q)), j 1:Int(Cn(d-q))
z = GroveBin(PBTree(q,i) + PBTree(d-q,j))
f = findall(s->s==z.gbin, ins)
length(f) == 0 ? (cn += 1) : (cc[f] += 1)
length(f) == 0 ? (cn += 1) : (cc[f] .+= 1)
end
end
#@info "Non-intervals: $cn"
Expand Down
5 changes: 2 additions & 3 deletions test/runtests.jl
@@ -1,5 +1,4 @@
using Dendriform
using Test
using Dendriform, Test
import Dendriform: GroveError, TreeInteger, TreeRational, TreeBase, TreeLoday

d = 5
Expand All @@ -22,7 +21,7 @@ d = 5
@test Grove(d) |> grovesort! == Grove(d) == Grove(d,2^Cn(d)-1)
@test Grove(d) == d |> TreeBase |> TreeLoday
@test (k = Grove(d) |> TreeBase |> TreeLoday; k == k |> TreeBase |> TreeLoday)
@test TreeLoday(0,Array{Int,1}(0)) == Grove(0)
@test TreeLoday(0,Array{Int,1}(undef,0)) == Grove(0)
@test [TreeBase([1:d...])] == TreeBase(d,1)
@test Grove(d) |> TreeBase |> TreeInteger == Grove(d) |> TreeInteger
@test (grovesort(false); TreeLoday(d,treeindex(Grove(d))) == Grove(d))
Expand Down

0 comments on commit cc2bfd0

Please sign in to comment.