GithubHelp home page GithubHelp logo

mosek.jl's Introduction

Mosek.jl

Interface to the MOSEK solver for Julia.

Mosek.jl is a complete mapping of the MOSEK functionality:

  • All relevant MOSEK C API functions are available
  • Callbacks for information retrival and log output during optimization

MOSEK can solve LP (linear), Conic (second order conic, power, exponential etc.), SDP (semi-definite), QP (quadratic objective, quadratic constraints), and MIP (mixed-integer problems). These can be mixed as follows:

  • LP+CONIC+SDP
  • LP+CONIC+MIP

MOSEK is commercial software, but free licenses are available for academic use. See here for details.

Documentation

All functions and constants in the Mosek.jl are briefly documented in docs strings, accessible assume

julia> import Mosek
julia> ?Mosek.putarowslice
  Replaces all elements in several rows the linear constraint matrix.

  putarowslice(task::MSKtask,first::Int32,last::Int32,ptrb::Vector{Int64},ptre::Vector{Int64},asub::Vector{Int32},aval::Vector{Float64})
  putarowslice(task::MSKtask,first::T0,last::T1,ptrb::T2,ptre::T3,asub::T4,aval::T5) where {T0<:Integer,T1<:Integer,T2<:AbstractVector{<:Integer},T3<:AbstractVector{<:Integer},T4<:AbstractVector{<:Integer},T5<:AbstractVector{<:Number}} 
  putarowslice(task::MSKtask,first::T0,last::T1,At:: SparseMatrixCSC{Float64})

  Arguments: 

  At::SparseMatrixCSC{{Float64} Transposed matrix defining the row values. Note that for efficiency reasons the *columns* of this matrix defines the *rows* to be replaced
  asub::Vector{Int32} Column indexes of new elements.
  aval::Vector{Float64} Coefficient values.
  first::Int32 First row in the slice.
  last::Int32 Last row plus one in the slice.
  ptrb::Vector{Int64} Array of pointers to the first element in the rows.
  ptre::Vector{Int64} Array of pointers to the last element plus one in the rows.
  task::MSKtask An optimization task.

For a more complete manual and full API reference, please refer to the MOSEK Julia API documentation.

Installation

Use the Julia package manager to install Mosek.jl:

Pkg.add("Mosek")

The Mosek.jl package requires the MOSEK distribution binaries run. Upon installation it will attempt to either local an installed MOSEK or download and install from the MOSEK website (www.mosek.com):

  1. If the environment variable MOSEKBINDIR is defined, the installer will assume that this directory contains the necessary libraries. If it does not, the installer will fail.
  2. If the current Mosek.jl installation uses a user-defined MOSEK and this is a valid version, this will be used.
  3. If MOSEK is installed in the default location in the users HOME directory, and this installation has the correct version, this will be used.
  4. If no usable MOSEK installation is found here, the installer will attempt to download and unpack the latest distro. In this case doing Pkg.build("Mosek") will update the MOSEK distro if possible.`

If the MOSEK distro installation directory is moved it is necessary to rebuild the package using

Pkg.build("Mosek")

If you have previously installed Mosek.jl using a pre-installed MOSEK distro, setting the MOSEKJL_FORCE_DOWNLOAD=YES will force the installer to download MOSEK from the web instead of using the old version.

Note that environment variables can be set temporarily from Julia as

ENV["MOSEKBINDIR"] = "/home/myname/lib"

Furthermore, a license file is required to use MOSEK (these are free for academic use). MOSEK will look first for the enironment variable MOSEKLM_LICENSE_FILE which, if defined, must point to the relevant license file. If this is not defined, MOSEK will look for a file called mosek.lic in the default install path, e.g.

$HOME/mosek/mosek.lic

Updating the Mosek library

If the MOSEK distro was installed manually, it can be updated simply by installing a newer distro in the same place. Otherwise, doing Pkg.build("Mosek") will check the latest MOSEK distro and update if possible.

You can see if the MOSEK distro was installed internally this way:

is_internal = open(joinpath(Pkg.dir("Mosek"),"deps","inst_method"),"r") do f readstring(f) == "internal" end

Use with JuMP

The MathOptInterface wrapper for MOSEK is a separate package called MosekTools. However, for consistency the optimizer is still named Mosek.Optimizer.

Use MOSEK with JuMP as follows:

using JuMP, MosekTools
model = Model(Mosek.Optimizer)

Note on versions and release

Since the Mosek.jl package is designed to match a specific MOSEK version (major+minor version), there are branches for the different MOSEK versions:

  • Branch b0.8 is compatible with MOSEK 8.0. Not actively updated.
  • Branch b0.9 is compatible with MOSEK 8.1. Currently updated only for bugfixes.
  • Branch b1.1-msk9.1 is compatible with MOSEK 9.1. Not actively updated.
  • Branch b1.1-msk9.2 is compatible with MOSEK 9.2. Not actively updated.
  • Branch b1.1-msk9.3 is compatible with MOSEK 9.3. Currently updated only for bugfixes.
  • From MOSEK 10.0 and forward, Mosek.jl branch bX.Y is compatible with MOSEK version X.Y.
  • For MOSEK beta releases, there will be a corresponding branch, but there will not be releases of Mosek.jl for MOSEK beta releases. Mosek.jl release vX.Y.Z will be taken from branch bX.Y.

mosek.jl's People

Contributors

blegat avatar chriscoey avatar ericphanson avatar femtocleaner[bot] avatar guberger avatar iainnz avatar iamed2 avatar joehuchette avatar jonathananderson avatar juliatagbot avatar kaarthiksundar avatar krislock avatar mfairley avatar mlubin avatar mtanneau avatar odow avatar omus avatar pkofod avatar projekter avatar rofinn avatar stephentu avatar tkelman avatar ulfworsoe avatar wdvorkin avatar wflu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mosek.jl's Issues

bug in freemodel!

This line here is assigning C_NULL to a Mosek.MSKtask object. Is it safe to delete this line?

qo1.jl example fails

I get:

ERROR: MosekError(1265,"The solution with code 1 is not defined.")
 in getxx at /Users/huchette/.julia/Mosek/src/msk_functions.jl:2323
 in include_from_node1 at loading.jl:120
while loading /Users/huchette/.julia/Mosek/examples/qo1.jl, in expression starting on line 73

Looks like it's being solved to optimality, but Mosek won't provide the solution vector.

Issue with Pkg.build("Mosek")

Hi,

I'm having a build issue with Pkg.add("Mosek"). Please see printout below

Mosek bin/ directory is in my PATH as well as the MOSEKBINDIR environment variable. I can launch Mosek from a terminal just fine. It seems to be failing at line 81 in the build.jl file:

@BinDeps.install [ :libmosek => :libmosek ]

Any ideas? Please see below.

Ubuntu 12.04 (64)
gcc 4.6

Thanks

Pkg.build("Mosek")
INFO: Building Mosek
==========================================[ ERROR: Mosek ]===========================================

None of the selected providers can install dependency libmosek.
Use BinDeps.debug(package_name) to see available providers

while loading /home/dehann/.julia/Mosek/deps/build.jl, in expression starting on line 81

==========================================[ BUILD ERRORS ]===========================================

WARNING: Mosek had build errors.

  • packages with build errors remain installed in /home/dehann/.julia
  • build a package and all its dependencies with Pkg.build(pkg)
  • build a single package by running its deps/build.jl script

Issue with Pkg.add("Mosek")

I get the error message below when I install Mosek.jl. Looks like a file name may have change. After the error message, I show the contents of the directory where Mosek.jl is looking for the file named libmosek64.so.7.0.

julia> Pkg.add("Mosek")
INFO: Cloning cache of Mosek from git://github.com/JuliaOpt/Mosek.jl.git
INFO: Installing Mosek v0.1.3
INFO: Building Mosek
INFO: Attempting to Create directory /home/jeff/.julia/v0.3/Mosek/deps/downloads
INFO: Downloading file http://download.mosek.com/stable/7/mosektoolslinux64x86.tar.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 30.4M  100 30.4M    0     0  1768k      0  0:00:17  0:00:17 --:--:-- 2110k
INFO: Done downloading file http://download.mosek.com/stable/7/mosektoolslinux64x86.tar.bz2
INFO: Attempting to Create directory /home/jeff/.julia/v0.3/Mosek/deps/src
INFO: Attempting to Create directory /home/jeff/.julia/v0.3/Mosek/deps
INFO: Directory /home/jeff/.julia/v0.3/Mosek/deps already created
INFO: Attempting to Create directory /home/jeff/.julia/v0.3/Mosek/deps/src/mosek
INFO: Attempting to Create directory /home/jeff/.julia/v0.3/Mosek/deps/usr/lib
cp: cannot stat ‘/home/jeff/.julia/v0.3/Mosek/deps/src/mosek/7/tools/platform/linux64x86/bin/libmosek64.so.7.0’: No such file or directory
============================================================================[ ERROR: Mosek ]=============================================================================

failed process: Process(`cp /home/jeff/.julia/v0.3/Mosek/deps/src/mosek/7/tools/platform/linux64x86/bin/libmosek64.so.7.0 /home/jeff/.julia/v0.3/Mosek/deps/usr/lib`, ProcessExited(1)) [1]
while loading /home/jeff/.julia/v0.3/Mosek/deps/build.jl, in expression starting on line 81

=========================================================================================================================================================================

============================================================================[ BUILD ERRORS ]=============================================================================

WARNING: Mosek had build errors.

 - packages with build errors remain installed in /home/jeff/.julia/v0.3
 - build the package(s) and all dependencies with `Pkg.build("Mosek")`
 - build a single package by running its `deps/build.jl` script

=========================================================================================================================================================================
INFO: Package database updated

Here are the contents of the directory where Mosek.jl expects to find libmosek64.so.7.0:

$ ls /home/jeff/.julia/v0.3/Mosek/deps/src/mosek/7/tools/platform/linux64x86/bin/
libiomp5.so           libmosekscopt7_1.so  mosek            moseksi           mskscopt
libmosek64.so         libmosekxx7_1.so     mosek.jar        mskdgopt          msktestlic
libmosek64.so.7.1     lmgrd                MOSEKLM          mskexpopt         msktestlicok.bat
libmosekglb64.so.7.1  lmutil               moseklua         mskgenhostid.bat  msktestmosek.bat
libmosekjava7_1.so    mampl                mosekmatlab.jar  msklmreread.bat

Pre 0.3.2: `isless` has no method matching isless(::Int64, ::Array{Int64,1})

This seems to have been fixed in Julia 0.3.2, but for earlier versions
https://github.com/JuliaOpt/Mosek.jl/blob/master/src/MosekSolverInterface.jl#L925
should be:
idxs = find(i -> v[i] > 0, [1:n])

If I try to do this in Julia 0.3.0

v=[1, 2]
idxs = find(i -> v[i] > 0, 1:2)

I get:

ERROR: `isless` has no method matching isless(::Int64, ::Array{Int64,1})
 in > at operators.jl:33
 in anonymous at none:1
 in find at array.jl:1077

The alternative would be to update REQUIRE

Mosek does not work with JuMP in Juliav0.4

Tried to run the qcp.jl example from JuMP using JuliaV0.4 and getting errors as below. The example works fine on JuliaV0.3.

Code:

using JuMP

m = Model()

@defvar(m, x)
@defvar(m, y >= 0)
@defvar(m, z >= 0)

@setObjective(m, Max, x)

@addConstraint(m, x + y + z == 1)
@addConstraint(m, x_x + y_y - z_z <= 0)
@addConstraint(m, x_x - y*z <= 0)

print(m)

status = solve(m)

Output:

Max x
Subject to
x + y + z == 1
x² + y² - z² <= 0
x² - y*z <= 0
x free
y >= 0
z >= 0

LoadError: UndefVarError: MosekSolver not defined
while loading In[4], in expression starting on line 23

in model at C:\Users\Thuyen.julia\v0.4\MathProgBase\src\defaultsolvers.jl:55
in buildInternalModel at C:\Users\Thuyen.julia\v0.4\JuMP\src\solvers.jl:236
in solve at C:\Users\Thuyen.julia\v0.4\JuMP\src\solvers.jl:77

Mosek.jl fails JuMP nonlinear test

Mosek reports "nonconvex problem" during first test in

JuMP/test/nonlinear.jl

Trace:

ERROR: Mosek.MosekError(1291,"The optimization problem is nonconvex.")
 in optimize at /home/ulfw/.julia/Mosek/src/msk_functions.jl:2498
 in optimize! at /home/ulfw/.julia/Mosek/src/MosekSolverInterface.jl:660
 in solvenlp at /home/ulfw/.julia/JuMP/src/nlp.jl:485
 in solve at /home/ulfw/.julia/JuMP/src/solvers.jl:6
 in anonymous at /home/ulfw/.julia/JuMP/test/nonlinear.jl:32
 in context at /home/ulfw/.julia/FactCheck/src/FactCheck.jl:282
 in anonymous at /home/ulfw/.julia/JuMP/test/nonlinear.jl:14
 in facts at /home/ulfw/.julia/FactCheck/src/FactCheck.jl:261
 in include at ./boot.jl:242
 in include_from_node1 at ./loading.jl:128
 in include at ./boot.jl:242
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:300
 in _start at ./client.jl:382
 in _start_3B_3993 at /usr/local/julia/bin/../lib/julia/sys.so
while loading /home/ulfw/.julia/JuMP/test/nonlinear.jl, in expression starting on line 12
while loading /home/ulfw/.julia/JuMP/test/runtests.jl, in expression starting on line 28

numerical instability

Not sure if this is related to the interface or to Mosek itself, but I've found an example of numerical instability while trying to use Mosek in a research project:

using JuMP
using Gurobi
#using CPLEX
using Mosek

#m = Model(solver = CplexSolver(CPX_PARAM_PREIND=0,CPX_PARAM_BARQCPEPCOMP=1e-12))
m = Model(solver = MosekSolver())
#m = Model(solver = GurobiSolver())
@defVar(m, theta <= 1e10)
@defVar(m, x1)
@defVar(m, x2)
@defVar(m, nusq >= 0.0)
@defVar(m, nudummy >= 0.0)
@defVar(m, y3 >= 0.0)
@defVar(m, y7 >= 0.0)
@defVar(m, y8 >= 0.0)

@setObjective(m, Min, -0.010052753705567755*y3 + 50*y7 - theta + 50*nusq)
@addConstraint(m, theta + x1 <= 0)
@addConstraint(m, y8 == 1.0)
@addConstraint(m, nudummy == 1.0)
addConstraint(m, x1^2 + x2^2 <= y3^2)
addConstraint(m, x1^2 + x2^2 <= y7*y8)
addConstraint(m, y3^2 <= nusq*nudummy)
solve(m)
println("ObjVal: ", getObjectiveValue(m))
println(getValue(theta))

Mosek prints:

ObjVal: 295.9805564481924
-70.25009536743164

If we change the upper bound on theta to 1, Mosek prints:

ObjVal: -0.0025495687071293216
0.005062204104960832

For comparison, Gurobi prints

ObjVal: -0.0025504859829822406
0.005060318646719088

and

ObjVal: -0.0025502798431986068
0.005096880267928691

for 1e10 and 1 respectively.

Is this just a scaling/tolerance issue?

nonlinear interface?

We're working on nonlinear modeling in JuMP. Currently (on the nlp branch) we can compute exact hessians and provide the problem data as a callback to Ipopt. What's needed to provide a nonlinear problem to Mosek? We will eventually want to do sort of a MathProgBase interface for nonlinear problems.

MOSEK warning

I'm solving several instances of a problem in a loop and keep getting the following warning:
MOSEK warning 705: 1 near zero elements are specified in sparse row ''(19) of matrix 'A'.
This is not a problem in my model and does not affect solution quality, but is creates clutter when the warning is repeatedly printed on my terminal. Is there a simple way to suppress this?

Mosek fails Convex.jl SDP tests

On the master branch of Convex.jl, we can test Mosek as a solver by modifying test/run_tests.jl
with

using Mosek
set_default_solver(MosekSolver())

to run the tests using Mosek. Mosek is currently failing the SDP tests with the error

ERROR: MosekError(3942,"An element in the upper triangular part at row 0 in column 1 has been specified.")

CC @karanveerm @madeleineudell

MosekMathProgModel numvar field is broken

The field is not updated when variables are added internally (for instance, when auxiliary variables are created in addquadconstr!); this bit me for pretty much the whole weekend when I couldn't find out why multiple quadratic constraints were breaking :(

It seems that there is no reason to carry around this state when it's liable to break like this and a call to getnumvar(m.task) is so easy. I'm not sure if there was a reason to do it this way that I'm missing @ulfworsoe @wflu, but if not I'll go through the MathProgBase interface and change it.

Problem with qcp.jl

Hi @ulfworsoe ,

I am doing final Mosek.jl/JuMP integration tests, and had some problems with https://github.com/JuliaOpt/JuMP.jl/blob/master/examples/qcp.jl

If I replace the top bit so it uses Mosek, I get the following error:

julia> status = solve(m)
ERROR: MosekError(1502,"The conic optimizer can only be applied to problems with linear objective and constraints.")
 in optimize at /home/idunning/.julia/Mosek/src/msk_functions.jl:2466
 in optimize! at /home/idunning/.julia/Mosek/src/MosekSolverInterface.jl:251
 in solveLP at /home/idunning/.julia/JuMP/src/solvers.jl:147
 in solve at /home/idunning/.julia/JuMP/src/solvers.jl:23

Is this expected for this problem? The error message doesn't quite match the problem.

Cheers,
Iain

return status for timeout

Another issue once #42 is resolved. When Mosek hits the time limit, it currently returns :Unknown status through the MPB interface. This should be :UserLimit. How can we detect if the solver stopped because of a time limit?

MOSEK 7.1 fails to install on Julia Version 0.4.0-dev+6002

Mosek fails to build on Julia 0.4.0-dev with the following error:

The package declares 2 dependencies.

  • Library "libmosek"
    • Satisfied by:
      • Binaries at /home/steven/mosek/7/tools/platform/linux64x86/bin/libmosek64.so.7.1
    • Providers:
      • Binaries
  • Library "libmosekscopt"

INFO: Building Mosek

WARNING: deprecated syntax "[a=>b, ...]" at /home/steven/.julia/v0.4/Mosek/deps/build.jl:87.
Use "Dict(a=>b, ...)" instead.
============================================[ ERROR: Mosek ]============================================

LoadError: None of the selected providers can install dependency libmosek.
Use BinDeps.debug(package_name) to see available providers

while loading /home/steven/.julia/v0.4/Mosek/deps/build.jl, in expression starting on line 87

============================================[ BUILD ERRORS ]============================================

WARNING: Mosek had build errors.

  • packages with build errors remain installed in /home/steven/.julia/v0.4
  • build the package(s) and all dependencies with Pkg.build("Mosek")
  • build a single package by running its deps/build.jl script

Julia Version 0.4.0-dev+6002
Commit a802070 (2015-07-16 06:53 UTC)
Platform Info:
System: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz
WORD_SIZE: 64
BLAS: libmkl_rt
LAPACK: libmkl_rt
LIBM: libimf
LLVM: libLLVM-3.3

Getting Mosek into JuliaOpt

@mlubin @ulfworsoe
So the interface is looking pretty great, but probably needs some BinDeps magic and cross-platform testing before moving it to JuliaOpt.

Next, we can work on connecting JuMP to Mosek for problems with quadratic constraints by adding something to the MathProgBase interface.

Build failure

I have Mosek installed in /Users/huchette/mosek/ and have MOSEKBINDIR=/Users/huchette/mosek/7/tools/platform/osx64x86/bin. Based on the instructions, Mosek.jl should find this, but it's trying to download Mosek and is failing on unzipping:

tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
================================[ ERROR: Mosek ]================================

failed process: Process(`tar xjf /Users/huchette/.julia/Mosek/deps/downloads/mosektoolsosx4x86.tar.bz2 --directory=/Users/huchette/.julia/Mosek/deps/src`, ProcessExited(1)) [1]
while loading /Users/huchette/.julia/Mosek/deps/build.jl, in expression starting on line 81

error when adding mosek package

Hi

I was trying to build mosek using Pkg.build("Mosek") and then encounter such an error

At line:1 char:3

  • --help
  • ~
    Missing expression after unary operator '--'.
    At line:1 char:3
  • --help

Unexpected token 'help' in expression or statement.

  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : MissingExpressionAfterOperator

ERROR: LoadError: No download agent available; install curl, wget, or fetch.
in download_cmd at C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4\Mosek\deps\liftedfrombindeps.jl:39
in include at boot.jl:261
in include_from_node1 at loading.jl:320
in debug_context at C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4\BinDeps\src\debug.jl:54
in debug at C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4\BinDeps\src\debug.jl:59
in debug at C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4\BinDeps\src\debug.jl:65
while loading C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4\Mosek\deps\build.jl, in expression starting on line 76

Can anybody help me?

My versioninfo(true) is as follows:

Julia Version 0.4.6
Commit 2e358ce (2016-06-19 17:16 UTC)
Platform Info:
System: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
WORD_SIZE: 64
Microsoft Windows [Version 10.0.10586]
Memory: 7.922718048095703 GB (4421.21875 MB free)
Uptime: 5908.1167739 sec
Load Avg: 0.0 0.0 0.0
Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz:
speed user nice sys idle irq ticks
#1 3408 MHz 216687 0 335250 5355328 53812 ticks
#2 3408 MHz 60343 0 133843 5712921 1671 ticks
#3 3408 MHz 98656 0 216750 5591703 828 ticks
#4 3408 MHz 131953 0 144984 5630171 1203 ticks
#5 3408 MHz 125781 0 243312 5538015 1171 ticks
#6 3408 MHz 57218 0 143156 5706734 906 ticks
#7 3408 MHz 126859 0 206093 5574156 578 ticks
#8 3408 MHz 75000 0 144312 5687796 1250 ticks

BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.3
Environment:
CCHZPATH = C:\CTEX\CTeX\cct\fonts
CCPKPATH = C:\CTEX\CTeX\fonts\pk\modeless\cct\dpi$d
GUROBI_HOME = C:\gurobi652\win64
HOMEDRIVE = H:
HOMEPATH =
HOMESHARE = \fs5\stuhome\a01\a0109727
JULIA_PKGDIR = C:\Users\a0109727\AppData\Local\Julia-0.4.6
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

Package Directory: C:\Users\a0109727\AppData\Local\Julia-0.4.6\v0.4
9 required packages:

  • BinDeps 0.4.2
  • Convex 0.3.0
  • Gurobi 0.2.3
  • JuMP 0.14.0
  • LibCURL 0.2.0
  • MAT 0.2.14
  • Mosek 0.4.0+ master
  • SCS 0.2.5
  • WinRPM 0.2.0
    16 additional packages:
  • Blosc 0.1.6
  • Calculus 0.1.15
  • Compat 0.8.7
  • DataStructures 0.4.5
  • ForwardDiff 0.2.2
  • HDF5 0.6.5
  • Lazy 0.11.0
  • LegacyStrings 0.1.1
  • LibExpat 0.2.0
  • MacroTools 0.3.2
  • MathProgBase 0.5.3
  • NaNMath 0.2.1
  • ReverseDiffSparse 0.5.8
  • SHA 0.2.1
  • URIParser 0.1.6
  • Zlib 0.1.12

thanks for your help

getvardual not quite working

I just added some tests for getvardual for LPs passed through the conic interface (JuliaOpt/MathProgBase.jl@2faa7b9) and mosek is now failing:

Problem LIN1
ERROR: LoadError: LoadError: Mosek.MosekError(2953,"snx is not available the basis solution.")
 in getsnx at /home/mlubin/.julia/v0.4/Mosek/src/msk7_functions.jl:1926
 in getvardual at /home/mlubin/.julia/v0.4/Mosek/src/MosekConicInterface.jl:471
 in coniclineartest at /home/mlubin/.julia/v0.4/MathProgBase/test/conicinterface.jl:38
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 in process_options at ./client.jl:280
 in _start at ./client.jl:378
while loading /home/mlubin/.julia/v0.4/Mosek/test/mathprogtest.jl, in expression starting on line 21
while loading /home/mlubin/.julia/v0.4/Mosek/test/runtests.jl, in expression starting on line 4

solver options

Right now there's no processing of solver options. It would be nice to have a few basic options, like logging, solution method, number of threads, tolerances, etc.

provide warmstart for nonlinear problems

running test example HS071 gives me:

ERROR: `setwarmstart!` has no method matching setwarmstart!(::MosekMathProgModel, ::Array{Float64,1})
 in solvenlp at /Users/yeesian/.julia/v0.3/JuMP/src/nlp.jl:480
 in solve at /Users/yeesian/.julia/v0.3/JuMP/src/solvers.jl:6
 in anonymous at /Users/yeesian/.julia/v0.3/JuMP/test/nonlinear.jl:32
 in context at /Users/yeesian/.julia/v0.3/FactCheck/src/FactCheck.jl:312
 in anonymous at /Users/yeesian/.julia/v0.3/JuMP/test/nonlinear.jl:14
 in facts at /Users/yeesian/.julia/v0.3/FactCheck/src/FactCheck.jl:286
 in include at /Applications/Julia-0.3.3.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia-0.3.3.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include at /Applications/Julia-0.3.3.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at loading.jl:128
 in process_options at /Applications/Julia-0.3.3.app/Contents/Resources/julia/lib/julia/sys.dylib
 in _start at /Applications/Julia-0.3.3.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)
while loading /Users/yeesian/.julia/v0.3/JuMP/test/nonlinear.jl, in expression starting on line 12
while loading /Users/yeesian/.julia/v0.3/JuMP/test/runtests.jl, in expression starting on line 28

Error 1241: Too small maximum number of variables 0 is specified

I get the following error when I do a conic program solve. What does this mean?

MOSEK error 1241: Too small maximum number of variables 0 is specified. Currently, the number of variables is 2546.
ERROR: MosekError(1241,"Too small maximum number of variables 0 is specified. Currently, the number of variables is 2546.")
 in putmaxnumvar at /nh/nest/u/harsha/.julia/v0.3/Mosek/src/msk_functions.jl:2980
 in loadconicproblem! at /nh/nest/u/harsha/.julia/v0.3/Mosek/src/MosekConicInterface.jl:235
 in loadconicproblem! at /nh/nest/u/harsha/.julia/v0.3/Mosek/src/MosekConicInterface.jl:208
 in lazyconstraintgenerator at /auto/nest/nest/u/harsha/Documents/Julia_codes/sccuc/UCcode/codejl/model.jl:433
 in lazycallback at /nh/nest/u/harsha/.julia/v0.3/JuMP/src/callbacks.jl:65
 in anonymous at /nh/nest/u/harsha/.julia/v0.3/JuMP/src/callbacks.jl:79
 in mastercallback at /nh/nest/u/harsha/.julia/v0.3/CPLEX/src/CplexSolverInterface.jl:416
while loading /auto/nest/nest/u/harsha/Documents/Julia_codes/sccuc/UCcode/codejl/sccuc_simulation.jl, in expression starting on line 89

Error when updating Mosek

I am using Julia v0.4.2 and ran a Pkg.update(). Mosek threw the following error

================================[ ERROR: Mosek ]================================

LoadError: Failed to find any usable MOSEK libraries
while loading /Users/kaarthik/.julia/v0.4/Mosek/deps/build.jl, in expression starting on line 87

================================================================================

==================================================================================[ BUILD ERRORS ]===================================================================================

WARNING: Mosek had build errors.

 - packages with build errors remain installed in /Users/kaarthik/.julia/v0.4
 - build the package(s) and all dependencies with `Pkg.build("Mosek")`
 - build a single package by running its `deps/build.jl` script

=====================================================================================================================================================================================

The MOSEKBINDIR is set to /Users/kaarthik/mosek/7/tools/platform/osx64x86/bin.

Infeasible incorrectly reported as unbounded

Mosek is failing JuMP's unit test:

using JuMP, Mosek

m2 = Model(solver=MosekSolver())

@variable(m2, x2 >= 0)
@constraint(m2, x2 <= 1)
@objective(m2, Max, x2)
@constraint(m2, c2, norm(x2) <= x2 - 1)

status = solve(m2)

The problem is infeasible but Mosek 8.0.0.34 reports unbounded. The test used to pass with Mosek 7.

setVarUB! in MPB interface broken

ERROR: `isless` has no method matching isless(::Int64, ::Array{Int32,1})
 in > at operators.jl:33
 in anonymous at C:\Users\\.julia\v0.3\Mosek\src\MosekSolverInterface.j
l:427
 in setvarUB! at C:\Users\\.julia\v0.3\Mosek\src\MosekSolverInterface.j
l:427
 in solveLP at C:\Users\\.julia\v0.3\JuMP\src\solvers.jl:209
 in solve at C:\Users\\.julia\v0.3\JuMP\src\solvers.jl:34
 in anonymous at no file:204
 in include at boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at client.jl:285
 in _start at client.jl:354

I have the code from the user that reported this, haven't made minimal example yet. Calling from JuMP.

Unknown status from after solving a problem

When running this program:

c = [-1.0; -zeros(120)]
m = 45
n = 121
colptr = collect(1:122)
rowval = [1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,4,5,7,8,9,11,12,13,14,16,17,18,19,20,6,8,9,10,12,13,14,15,17,18,19,20,21,11,12,13,16,17,18,19,22,23,24,25,26,13,14,17,18,19,20,23,24,25,26,27,15,18,19,20,21,24,25,26,27,28,22,23,24,25,29,30,31,32,33,24,25,26,30,31,32,33,34,26,27,31,32,33,34,35,28,32,33,34,35,36,37,38,39,40,41,39,40,41,42,41,42,43,43,44,45]
s = sqrt(2)
nzval = [-1.0,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-s,-1.0,-s,-s,-s,-s,-1.0,-s,-s,-s,-1.0,-s,-s,-1.0,-s,-1.0]

A = SparseMatrixCSC(m,n,colptr,rowval,nzval)
@show A

b = [-600.0,-720.0,-720.0,-1260.0,4680.0,-3060.0,1072.0,-7344.0,19296.0,-12288.0,2454.0,-5784.0,-7776.0,23616.0,-14346.0,-1344.0,7680.0,-9840.0,-5040.0,11880.0,-1944.0,-952.0,168.0,5370.0,-1240.0,-8730.0,1188.0,4428.0,768.0,-1344.0,-2592.0,4080.0,3480.0,-3672.0,-1944.0,648.0,-144.0,288.0,648.0,-1224.0,-1305.0,1836.0,1458.0,-972.0,-729.0]
var_cones = Any[(:SDP,2:121),(:Free,[1])]
con_cones = Any[(:Zero,1:45)]

using Mosek
solver = Mosek.MosekSolver()
using MathProgBase
m = MathProgBase.ConicModel(solver)
MathProgBase.loadproblem!(m, c, A, b, con_cones, var_cones)
MathProgBase.optimize!(m)
@show MathProgBase.status(m)
Computer
  Platform               : Linux/64-X86    

Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 45              
  Cones                  : 0               
  Scalar variables       : 1               
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Conic interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator - tries                  : 0                 time                   : 0.00            
Eliminator - elim's                 : 0               
Lin. dep.  - tries                  : 1                 time                   : 0.00            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.00    
Optimizer  - threads                : 2               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 45
Optimizer  - Cones                  : 0
Optimizer  - Scalar variables       : 2                 conic                  : 0               
Optimizer  - Semi-definite variables: 1                 scalarized             : 120             
Factor     - setup time             : 0.00              dense det. time        : 0.00            
Factor     - ML order time          : 0.00              GP order time          : 0.00            
Factor     - nonzeros before factor : 1035              after factor           : 1035            
Factor     - dense dim.             : 0                 flops                  : 7.04e+04        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   2.4e+04  1.0e+00  1.0e+00  0.00e+00   0.000000000e+00   0.000000000e+00   1.0e+00  0.01  
1   5.7e+03  2.4e-01  2.4e-01  -1.00e+00  2.406127781e+00   5.517853585e+00   2.4e-01  0.02  
2   1.2e+03  4.9e-02  4.9e-02  -1.00e+00  2.292448504e+01   4.219877422e+01   4.9e-02  0.02  
3   2.7e+02  1.2e-02  1.2e-02  -9.98e-01  1.257221665e+02   2.101056374e+02   1.2e-02  0.02  
4   7.0e+01  3.0e-03  3.0e-03  -9.84e-01  5.275406884e+02   8.463418287e+02   3.0e-03  0.02  
5   1.6e+01  6.7e-04  6.7e-04  -9.07e-01  1.861171057e+03   2.939751526e+03   6.7e-04  0.02  
6   3.8e+00  1.6e-04  1.6e-04  -4.61e-01  2.601215147e+03   3.903253542e+03   1.6e-04  0.02  
7   1.0e+00  4.3e-05  4.3e-05  5.41e-01   8.005093844e+02   1.128803568e+03   4.3e-05  0.02  
8   3.2e-01  1.4e-05  1.4e-05  8.33e-01   2.509853294e+02   3.697263251e+02   1.4e-05  0.02  
9   1.1e-01  4.6e-06  4.6e-06  1.08e+00   4.195226139e+01   7.477469915e+01   4.6e-06  0.02  
10  2.6e-02  1.1e-06  1.1e-06  9.81e-01   8.799789215e+00   1.772018707e+01   1.1e-06  0.02  
11  6.3e-03  2.7e-07  2.7e-07  1.04e+00   -9.009891348e-01  9.549609959e-01   2.7e-07  0.02  
12  1.7e-03  7.0e-08  7.0e-08  9.73e-01   -2.372292974e+00  -1.826642146e+00  7.0e-08  0.02  
13  5.2e-04  2.2e-08  2.2e-08  1.05e+00   -2.824483804e+00  -2.671431950e+00  2.2e-08  0.02  
14  1.5e-04  6.4e-09  6.4e-09  9.21e-01   -2.940292127e+00  -2.887313671e+00  6.4e-09  0.03  
15  1.5e-04  6.4e-09  6.4e-09  1.11e+00   -2.941037404e+00  -2.888806913e+00  6.0e-09  0.03  
16  1.5e-04  6.2e-09  6.3e-09  9.89e-01   -2.935348141e+00  -2.877993451e+00  5.7e-09  0.03  
17  1.5e-04  6.2e-09  6.1e-09  1.29e+00   -2.939037651e+00  -2.884933361e+00  5.5e-09  0.03  
18  1.5e-04  6.2e-09  6.1e-09  1.04e+00   -2.938969764e+00  -2.884797027e+00  5.5e-09  0.03  
19  1.5e-04  6.2e-09  6.1e-09  9.29e-01   -2.938970067e+00  -2.884797457e+00  5.5e-09  0.03  
20  1.5e-04  6.2e-09  6.1e-09  9.01e-01   -2.938970714e+00  -2.884798675e+00  5.5e-09  0.03  
21  1.5e-04  6.2e-09  6.1e-09  8.28e-01   -2.938970714e+00  -2.884798675e+00  5.5e-09  0.03  
Interior-point optimizer terminated. Time: 0.03. 

Optimizer terminated. Time: 0.04    
MathProgBase.status(m) = :Unknown

The problem seems to be solved and finds the optimal objective value which is approximately -3.
However Mosek provides the status :Unknown :( Does this have a meaning or is it a bug ? I thought :Unknown was only the status when the problem has not been solved yet.

getdual in conic interface to Mosek throws BoundsError

Here is an example of the error I get when I call getdual:

ERROR: LoadError: BoundsError: attempt to access 2-element Array{Array{Float64,1},1}:
 [0.0666205723355703,0.04302634696803116,-0.25810960668167754,0.027788215544164746,-0.16669795651893662,1.0000000011590489]
 [0.027774525875638566,0.09856627300800122,-0.16665690730809762,0.3497921239111226,-0.5914322621022672,1.0000000021142892]
  at index [3]
 in getdual at /Users/chris/.julia/v0.4/Mosek/src/MosekConicInterface.jl:526

Unfortunately, I don't understand what's going on here at line 526:

Float64[if     m.conslack[i] == 0 y[i]
            elseif m.conslack[i] >  0 snx[m.conslack[i]]
            else                      bars[-m.conslack[i]][m.barconij[i]]
            end
            for i in 1:m.numcon ]

Unboundedness not detected on unconstrained SDP

The following JuMP code produces an optimal solution instead of unboundedness:

using JuMP

m = Model()
@defVar(m, X[1:1,1:1], SDP)
@setObjective(m, Max, X[1,1])
stat = solve(m) # => :Optimal

getValue(X) # =>
# 1x1 Array{Float64,2}:
#  0.0

If I add a linear constraint, this behavior goes away.

Slow to Download Mosek distro

Hi

I have installed mosek distribution and put it in /users/myname with the license. I have tried Pkg.clone("https://github.com/JuliaOpt/Mosek.jl")`
Pkg.build("Mosek")
`
while Pkg.add("Mosek") seems make no sense.

but the build process was stuck

julia> Pkg.build("Mosek")
INFO: Building Mosek
INFO: Download MOSEK distro (http://download.mosek.com/stable/7/mosektoolsosx64x86.tar.bz2)

it just keeps showing this, maybe something goes wrong with my internet connection. But I have actually downloaded it by myself, can I just skip this process and build it manually ?

thx for help

error in getconicdual

using MathProgBase
using Mosek
solver = MosekSolver()
# min  x
# s.t. y ≥ 1
#      x² + y² ≤ 1
# in conic form:
# min  x
# s.t.  -1 + y ∈ R₊
#        1 - t ∈ {0}
#      (t,x,y) ∈ SOC₃

b = [-1, 1, 0, 0, 0]
A = [ 0 -1 0
      0 0 1
      0 0 -1
      -1 0 0
      0 -1 0 ]
c = [ 1, 0, 0 ]
constr_cones = [(:NonNeg,1:1),(:Zero,2:2),(:SOC,3:5)]
var_cones = [(:Free,1:3)]

m = MathProgBase.model(solver)
MathProgBase.loadconicproblem!(m, c, A, b, constr_cones, var_cones)
MathProgBase.optimize!(m)
@show MathProgBase.status(m)
@show MathProgBase.getobjval(m)
@show MathProgBase.getsolution(m)
y = MathProgBase.getconicdual(m)
@show y
@show -dot(b,y) # should match primal objective
@show c + A'y # should be all zeros, since variables are free

gives

ERROR: type: non-boolean (Float64) used in boolean context
 in anonymous at /home/mlubin/.julia/v0.3/Mosek/src/MosekSolverInterface.jl:842
 in map_to! at abstractarray.jl:1311
 in map at abstractarray.jl:1331
 in getcondual at /home/mlubin/.julia/v0.3/Mosek/src/MosekSolverInterface.jl:832
 in getconicdual at /home/mlubin/.julia/v0.3/Mosek/src/MosekConicInterface.jl:536
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354

CC @kaarthiksundar

Downgraded Mosek Package

Hei,

When doing Pkg.update(), julia downgraded the Mosek package from v0.2 -> v0.1.12.
After downgrading, the below error occured when trying to build the downgraded package...
I'm unsure about whether I should try to fix this, or try to/wait for an upgrade back to Mosek package v0.2 - any suggestions?

julia> Pkg.build("Mosek")
INFO: Building Mosek

WARNING: deprecated syntax "[a=>b, ...]" at C:\Users\lroald.julia\v0.4\Mosek\de
ps\build.jl:81.
Use "Dict(a=>b, ...)" instead.
================================[ ERROR: Mosek ]================================

LoadError: None of the selected providers can install dependency libmosek.
Use BinDeps.debug(package_name) to see available providers

while loading C:\Users\lroald.julia\v0.4\Mosek\deps\build.jl, in expression sta
rting on line 81

================================[ BUILD ERRORS ]================================

WARNING: Mosek had build errors.

  • packages with build errors remain installed in C:\Users\lroald.julia\v0.4
  • build the package(s) and all dependencies with Pkg.build("Mosek")
  • build a single package by running its deps/build.jl script

HS071 NLP problem MathProgBase: MOSEK error 1291: The optimization problem is nonconvex

Hello,

for some reasons HS071 NLP problem reports MOSEK error 1291 even though seemingly solves the problem.
The problem is solvable with alternative solvers: Ipopt

comments are removed because of markdown

using Base.Test, MathProgBase, Mosek
import MathProgBase.MathProgSolverInterface


type HS071 <: MathProgSolverInterface.AbstractNLPEvaluator
end

function MathProgBase.initialize(d::HS071, requested_features::Vector{Symbol})
    for feat in requested_features
        if !(feat in [:Grad, :Jac, :Hess])
            error("Unsupported feature $feat")
            # TODO: implement Jac-vec and Hess-vec products
            # for solvers that need them
        end
    end
end

MathProgBase.features_available(d::HS071) = [:Grad, :Jac, :Hess]

MathProgBase.eval_f(d::HS071, x) = x[1] * x[4] * (x[1] + x[2] + x[3]) + x[3]

function MathProgBase.eval_g(d::HS071, g, x)
    g[1] = x[1]   * x[2]   * x[3]   * x[4]
    g[2] = x[1]^2 + x[2]^2 + x[3]^2 + x[4]^2
end

function MathProgBase.eval_grad_f(d::HS071, grad_f, x)
    grad_f[1] = x[1] * x[4] + x[4] * (x[1] + x[2] + x[3])
    grad_f[2] = x[1] * x[4]
    grad_f[3] = x[1] * x[4] + 1
    grad_f[4] = x[1] * (x[1] + x[2] + x[3])
end

MathProgBase.jac_structure(d::HS071) = [1,1,1,1,2,2,2,2],[1,2,3,4,1,2,3,4]
MathProgBase.hesslag_structure(d::HS071) = [1,2,2,3,3,3,4,4,4,4],[1,1,2,1,2,3,1,2,3,4]


function MathProgBase.eval_jac_g(d::HS071, J, x)
    J[1] = x[2]*x[3]*x[4]  # 1,1
    J[2] = x[1]*x[3]*x[4]  # 1,2
    J[3] = x[1]*x[2]*x[4]  # 1,3
    J[4] = x[1]*x[2]*x[3]  # 1,4

    J[5] = 2*x[1]  # 2,1
    J[6] = 2*x[2]  # 2,2
    J[7] = 2*x[3]  # 2,3
    J[8] = 2*x[4]  # 2,4
end

function MathProgBase.eval_hesslag(d::HS071, H, x, σ, μ)
    H[1] = σ * (2*x[4])               # 1,1
    H[2] = σ * (  x[4])               # 2,1
    H[3] = 0                          # 2,2
    H[4] = σ * (  x[4])               # 3,1
    H[5] = 0                          # 3,2
    H[6] = 0                          # 3,3
    H[7] = σ* (2*x[1] + x[2] + x[3])  # 4,1
    H[8] = σ * (  x[1])               # 4,2
    H[9] = σ * (  x[1])               # 4,3
    H[10] = 0                         # 4,4

    H[2] += μ[1] * (x[3] * x[4])  # 2,1
    H[4] += μ[1] * (x[2] * x[4])  # 3,1
    H[5] += μ[1] * (x[1] * x[4])  # 3,2
    H[7] += μ[1] * (x[2] * x[3])  # 4,1
    H[8] += μ[1] * (x[1] * x[3])  # 4,2
    H[9] += μ[1] * (x[1] * x[2])  # 4,3

    H[1]  += μ[2] * 2  # 1,1
    H[3]  += μ[2] * 2  # 2,2
    H[6]  += μ[2] * 2  # 3,3
    H[10] += μ[2] * 2  # 4,4

end

function nlptest(solver=MathProgBase.defaultNLPsolver)

    m = MathProgBase.model(solver)
    l = [1,1,1,1]
    u = [5,5,5,5]
    lb = [25, 40]
    ub = [Inf, 70]
    MathProgBase.loadnonlinearproblem!(m, 4, 2, l, u, lb, ub, :Min, HS071())
    MathProgBase.optimize!(m)
end

nlptest( MosekSolver() )

-------------------- end of test file -----------------

Misidentifying SOCP as LP

I'm using Mosek.jl through Convex.jl and getting some weird results. I run the same problem through YALMIP and it is solved as a SOCP, but for some reason here Mosek attempts to solve it as an LP (and obviously fails). Convex.jl performs as expected with ECOS and SCS, so I'm assuming it's a problem with Mosek.jl.

https://gist.github.com/iamed2/d15ee9c32c2ec322af01

OPTIMIZER_MAX_TIME ignored

Reported by @mgoycool and @juan-pablo-vielma. When setting the OPTIMIZER_MAX_TIME through MosekSolver(OPTIMIZER_MAX_TIME=1.0), the parameter seems to be ignored.
Some debugging steps:

getnadouparam(m.task, "MSK_DPAR_OPTIMIZER_MAX_TIME")

returns the correct value.

If the parameter is set with:

putdouparam(m.task, MSK_DPAR_OPTIMIZER_MAX_TIME, 1.0)

instead of (via this line),

putnadouparam(m.task, "MSK_DPAR_OPTIMIZER_MAX_TIME", 1.0)

then everything works fine. So something nontrivial seems to be wrong in putnadouparam.

Return premature results if status is Unknown

Currently Mosek doesn't return any information about solution and dual if the status is Unknown (even if the primal is feasible). It would be helpful if we got at least the feasible solution (and if there exist a dual corresponding to it). Many thanks!

CC @mlubin @chriscoey

error "Invalid SDP cone definition"

I'm running the mathprogbase conic SDP tests (which aren't currently run by default, tho I submitted a pull request for that), and I'm getting this error:

ERROR: LoadError: Mosek.MosekMathProgSolverInterface.MosekMathProgModelError("Invalid SDP cone definition")
 in countcones at /Users/chris/.julia/v0.4/Mosek/src/MosekConicInterface.jl:629
 in loadproblem! at /Users/chris/.julia/v0.4/Mosek/src/MosekConicInterface.jl:116
 in loadproblem! at /Users/chris/.julia/v0.4/Mosek/src/MosekConicInterface.jl:93
 in loadproblem! at /Users/chris/.julia/v0.4/Mosek/src/MosekConicInterface.jl:82
 in conicSDPtest at /Users/chris/.julia/v0.4/MathProgBase/test/conicinterface.jl:508

I think the two problems are well posed in conic format (following this pull request at least).

I looked at the code for countcones and I may be daft but I don't get it...

for (sym,idxs) in cones
        if ! (sym in msk_accepted_cones)
            throw(MosekMathProgModelError("Unsupported cone type"))
        end
        vecsize += length(idxs)

        if     sym == :SDP
            n = round(Int32,sqrt(.25+2*length(idxs))-0.5)
            if n*(n+1)/2 != size(idxs,1) # does not define the lower triangular part of a square matrix
                throw(MosekMathProgModelError("Invalid SDP cone definition"))
            end

Because length(idxs) = size(idxs,1).

Indexing error when mixing SDP and SOCP

The following JuMP code produces an internal indexing error:

using JuMP

m = Model()

@defVar(m, x[1:1,1:1], SDP)
@defVar(m, y)
@defVar(m, z >= 0)
@defVar(m, t >= 0)
@addConstraint(m, (y-1)^2 <= z^2)
@addConstraint(m, (x[1,1]-1)^2 <= t^2)

solve(m)
ERROR: Mosek.MosekError(1204,"The index value 7 occurring in argument '(asub+aptrb[1])[0]' is too large.")
 in putarowslice at /Users/huchette/.julia/v0.4/Mosek/src/msk_functions.jl:2644
 in putarowslice at /Users/huchette/.julia/v0.4/Mosek/src/msk_functions.jl:2622
 in addquadconstr! at /Users/huchette/.julia/v0.4/Mosek/src/MosekLowLevelQCQO.jl:148
 in addQuadratics at /Users/huchette/.julia/v0.4/JuMP/src/solvers.jl:87
 in solveSDP at /Users/huchette/.julia/v0.4/JuMP/src/solvers.jl:622
 in solve at /Users/huchette/.julia/v0.4/JuMP/src/solvers.jl:27

Mosek.jl 0.1.4 fails to build on OS X

I'm running Julia 0.3.5 on OS X Yosemite. Mosek.jl was installed before and worked without problem. I run Pkg.update() earlier today and it tried to update Mosek.jl to version 0.1.4. However, I received the following building error

================================[ ERROR: Mosek ]================================

None of the selected providers can install dependency libmosek.
Use BinDeps.debug(package_name) to see available providers

while loading /Users/xiaoweiz/.julia/v0.3/Mosek/deps/build.jl, in expression starting on line 87

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Mosek had build errors.

 - packages with build errors remain installed in /Users/xiaoweiz/.julia/v0.3
 - build the package(s) and all dependencies with `Pkg.build("Mosek")`
 - build a single package by running its `deps/build.jl` script

===============================================================================

Then running BinDeps.debug("Mosek") gives

The package declares 2 dependencies.
 - Library "libmosek"
    - Providers:
      - Binaries (can't provide)
 - Library "libmosekscopt"

However, on another machine with Ubuntu 14.04, Mosek.jl was indeed successfully updated to 0.1.4.

Exposing geometric programming interface

It seems the geometric programming interface is not included in the shared library in the Mosek distro, but rather through some C routines that wrap around the existing API and are accessible to the user through the dgopt/expopt executables. Since we need a shared library to call from Julia, ideally it would be great to bundle the routines into the shared library. If that is not possible (at least in the short term), what is the viability of someone porting the C code to Julia? It doesn't seem extremely complex (and I'd be potentially willing to do the work at some point), but I'm unclear how the licensing would work out. Thoughts?

cc @ulfworsoe @mlubin

code generation update

In latest Julia 0.3:

WARNING: A::Array - x::Number is deprecated, use A .- x instead.
 in - at deprecated.jl:26
 in putclist at /home/mlubin/.julia/v0.3/Mosek/src/msk_functions.jl:17
 in loadproblem! at /home/mlubin/.julia/v0.3/Mosek/src/MosekSolverInterface.jl:87
 in loadproblem! at /home/mlubin/.julia/v0.3/Mosek/src/MosekSolverInterface.jl:105

Changing this shouldn't break compatibility with 0.2.

Installation issue/BinDeps

Perhaps someone can help me shed some light on this.

I tried doing this (installing to a completely clean slate on linux x64, Ubuntu 14.04):

rm -rf ./juliapkg
export JULIA_PKGDIR=./juliapkg
julia -e 'Pkg.init(); Pkg.add("Mosek")'

Doing so produced this error:

================================[ ERROR: Mosek ]================================

LoadError: ArgumentError: BinDeps not found in path
while loading /home/ulfw/juliapkg/v0.4/Mosek/deps/build.jl, in expression starting on line 3

===============================================================================

I could see that BinDeps installed correctly before Mosek, and afterwards doing

julia -e 'using BinDeps'

produced no errors. However,

julia -e 'Pkg.build("Mosek")'

consistently fails for me.

I am working on an non-BinDeps based installer, but I will have to either copy the download/unpack functions if I cannot import BinDeps.

@joehuchette @mlubin

Transition from MOSEK 7.0 to 7.1 (and later to 8.0)

We recently released MOSEK 7.1, deprecating 7.0.

I have discovered some problems in the installer (deps/build.jl):

  • all version numbers are hardcoded, and
  • builder does not check if the downloaded file (the mosek distro) has been updated - this is a problem since the url for Mosek 7.1 is exactly the same as for 7.0 (7.1 has replaced 7.0, and 7.0 cannot be downloaded anymore), but the library names are not the same.

So:

  • Should we say that the newest Mosek.jl only supports the latest Mosek?
  • Is there a way to automatically force redownload, even if the url has not changed (but the actual file has)?

cc @mlubin @IainNZ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.