Skip to content

Commit

Permalink
accomodate Julia v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Hua-Zhou committed Jun 30, 2017
1 parent a9327f1 commit a6940da
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ os:
- linux
- osx
julia:
- 0.4
- 0.5
- 0.6
- nightly
matrix:
allow_failures:
Expand All @@ -23,6 +23,6 @@ after_success:
notifications:
email:
on_success: change
on_failure: always
on_failure: always
recipients:
- [email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Within Julia, use the package manager to install VarianceComponentModels:

Pkg.clone("https://github.com/OpenMendel/VarianceComponentModels.jl.git")

This package supports Julia v0.4 and v0.5.
This package supports Julia v0.5 and v0.6.

## Citation

Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.4
julia 0.5

Compat
MathProgBase
Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.6-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.6-latest-win64.exe"
#- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
#- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"

Expand Down
2 changes: 1 addition & 1 deletion src/VarianceComponentModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function TwoVarCompModelRotate{T, BT, ΣT}(
λ = convert(Vector{T}, F.values)
Φ = convert(Matrix{T}, F.vectors)
# correct negative eigenvalues due to roundoff
map!(x -> max(x, zero(T)), λ)
@compat map!(x -> max(x, zero(T)), λ, λ)
Brot = isempty(vcm.B) ? Array{T}(size(vcm.B)) : vcm.B * Φ
logdetΣ2 = convert(T, logdet(vcm.Σ[2]))
TwoVarCompModelRotate{T, BT}(Brot, λ, Φ, logdetΣ2)
Expand Down
14 changes: 7 additions & 7 deletions src/two_variance_component.jl
Original file line number Diff line number Diff line change
Expand Up @@ -904,11 +904,11 @@ function mle_fs!{T1<:VarianceComponentModel, T2<:TwoVarCompVariateRotate}(
Bcov = zeros(T, nmean, nmean)
Bcov = pinv(fisher_B(vcmodel, vcdatarot, dd.vcaux))
Bse = similar(vcmodel.B)
copy!(Bse, sqrt(diag(Bcov)))
copy!(Bse, sqrt.(diag(Bcov)))
Σcov = pinv(fisher_Σ(vcmodel, vcdatarot))
Σse = (zeros(T, d, d), zeros(T, d, d))
copy!(Σse[1], sqrt(diag(view(Σcov, 1:d^2, 1:d^2))))
copy!(Σse[2], sqrt(diag(view(Σcov, d^2+1:2d^2, d^2+1:2d^2))))
copy!(Σse[1], sqrt.(diag(view(Σcov, 1:d^2, 1:d^2))))
copy!(Σse[2], sqrt.(diag(view(Σcov, d^2+1:2d^2, d^2+1:2d^2))))

# output
maxlogl, vcmodel, Σse, Σcov, Bse, Bcov
Expand Down Expand Up @@ -1105,11 +1105,11 @@ function mle_mm!{T1 <: VarianceComponentModel, T2 <: TwoVarCompVariateRotate}(
# standard errors
Bcov = pinv(fisher_B(vcm, vcdatarot, vcaux))
Bse = similar(vcm.B)
copy!(Bse, sqrt(diag(Bcov)))
copy!(Bse, sqrt.(diag(Bcov)))
Σcov = pinv(fisher_Σ(vcm, vcdatarot))
Σse = (zeros(T, d, d), zeros(T, d, d))
copy!(Σse[1], sqrt(diag(view(Σcov, 1:d^2, 1:d^2))))
copy!(Σse[2], sqrt(diag(view(Σcov, d^2+1:2d^2, d^2+1:2d^2))))
copy!(Σse[1], sqrt.(diag(view(Σcov, 1:d^2, 1:d^2))))
copy!(Σse[2], sqrt.(diag(view(Σcov, d^2+1:2d^2, d^2+1:2d^2))))

# output
logl, vcm, Σse, Σcov, Bse, Bcov
Expand Down Expand Up @@ -1240,7 +1240,7 @@ function fit_reml!{
# standard errors and covariance of mean parameters
Bcov = inv(fisher_B(vcmodel, vcdatarot, vcaux))
Bse = similar(vcmodel.B)
copy!(Bse, sqrt(diag(Bcov)))
copy!(Bse, sqrt.(diag(Bcov)))

# output
logpdf(vcmodel, vcdatarot), vcmodel, Σse, Σcov, Bse, Bcov
Expand Down
1 change: 0 additions & 1 deletion test/REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
BaseTestNext
5 changes: 2 additions & 3 deletions test/multivariate_calculus_test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module MultivariateCalculusTest

using VarianceComponentModels
using BaseTestNext
using VarianceComponentModels, Base.Test

srand(123)

Expand Down Expand Up @@ -102,7 +101,7 @@ end
dX2[i, j] = vecdot(Y, M[(i-1)*p+1:i*p, (j-1)*r+1:j*r])
end
end
@test_approx_eq_eps vecnorm(dX1 - vec(dX2)) 0.0 1.0e-8
@test vecnorm(dX1 - vec(dX2)) < 1e-8
end

# test duplication
Expand Down
3 changes: 1 addition & 2 deletions test/two_variance_component_test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module TwoVarianceComponentTest

using VarianceComponentModels, MathProgBase, Ipopt
using BaseTestNext
using VarianceComponentModels, MathProgBase, Ipopt, Base.Test

srand(123)

Expand Down
3 changes: 1 addition & 2 deletions test/variance_component_models_test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module VarianceComponentTypeTest

using VarianceComponentModels, MathProgBase, Ipopt
using BaseTestNext
using VarianceComponentModels, MathProgBase, Ipopt, Base.Test

srand(123)

Expand Down

0 comments on commit a6940da

Please sign in to comment.