-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from JuliaOpt/bl/j7
Fixes for Julia v0.7
- Loading branch information
Showing
6 changed files
with
58 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
using Base.Test | ||
using Compat | ||
using Compat.Test | ||
using SemidefiniteModels | ||
using MathProgBase.SolverInterface | ||
import MathProgBase | ||
const MPB = MathProgBase.SolverInterface | ||
|
||
function sdtest(solver::MathProgBase.AbstractMathProgSolver; duals=false, tol=1e-6) | ||
@testset "Testing SDModel with $solver" begin | ||
m = ConicModel(solver) | ||
loadproblem!(m, "prob.dat-s") | ||
optimize!(m) | ||
@test status(m) == :Optimal | ||
@test isapprox(getobjval(m), 2.75) | ||
@test norm(getsolution(m) - [.75, 1.]) < tol | ||
m = MPB.ConicModel(solver) | ||
MPB.loadproblem!(m, "prob.dat-s") | ||
MPB.optimize!(m) | ||
@test MPB.status(m) == :Optimal | ||
@test isapprox(MPB.getobjval(m), 2.75) | ||
@test norm(MPB.getsolution(m) - [.75, 1.]) < tol | ||
if duals | ||
@test norm(getdual(m) - [0, 0, .125, .125*sqrt(2), .125, 2/3, 0, 0, 0, 0, 0]) < tol | ||
@test norm(getvardual(m)) < tol | ||
@test norm(MPB.getdual(m) - [0, 0, .125, .125*sqrt(2), .125, 2/3, 0, 0, 0, 0, 0]) < tol | ||
@test norm(MPB.getvardual(m)) < tol | ||
end | ||
end | ||
end |