Giter VIP home page Giter VIP logo

mosektools.jl's Introduction

MosekTools.jl

MosekTools.jl is the MathOptInterface.jl implementation for the MOSEK solver.

The low-level solver API for MOSEK is found in the package Mosek.jl.

Affiliation

MosekTools.jl is maintained by the JuMP community and is not officially supported by MOSEK. However, Mosek.jl is an officially supported product of MOSEK.

License

MosekTools.jl is licensed under the MIT License.

The underlying solver is a closed-source commercial product for which you must obtain a license.

Installation

The latest release of this package and the master branch are to be used with the latest release of Mosek.jl (which uses MOSEK v10).

To use MOSEK v9 (resp. v8), use the v0.12.x (resp. v0.7.x) releases of this package, and the mosekv9 (resp. mosekv8) branch and v1.2.x (resp. v0.9.x) releases of Mosek.jl.

See the following table for a summary:

MOSEK Mosek.jl MosekTools.jl release MosekTools.jl branch
v10 v10 v0.13 master
v9 v0.12 v0.12 mosekv9
v8 v0.9 v0.7 mosekv8

Use with JuMP

using JuMP
using MosekTools
model = Model(Mosek.Optimizer)
set_attribute(model, "QUIET", true)
set_attribute(model, "INTPNT_CO_TOL_DFEAS", 1e-7)

Options

The parameter QUIET is a special parameter that when set to true disables all Mosek printing output.

All other parameters can be found in the Mosek documentation.

Note that the prefix MSK_IPAR_ (for integer parameters), MSK_DPAR_ (for floating point parameters) or MSK_SPAR_ (for string parameters) are optional. If they are not given, they are inferred from the type of the value. For example, in the example above, as 1e-7 is a floating point number, the parameters name used is MSK_DPAR_INTPNT_CO_TOL_DFEAS.

mosektools.jl's People

Contributors

benchung avatar blegat avatar chriscoey avatar issamt avatar joaquimg avatar juliatagbot avatar matbesancon avatar mlubin avatar mtanneau avatar odow avatar ulfworsoe 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mosektools.jl's Issues

Reading out results fails in a JuMP example

This JuMP example min_ellispe.jl uses SCS by default. If you switch it to Mosek, reading out the data after the end of the optimization is broken.

  • The JuMP.primal_status() is UNKNOWN_RESULT_STATUS
  • Mosek output on the terminal shows the primal,dual obj value ~6.46, but JuMP.objective_value() shows 5.0
  • Solution matrix is messed up, too.

Add support for quadratic objectives

Atm the MOI interface for Mosek doesn't support quadratic objectives (without bridges). Was that a conscious decision?

Mosek certainly supports quadratic objectives modeling, see this example:
https://github.com/JuliaOpt/Mosek.jl/blob/master/examples/qo1.jl

or in Python:
https://docs.mosek.com/9.2/pythonapi/tutorial-qo-shared.html

I am assuming here that the problem isn't transformed internally by mosek when a quadratic objective term is added via their model API.

1-by-1 matrix PSD constraint

using JuMP, MosekTools

m = JuMP.Model(Mosek.Optimizer)
@variable(m, x)
@objective(m, Min, 1+x)
M = reshape([x],1,1)
@constraint(m, M in PSDCone())
optimize!(m)

ERROR: Invalid dimension for semidefinite constraint, got 1 which is smaller than the minimum dimension 2.
Stacktrace:

This can be fixed at the level of JuMP, for example:

length(M) == 1 ? @constraint(m, M[1,1] >= 0) : @constraint(m, M in PSDCone())

but perhaps a fix with MosekTools would give better user experience?

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Support nonlinear problems?

Hi, I tried to test the exponential cone constraint feature in Mosek 9.1.2 with a simple example: min exp(x) s.t. x>=0 and I use the equivalent formulation: min t s.t. t>=exp(x), x>=0. But I got the error:"The solver does not support nonlinear problems (i.e., NLobjective and NLconstraint)." The code I used is the following:

using JuMP, LinearAlgebra, MosekTools
M = Model(with_optimizer(Mosek.Optimizer))
@variable(M, x)
@variable(M, t)
@NLconstraint(M, t-exp(x)>=0)
@constraint(M, x>=0)
optimize!(M)

Could you please suggest a way out of this? The test was performed in Julia 1.1.1 with JuMP v0.20.1, MosekTools v0.9.3

Thanks!

Why Mosek can not resolve new model when the added new constraints include SOCP constraints?

Here is a mini-case of my mathematical model.
First, solve the initial model, and check if the solution meets the condition. If it does not, the new constraints will be added, and solve the new model.
But there are some problems in this process:

  1. Use Mosek as solver, when only add linear constraints (Con1), the new model can be solved, and the final optimal value is 0.5;
  2. Use Mosek as solver, when the adding constraints include SOCP constraints (Con2), Mosek won’t resolve the new model, it will just keep the solution of initial model (the optimal value of initial model is 1).
  3. Use other solvers, e.g. Gurobi, when the adding constraints include SOCP constraints, the new model can be solved, and the final optimal value is about 0.25.

In conclusion, Mosek can not resolve the new model, when the added new constraints include SOCP constraints.

using JuMP, MosekTools, Gurobi

model = Model(Gurobi.Optimizer)
#model = Model(Mosek.Optimizer)

@variable(model, x)
@variable(model, y)
@objective(model, Max, x)
@constraint(model, x <= 1)
@constraint(model, y <= 1)
optimize!(model)
println("objective value:", objective_value(model))

#check if we need to add new constraints
x_val = value.(x)
if x_val >=0.5
    @constraint(model, x <= 0.5) #Con1
    @constraint(model, [y; 4x] in SecondOrderCone()) #Con2
end
optimize!(model) 
println("objective value:", objective_value(model))

Could someone give me some ideas on how this problem comes? And how to solve the problem?
Thanks!

P.S. the problem has also been posted on Discourse
https://discourse.julialang.org/t/why-mosek-can-not-resolve-new-model-when-the-added-new-constraints-include-socp-constraints/64411?u=sawyer_zhou

Some nonlinear cone constraints do not appear in MOI.ListOfConstraints

Exponential and power cone constraints are not returned when querying the MOI.ListOfConstraints attribute

For instance,

model = Mosek.Optimizer()

x = MOI.add_variables(model, 3)
MOI.add_constraint(model, MOI.VectorOfVariables(x), MOI.ExponentialCone())

MOI.get(model, MOI.ListOfConstraints())  # returns `Tuple{DataType, DataType}[]`

Peeking at the MOI wrapper code, it looks like the culprit is here:

for D in [MOI.SecondOrderCone, MOI.RotatedSecondOrderCone,
# TODO reenable for Mosek 9
#MOI.PowerCone{Float64}, MOI.DualPowerCone{Float64},
#MOI.ExponentialCone, MOI.DualExponentialCone,
MOI.PositiveSemidefiniteConeTriangle]

Given that the latest release and current master branch are for Mosek v9, would it make sense to re-enable the above?

Preparing for MOSEK 10

In MOSEK 10 we will make some API additions and some deprecations that are relevant to MathOptInterface. Most importantly we are deprecating variable-in-cone bounds and introducing constraints of the form Ax+b in K, and we are adding a few cone types.

The summay:

  • Deprecated: VectorOfVariables in cone
  • Unchanged: VectorOfVariables in PSD cone
  • New: VectorAffineFunction in cone (including linearized PSD cone)

@blegat I will probably need some advice on what to add and remove.

UndefVarError: MSK_CT_PEXP not defined

When using Mosek as a solver, the following error is returned.

UndefVarError: MSK_CT_PEXP not defined

Stacktrace:
[1] abstractset2ct at /home/mkolar/.julia/packages/MathOptInterfaceMosek/GfJrM/src/constraint.jl:238 [inlined]
[2] addbound!(::MosekModel, ::Int64, ::Array{Int64,1}, ::Array{Float64,1}, ::MathOptInterface.ExponentialCone) at /home/mkolar/.julia/packages/MathOptInterfaceMosek/GfJrM/src/constraint.jl:456
[3] add_constraint(::MosekModel, ::MathOptInterface.VectorAffineFunction{Float64}, ::MathOptInterface.ExponentialCone) at /home/mkolar/.julia/packages/MathOptInterfaceMosek/GfJrM/src/constraint.jl:78
[4] copyconstraints!(::MosekModel, ::MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Type{MathOptInterface.VectorAffineFunction{Float64}}, ::Type{MathOptInterface.ExponentialCone}) at /home/mkolar/.julia/packages/MathOptInterface/QO3Mk/src/Utilities/copy.jl:76
[5] default_copy_to(::MosekModel, ::MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}, ::Bool) at /home/mkolar/.julia/packages/MathOptInterface/QO3Mk/src/Utilities/copy.jl:109
[6] #copy_to#12 at /home/mkolar/.julia/packages/MathOptInterfaceMosek/GfJrM/src/MathOptInterfaceMosek.jl:427 [inlined]
[7] (::getfield(MathOptInterface, Symbol("#kw##copy_to")))(::NamedTuple{(:copy_names,),Tuple{Bool}}, ::typeof(MathOptInterface.copy_to), ::MosekModel, ::MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}) at ./none:0
[8] attachoptimizer!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}}) at /home/mkolar/.julia/packages/MathOptInterface/QO3Mk/src/Utilities/cachingoptimizer.jl:125
[9] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}}) at /home/mkolar/.julia/packages/MathOptInterface/QO3Mk/src/Utilities/cachingoptimizer.jl:158
[10] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP.JuMPMOIModel{Float64}}},MathOptInterface.Bridges.AllBridgedConstraints{Float64}}) at /home/mkolar/.julia/packages/MathOptInterface/QO3Mk/src/Bridges/bridgeoptimizer.jl:73
[11] #optimize!#96(::Bool, ::Function, ::JuMP.Model, ::Nothing) at /home/mkolar/.julia/packages/JuMP/uAycC/src/optimizer_interface.jl:84
[12] macro expansion at /home/mkolar/.julia/packages/JuMP/uAycC/src/optimizer_interface.jl:61 [inlined]

The code is below, where Ψx and Ψy are two matrices.
SCS solver seems to find a solution.

function KLIEP(Ψx, Ψy, solver)
    m, nx = size(Ψx)
    ny = size(Ψy, 2)
    @assert m == size(Ψy, 1)

    lny = log(ny)

    problem = JuMP.Model(solver)
    JuMP.@variable(problem, Θ[1:m])
    JuMP.@variable(problem, t)
    JuMP.@variable(problem, u[1:ny])

    JuMP.@constraint(problem, sum(u) <= 1.)
    for j=1:ny
        JuMP.@constraint(problem, [dot(Θ, Ψy[:, j]) - t - lny, 1., u[j]] in MOI.ExponentialCone())
    end

    JuMP.@objective(problem, Min, -sum(Ψx'*Θ) + t)
    JuMP.optimize!(problem)

    JuMP.result_value.(Θ)
end


solver = JuMP.with_optimizer(MosekOptimizer, QUIET=false)
θhat = KLIEP(Ψx, Ψy, solver)

Issues Precompiling MosekTools.jl

Dear MosekTools developers,

I have been experimenting with MosekTools lately and came across some unexpected precompilation issues. In short, I am unable to import the package (precompilation never stops) when creating a new environment or installing it into the default project of a new Julia release. I have so far encountered this issue with Julia 1.4, 1.5, 1.6 and 1.7, with the most recent versions of MosekTools corresponding to each release and MosekTools v0.9.3 (I did not test versions in between). The only situation in which the package works is in my old Julia 1.4 default project, where the package was pre-compiled a while back and is not pre-compiled again upon import.

Please find attached a screenshot of one of the configurations I was testing. The issue seems so weird that I suspect I am doing something wrong. I can't exactly figure out what, unfortunately, and any help or suggestion would be much appreciated.

I look forward to hearing from you,

Best regards,

Mathias Berger

MosekTools_precompilation

Error when querying VariablePrimal and some variable do not appear in any constraint/objective

Seems like if a variable does not appear in any constraint/objective, then this variable is not passed to Mosek.
This leads to a BoundsError when subsequently querying the value of said variable.

import MathOptInterface
import Mosek
import MosekTools

m = Mosek.Optimizer()
MOI.add_variables(m, 2)
# Mosek.getnumvar(m.task)  # returns 0
MOI.optimize!(m)
# Mosek.getnumvar(m.task)  # still returns 0
MOI.get(m, MOI.VariablePrimal(), x)  # raises error
# Mosek.getnumvar(m.task)  # now returns 1
ERROR: BoundsError: attempt to access 0-element Array{Float64,1} at index [1]
Stacktrace:
 [1] getindex at ./array.jl:731 [inlined]
 [2] getindex at ./multidimensional.jl:412 [inlined]
 [3] variable_primal at /home/mathieu/.julia/packages/MosekTools/IZOa0/src/attributes.jl:44 [inlined]
 [4] variable_primal at /home/mathieu/.julia/packages/MosekTools/IZOa0/src/attributes.jl:54 [inlined]
 [5] get(::MosekTools.MosekModel, ::MathOptInterface.VariablePrimal, ::MathOptInterface.VariableIndex) at /home/mathieu/.julia/packages/MosekTools/IZOa0/src/attributes.jl:261
 [6] get!(::Array{Float64,1}, ::MosekTools.MosekModel, ::MathOptInterface.VariablePrimal, ::Array{MathOptInterface.VariableIndex,1}) at /home/mathieu/.julia/packages/MosekTools/IZOa0/src/attributes.jl:268
 [7] get(::MosekTools.MosekModel, ::MathOptInterface.VariablePrimal, ::Array{MathOptInterface.VariableIndex,1}) at /home/mathieu/.julia/packages/MosekTools/IZOa0/src/attributes.jl:275
 [8] top-level scope at none:0

add_constraint with VariableIndex and Domain does not really support MOI.ZeroOne

With some of the new MOI tests

test_variable_solve_ZeroOne_with_upper_bound: Error During Test at /home/mbesancon/.julia/packages/MathOptInterface/zWv93/src/Test/Test.jl:180
  Got exception outside of a @test
  MethodError: no method matching incompatible_mask(::Type{MathOptInterface.ZeroOne})
  Closest candidates are:
    incompatible_mask(::Type{MathOptInterface.EqualTo{Float64}}) at /home/mbesancon/julia_projects/MosekTools.jl/src/constraint.jl:304
    incompatible_mask(::Type{MathOptInterface.GreaterThan{Float64}}) at /home/mbesancon/julia_projects/MosekTools.jl/src/constraint.jl:306
    incompatible_mask(::Type{MathOptInterface.LessThan{Float64}}) at /home/mbesancon/julia_projects/MosekTools.jl/src/constraint.jl:308
    ...
  Stacktrace:
    [1] add_constraint(m::MosekTools.Optimizer, xs::MathOptInterface.VariableIndex, dom::MathOptInterface.ZeroOne)
      @ MosekTools ~/julia_projects/MosekTools.jl/src/constraint.jl:400
    [2] test_variable_solve_ZeroOne_with_upper_bound(model::MosekTools.Optimizer, config::MathOptInterface.Test.Config{Float64})
      @ MathOptInterface.Test ~/.julia/packages/MathOptInterface/zWv93/src/Test/test_variable.jl:364

set_optimizer_attribute() issue

Julia 1.7.1
The following piece of code

model = read_from_file("../../../sdplib/theta1.dat-s")
set_optimizer(model, Mosek.Optimizer)
set_optimizer_attribute(model,"MSK_IPAR_INTPNT_SOLVE_FORM", MosekTools.MSK_SOLVE_DUAL)

gives error message

ERROR: MethodError: no method matching map_indices(::MathOptInterface.Utilities.var"#7#8"{MathOptInterface.Utilities.IndexMap}, ::Mosek.Solveform)

This works:

model = Model(with_optimizer(Mosek.Optimizer,  MSK_IPAR_INTPNT_SOLVE_FORM  = MosekTools.MSK_SOLVE_DUAL));

but then I don't know how to read the SDPA file into the existing model.

Simple SDP fails to solve

I recently updated some of my Julia packages related to optimization as follows:

[4076af6c] ↑ JuMP v0.21.10 ⇒ v0.22.1
[b8f27783] ↑ MathOptInterface v0.9.22 ⇒ v0.10.6
[1ec41992] ↑ MosekTools v0.9.4 ⇒ v0.10.0
[4076af6c] ↑ JuMP v0.21.10 ⇒ v0.22.1
[b8f27783] ↑ MathOptInterface v0.9.22 ⇒ v0.10.6
[1ec41992] ↑ MosekTools v0.9.4 ⇒ v0.10.0

Now after updating, I am getting error solving a very simple SDP, which I was able to solve without any problem prior to my update. My Mosek version is 9.3.10 (the latest). The SDP is as follows:

using JuMP, MosekTools, Mosek, LinearAlgebra

N = 3

model = Model(optimizer_with_attributes(Mosek.Optimizer))

# construct G ⪰ 0
@variable(model, G[1:N, 1:N], PSD)

@variable(model, F[1:N-1] >= 0)

A = [1 2 3; 4 5 6; 7 8 9]

b = [7;8]

@constraint(model,  F'*b + tr(G) <= 0)

@objective(model, Min, sum(F) - tr(G))

optimize!(model)

p_star = objective_value(model)

G_star = value.(G)

F_star = value.(F)

The error I am getting is as follows:


MethodError: no method matching set_column_name(::Mosek.Task, ::MosekTools.MatrixIndex, ::String)
Closest candidates are:
  set_column_name(::Mosek.Task, !Matched::MosekTools.ColumnIndex, ::String) at C:\Users\shuvo\.julia\packages\MosekTools\Ryr4X\src\variable.jl:44
  set_column_name(!Matched::MosekTools.Optimizer, !Matched::MathOptInterface.VariableIndex, ::String) at C:\Users\shuvo\.julia\packages\MosekTools\Ryr4X\src\variable.jl:47
in eval at base\boot.jl:360 
in top-level scope at junk_7.jl:22
in optimize! at JuMP\2IF9U\src\optimizer_interface.jl:167
in optimize! at JuMP\2IF9U\src\optimizer_interface.jl:167 
in var"#optimize!#121" at JuMP\2IF9U\src\optimizer_interface.jl:195
in optimize! at MathOptInterface\eoIu0\src\Utilities\cachingoptimizer.jl:285
in optimize! at MathOptInterface\eoIu0\src\MathOptInterface.jl:80 
in copy_to at MathOptInterface\eoIu0\src\Bridges\bridge_optimizer.jl:421 
in #copy_to#7 at MathOptInterface\eoIu0\src\Bridges\bridge_optimizer.jl:421 
in default_copy_to at MathOptInterface\eoIu0\src\Utilities\copy.jl:438
in pass_attributes at MathOptInterface\eoIu0\src\Utilities\copy.jl:69
in _pass_attribute at MathOptInterface\eoIu0\src\Utilities\copy.jl:84
in set at MathOptInterface\eoIu0\src\Bridges\bridge_optimizer.jl:1327 
in set at MosekTools\Ryr4X\src\variable.jl:296 
in set_column_name at MosekTools\Ryr4X\src\variable.jl:48

The code ran without any problem before updating.

Large number of nonzeros in (very sparse) SDP solving

Heya MosekTools team!

I've been running into a problem with Mosek (similar to the one given in #40): when solving a very sparse SDP, the number of nonzeros that I've been running into has been huge. For example, here's a simple problem (with optimal value 0):

using MosekTools, JuMP, SparseArrays, LinearAlgebra

m = Model(Mosek.Optimizer)

n = 100

@variable(m, x[1:100])
@variable(m, t)

@objective(m, Min, t)
Q = [
    sparse([t])     x'
    x               sparse(I(n))
]
@constraint(m, Q  PSDCone())

optimize!(m)

Running this, we get:

Presolve terminated. Time: 0.00    
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 5151            
  Cones                  : 0               
  Scalar variables       : 101             
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer  - threads                : 4               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 5151
Optimizer  - Cones                  : 1
Optimizer  - Scalar variables       : 102               conic                  : 102             
Optimizer  - Semi-definite variables: 1                 scalarized             : 5151            
Factor     - setup time             : 2.18              dense det. time        : 0.00            
Factor     - ML order time          : 1.43              GP order time          : 0.00            
Factor     - nonzeros before factor : 1.33e+07          after factor           : 1.33e+07        
Factor     - dense dim.             : 0                 flops                  : 4.57e+10    

The problem here is specifically Factor - nonzeros before factor : 1.33e+07 (!). The number of nonzeros here should be something like 3n + 1. In fact, this is so large, I'm not even sure where this number could come from! (Certainly even concretizing the whole matrix Q yields only a total number of 101^2 nonzeros. There are probably some additional affine constraints in the cone embedding, I'm sure, but still.)

Additionally, comparing the number of nonzeros with something like COSMO.jl is many times larger than presented. (E.g., I think this might rule out the issue that JuMP/MOI is not correctly handling sparsity, but I could be wrong.)

Anyways, it would be extraordinarily helpful to be able to solve these big SDPs using a relatively robust interior point method, so I'd love to know if I'm doing something wrong here :)

Thanks!

Can't add eq-constraint on matrix variable

Assume I want to solve the following SDP with JuMP / Mosek:

using MosekTools, MathOptInterface, JuMP
const MOI = MathOptInterface
const MOIB = MathOptInterface.Bridges
const MOIU = MOI.Utilities


# Solve Problem in JuMP (works!)
no = 3
model = JuMP.Model(with_optimizer(Mosek.Optimizer));
@variable(model, X[1:no,1:no], PSD);
@objective(model, Min, X[1]);
@constraint(model, X[1, 2] == 1.)
JuMP.optimize!(model);

This works. Now, I want to solve the same problem with just MOI:

# Solve Problem in MOI (fails!)
model2 = MOIU.UniversalFallback(MOIU.Model{Float64}());
x = MOI.add_variables(model2, 6);
# add objective
MOI.set(model2, MOI.ObjectiveFunction{MOI.VariableIndex}(), x[1]);
MOI.set(model2, MOI.ObjectiveSense(), MOI.MIN_SENSE);
# add constraints
MOI.add_constraint(model2, x[2], MOI.EqualTo(1.));
MOI.add_constraint(model2, MOI.VectorOfVariables(x), MOI.PositiveSemidefiniteConeTriangle(no));

optimizer = MOIU.CachingOptimizer(MOIU.UniversalFallback(MOIU.Model{Float64}()), Mosek.Optimizer());
bridged = MOIB.full_bridge_optimizer(optimizer, Float64);
MOI.copy_to(bridged, model2)
MOI.optimize!(bridged);

This fails with the following error:

ERROR: Cannot add MathOptInterface.EqualTo{Float64} constraint on a matrix variable
Stacktrace:
 [1] error(::String) at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 [2] add_constraint(::MosekModel, ::MathOptInterface.VariableIndex, ::MathOptInterface.EqualTo{Float64}) at /Users/Micha/.julia/packages/MosekTools/ywNQy/src/constraint.jl:385
 [3] add_constraint(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.VariableIndex, ::MathOptInterface.EqualTo{Float64}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/cachingoptimizer.jl:250
 [4] _broadcast_getindex_evalf at ./broadcast.jl:630 [inlined]
 [5] _broadcast_getindex at ./broadcast.jl:603 [inlined]
 [6] getindex at ./broadcast.jl:563 [inlined]
 [7] macro expansion at ./broadcast.jl:909 [inlined]
 [8] macro expansion at ./simdloop.jl:77 [inlined]
 [9] copyto! at ./broadcast.jl:908 [inlined]
 [10] copyto! at ./broadcast.jl:863 [inlined]
 [11] copy at ./broadcast.jl:839 [inlined]
 [12] materialize at ./broadcast.jl:819 [inlined]
 [13] add_constraints(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::Array{MathOptInterface.VariableIndex,1}, ::Array{MathOptInterface.EqualTo{Float64},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/constraints.jl:168
 [14] add_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::Array{MathOptInterface.VariableIndex,1}, ::Array{MathOptInterface.EqualTo{Float64},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:1065
 [15] copy_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::MathOptInterface.Utilities.IndexMap, ::Array{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex,MathOptInterface.EqualTo{Float64}},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:228
 [16] pass_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex,MathOptInterface.EqualTo{Float64}},1},1}, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle},1},1}, ::typeof(MathOptInterface.Utilities.copy_constraints), ::typeof(MathOptInterface.set)) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:243
 [17] pass_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex,MathOptInterface.EqualTo{Float64}},1},1}, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle},1},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:240
 [18] default_copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:340
 [19] #automatic_copy_to#97 at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:15 [inlined]
 [20] automatic_copy_to at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:14 [inlined]
 [21] #copy_to#3 at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:254 [inlined]
 [22] copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:254
 [23] top-level scope at REPL[20]:1

However, when the MOI-equality-constraint is replaced by the following line:

MOI.add_constraint(model2, MOI.ScalarAffineFunction{Float64}([MOI.ScalarAffineTerm{Float64}(1., x[2])], 0.), MOI.EqualTo(1.));

it works again.

Bug: KNITRO 0.12.0 cannot be installed with latest JuMP, MathOptInterface and downgrades JuMP to 0.18.6

Dear All,

The latest version of KNITRO 0.12.0 cannot be installed with latest version of JuMP and MathOptInterface. Running

add [email protected]

gives

Resolving package versions...
ERROR: Unsatisfiable requirements detected for package KNITRO [67920dd8]:
 KNITRO [67920dd8] log:
 ├─possible versions are: 0.5.0-0.11.1 or uninstalled
 └─restricted to versions 0.12.0 by an explicit requirement — no versions left

And doing just

add KNITRO

downgrades JuMP form latest version to 0.18.6, as you can see in the log:

   Resolving package versions...
   Installed Compat ──────────── v2.2.1
   Installed KNITRO ──────────── v0.5.2
   Installed MathProgBase ────── v0.7.8
   Installed DataStructures ──── v0.17.20
   Installed ReverseDiffSparse ─ v0.8.6
   Installed JuMP ────────────── v0.18.6
    Updating `C:\Users\shuvo\.julia\environments\v1.6\Project.toml`
  [4076af6c] ↓ JuMP v0.23.0 ⇒ v0.18.6
  [67920dd8] + KNITRO v0.5.2
    Updating `C:\Users\shuvo\.julia\environments\v1.6\Manifest.toml`
  [34da2185] ↓ Compat v3.41.0 ⇒ v2.2.1
  [864edb3b] ↓ DataStructures v0.18.11 ⇒ v0.17.20
  [4076af6c] ↓ JuMP v0.23.0 ⇒ v0.18.6
  [67920dd8] + KNITRO v0.5.2
  [fdba3010] + MathProgBase v0.7.8
  [89212889] + ReverseDiffSparse v0.8.6

Generated cuts at MIP root node not passed down

Hello,
I’m working on a problem using Mosektools & JUMP. It seems that after running it heuristics and cut generation at the root node, it fails to add them to the problem. As you can see in the output below, the relaxation objective isn’t modified based on the lower bound found at the root node:

BRANCHES RELAXS   ACT_NDS  DEPTH    BEST_INT_OBJ         BEST_RELAX_OBJ       REL_GAP(%)  TIME  
0        1        1        0        NA                   5.8931608812e-07     NA          0.0   
0        1        1        0        1.2255160232e-06     5.8931608812e-07     51.91       0.1   
0        1        1        0        6.5593301415e-07     5.8931608812e-07     10.16       0.1   
Cut generation started.
0        1        1        0        6.5593301415e-07     5.9350413814e-07     9.52        0.2   
Cut generation terminated. Time = 0.00
10       14       11       3        6.5593301415e-07     5.3101616733e-07     19.04       0.4   
24       28       23       6        6.5593301415e-07     5.3101616733e-07     19.04       0.5 

As you can see, at the root node the lower bound is improved to a relative gap of 9.52%, but the jumps back up to 19.04%.
Best,
H.

ObjectiveBound is invalid

o = Mosek.Optimizer()
config = MOIT.Config(Float64, atol=1e-3, rtol=1e-3)
MOIT.test_solve_ObjectiveBound_MAX_SENSE_LP(o, config)

This fails for a one-variable problem with a bound because:

julia> MOI.get(model, MOI.ObjectiveValue())
4.0

julia> MOI.get(model, MOI.ObjectiveBound())
0.0

julia> MOI.get(model, MOI.DualObjectiveValue())
4.0

BoundsError in JuMP.value.(x)

Here is a simple example to illustrate the error:

using Mosek, MosekTools, JuMP, LinearAlgebra, Random, Gurobi
M = Model(with_optimizer(Mosek.Optimizer))
@variable(M, x[1:10])
@variable(M, t)
@constraint(M, x[1:2].>=0)
@constraint(M, t>=0)
@objective(M, Min, t+x[1]+x[2])
optimize!(M)

Now I want to get the optimal value of x by JuMP.value.(x), I will get the error: BoundsError: attempt to access 3-element Array{Float64,1} at index [4].

This issue doesn't happen with Gurobi.Optimizer, and can also be fixed by changing @constraint(M, x[1:2].>=0) to @constraint(M, x[1:10].>=0).

I'm guessing this is happening because the variables x[3:10] are unused. But what if I still want to get the optimal values for x[1] and x[2]?
With Gurobi, I can simply do JuMP.value.(x) and all the unused components in x will be replaced with 0. But it looks like Mosek can't do this.

Thank you!

Missing support for names

This would allow Mosek to be used without a caching optimizer in JuMP hence allowing peformance-concerned user get the most out of Mosek

UndefVarError: val not defined when specifying parameter without specifying prefix (e.g. MSK_DPAR)

On Julia 1.0/JuMP 0.19.0/MOI 0.8.4/MosekTools v0.7.2+ #master/Mosek v0.9.11+ #master,
running the code

model = Model(with_optimizer(Mosek.Optimizer,INTPNT_CO_TOL_DFEAS=1e-7))

yields the error:

ERROR: UndefVarError: val not defined
Stacktrace:
 [1] set(::MosekModel, ::MosekTools.Parameter, ::Float64) at /Users/Ryancw2/.julia/packages/MosekTools/wCBiJ/src/MosekTools.jl:189
 [2] #Optimizer#15(::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:INTPNT_CO_TOL_DFEAS,),Tuple{Float64}}}, ::Function) at /Users/Ryancw2/.julia/packages/MosekTools/wCBiJ/src/MosekTools.jl:229
 [3] (::getfield(Mosek, Symbol("#kw##Optimizer")))(::NamedTuple{(:INTPNT_CO_TOL_DFEAS,),Tuple{Float64}}, ::typeof(Mosek.Optimizer)) at ./none:0
 [4] (::OptimizerFactory)() at /Users/Ryancw2/.julia/packages/JuMP/jnmGG/src/JuMP.jl:116
 [5] #set_optimizer#76(::Bool, ::Function, ::Model, ::OptimizerFactory) at /Users/Ryancw2/.julia/packages/JuMP/jnmGG/src/optimizer_interface.jl:38
 [6] #Model#5 at ./none:0 [inlined]
 [7] Model(::OptimizerFactory) at /Users/Ryancw2/.julia/packages/JuMP/jnmGG/src/JuMP.jl:217
 [8] top-level scope at none:0

but running the code

model = Model(with_optimizer(Mosek.Optimizer,MSK_DPAR_INTPNT_CO_TOL_DFEAS=1e-7))

yields correct output, i.e.,

A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: Mosek

Calling solve twice causes BoundsError

Here's a MWE

using Convex
using Mosek
using MosekTools
using SCS
W = [1, 0]
x = Variable()
y = Variable()
coeff = x * [1, 0] + y
obj = dot(W, coeff) - logisticloss(coeff)
problem = maximize(obj)

solve!(problem, () -> Mosek.Optimizer(QUIET=true), verbose=false, warmstart = true)
solve!(problem, () -> Mosek.Optimizer(QUIET=true), verbose=false, warmstart = true) # fails

# solve!(problem, () -> SCS.Optimizer(), verbose=false, warmstart = true) 
# solve!(problem, () -> SCS.Optimizer(), verbose=false, warmstart = true) # does not fail
ERROR: LoadError: BoundsError: attempt to access 0-element Array{Float64,1} at index [7]
Stacktrace:
 [1] getindex at ./array.jl:809 [inlined]
 [2] get at /Users/mfairley/.julia/packages/MosekTools/sppJY/src/attributes.jl:425 [inlined]
 [3] get(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.GreaterThan{Float64}}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Utilities/cachingoptimizer.jl:605
 [4] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.GreaterThan{Float64}}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:922
 [5] _broadcast_getindex_evalf at ./broadcast.jl:648 [inlined]
 [6] _broadcast_getindex at ./broadcast.jl:621 [inlined]
 [7] getindex at ./broadcast.jl:575 [inlined]
 [8] copy at ./broadcast.jl:876 [inlined]
 [9] materialize at ./broadcast.jl:837 [inlined]
 [10] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.Bridges.Constraint.ScalarizeBridge{Float64,MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.GreaterThan{Float64}}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/Constraint/scalarize.jl:104
 [11] (::MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual})(::MathOptInterface.Bridges.Constraint.ScalarizeBridge{Float64,MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.GreaterThan{Float64}}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:920
 [12] (::MathOptInterface.Bridges.var"#1#2"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Nonnegatives},MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual}})() at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:242
 [13] call_in_context(::MathOptInterface.Bridges.Variable.Map, ::Int64, ::MathOptInterface.Bridges.var"#1#2"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Nonnegatives},MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual}}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/Variable/map.jl:404
 [14] call_in_context at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/Variable/map.jl:435 [inlined]
 [15] call_in_context at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:241 [inlined]
 [16] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Nonnegatives}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:920
 [17] moi_populate_solution!(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::Problem{Float64}, ::OrderedCollections.OrderedDict{UInt64,Convex.AbstractVariable}, ::Dict{Convex.ConicConstr,Constraint}, ::Array{Convex.ConicConstr,1}, ::Dict{UInt64,Array{MathOptInterface.VariableIndex,1}}, ::Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},S} where S,1}) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:303
 [18] solve!(::Problem{Float64}, ::MosekModel; check_vexity::Bool, verbose::Bool, warmstart::Bool, silent_solver::Bool) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:249
 [19] solve!(::Problem{Float64}, ::var"#17#18"; kwargs::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol,Symbol},NamedTuple{(:verbose, :warmstart),Tuple{Bool,Bool}}}) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:192
 [20] top-level scope at /Users/mfairley/Projects/AdaptiveSurveillance/test/cvx_mwe_bug2.jl:16
 [21] include(::String) at ./client.jl:457
 [22] top-level scope at REPL[2]:1
in expression starting at /Users/mfairley/Projects/AdaptiveSurveillance/test/cvx_mwe_bug2.jl:16

Excessive pre-factor nonzeros in sdplib instance

The issue

Solving gpp124-1 from sdplib via JuMP and Mosek results in an inefficient (fully dense?) formulation.

Code used

Download gpp124-1.jld2 and run

using LinearAlgebra, SparseArrays
using MosekTools, JuMP
using JLD2

function solve_sdpa_jump(c, F; solver=Mosek.Optimizer, kwargs...)
    model = Model(with_optimizer(solver; kwargs...))
    #= Solve the following optimization problem

    minimize c'x
    subject to  F1*x1 + ... + Fm*xm - F0 ⪰ 0

    See https://freesoft.dev/program/129366650
    =#
    m = length(c); n = size(F[1], 1)
    @variable(model, x[1:m])

    A = hcat([F[i+1][:] for i = 1:m]...)
    b = -Vector(F[1][:])
    @constraint(model, A*x + b in MOI.PositiveSemidefiniteConeSquare(n))

    @objective(model, Min, dot(c, x))

    JuMP.optimize!(model)
    @show JuMP.termination_status(model)
    return value.(x), JuMP.objective_value(model)
end

@load "gpp124-1.jld2" c F
solution, solution_objective = solve_sdpa_jump(c, F, solver=Mosek.Optimizer)

In the example above Mosek reports

Factor     - nonzeros before factor : 3.00e+07

which is in the same order as length(A) + length(F[1]) = 1922000 + 125^2 where A is defined in solve_sdpa_jump above.
I would expect a number of nonzeros in the order of nnz(A) + length(F[1]) = 15500 + 125^2.

Is this behaviour expected?

On a related note solving the dual of gpp124-1 via:

function solve_sdpa_jump_dual(c, F; solver=Mosek.Optimizer, kwargs...)
    model = Model(with_optimizer(solver; kwargs...))
    m = length(c); n = size(F[1], 1)
    @variable(model, Y[1:n, 1:n], PSD)
    for i = 1:m
        @constraint(model, dot(Y, F[i + 1]) == c[i])
    end
    @objective(model, Max, dot(F[1], Y))

    JuMP.optimize!(model)
    @show JuMP.termination_status(model)
    return value.(Y), JuMP.objective_value(model)
end

does not exhibit the same problem.

VectorOfVariables constraints

Because the PositiveSemidefiniteConeTriangle does not directly match the PSD cone used by Mosek, when doing

@variable(model, x[1:2, 1:2], PSD)

3 scalar variables are created by JuMP (say x1, x2, x3) and then a matrix variable of 3 variables (y[1:3]) is created by MosekTools, the matrix variables y are in the Mosek PSD cone and their correspondance with the 3 variables added by JuMP is encoded by 3 equalities: y[1] = x1, y[2] = √2*x2 and y[3] = x3.
As we can see below, it creates 3 constraints, 3 scalar constraints and a matrix variable.

julia> using MosekTools

julia> optimizer = Mosek.Optimizer();

julia> using JuMP

julia> x = MOI.add_variables(optimizer, 3)
3-element Array{MathOptInterface.VariableIndex,1}:
 MathOptInterface.VariableIndex(1)
 MathOptInterface.VariableIndex(2)
 MathOptInterface.VariableIndex(3)

julia> c = MOI.add_constraint(optimizer, MOI.VectorOfVariables(x), MOI.PositiveSemidefiniteConeTriangle(2))
MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle}(3)

julia> MOI.optimize!(optimizer)
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 3               
  Cones                  : 0               
  Scalar variables       : 3               
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Optimizer terminated. Time: 0.00    

2-element Array{MosekTools.MosekSolution,1}:
 MosekTools.MosekSolution(Mosek.MSK_SOL_BAS, Mosek.MSK_SOL_STA_DUAL_FEAS, Mosek.MSK_PRO_STA_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_SUPBAS, Mosek.MSK_SK_SUPBAS, Mosek.MSK_SK_SUPBAS], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], Float64[], Mosek.Stakey[Mosek.MSK_SK_BAS, Mosek.MSK_SK_BAS, Mosek.MSK_SK_BAS], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])                                                           
 MosekTools.MosekSolution(Mosek.MSK_SOL_ITR, Mosek.MSK_SOL_STA_OPTIMAL, Mosek.MSK_PRO_STA_PRIM_AND_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_SUPBAS, Mosek.MSK_SK_SUPBAS, Mosek.MSK_SK_SUPBAS], [0.679405, 0.0, 0.679405], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], Mosek.Stakey[Mosek.MSK_SK_FIX, Mosek.MSK_SK_FIX, Mosek.MSK_SK_FIX], [-0.0, -0.0, -0.0], [1.51119e-10, 0.0, 1.51119e-10], [0.0, -0.0, 0.0], [1.51119e-10, 0.0, 1.51119e-10])

@ulfworsoe Does Mosek always eliminates the variables x1, x2 and x3 or would it be more efficient to avoid create the x1, x2 and x3 variables directly use y[1], y2/√2 and y[3] in the model ?

Mosek Error upon using Powermodels.jl

Hello
I’m trying to use the solver Mosek to solve a SDP problem via the “Powermodels.jl” library. My code is very simple:

using PowerModels
using MosekTools
solver4 = Mosek.Optimizer;
SDP_relax=run_opf(“pglib_opf_case3_lmbd__sad.m”, SDPWRMPowerModel, solver4);

I get the following output:

[info | PowerModels]: removing 3 cost terms from generator 3: Float64
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 84
Cones : 8
Scalar variables : 59
Matrix variables : 1
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 3
Eliminator terminated.
Eliminator - tries : 1 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.01
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 84
Cones : 8
Scalar variables : 59
Matrix variables : 1
Integer variables : 0

Optimizer - threads : 4
Optimizer - solved problem : the primal
Optimizer - Constraints : 48
Optimizer - Cones : 8
Optimizer - Scalar variables : 45 conic : 24
Optimizer - Semi-definite variables: 1 scalarized : 21
Factor - setup time : 0.02 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 534 after factor : 702
Factor - dense dim. : 0 flops : 1.58e+04
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 4.0e+02 1.1e+03 1.7e+03 0.00e+00 1.378858223e+03 -3.617071068e+02 1.0e+00 0.05
1 1.4e+02 3.8e+02 1.0e+03 -9.95e-01 4.074408662e+02 -1.320859425e+03 3.4e-01 0.06
2 3.8e+01 1.0e+02 5.2e+02 -9.74e-01 1.056225490e+03 -5.947841219e+02 9.5e-02 0.06
3 6.7e+00 1.9e+01 1.8e+02 -8.88e-01 7.953694902e+02 -4.625306879e+02 1.7e-02 0.06
4 3.3e+00 9.0e+00 8.8e+01 -3.48e-01 1.255338214e+03 3.559185005e+02 8.2e-03 0.06
5 2.0e+00 5.4e+00 5.5e+01 -1.10e-01 1.829408782e+03 1.077950342e+03 4.9e-03 0.06
6 7.3e-01 2.0e+00 1.7e+01 1.18e-01 3.259299899e+03 2.876855600e+03 1.8e-03 0.06
7 3.4e-01 9.3e-01 7.1e+00 4.03e-01 4.076878723e+03 3.838159851e+03 8.5e-04 0.06
8 1.3e-01 3.5e-01 1.7e+00 6.91e-01 5.024709577e+03 4.926966765e+03 3.1e-04 0.06
9 4.4e-02 1.2e-01 4.6e-01 6.57e-01 5.484760280e+03 5.443657139e+03 1.1e-04 0.06
10 1.6e-02 4.3e-02 1.1e-01 7.96e-01 5.731290680e+03 5.715191898e+03 3.9e-05 0.06
11 5.3e-03 1.5e-02 2.5e-02 8.19e-01 5.846258047e+03 5.840346953e+03 1.3e-05 0.08
12 7.1e-04 2.0e-03 1.2e-03 9.74e-01 5.911128044e+03 5.910324672e+03 1.8e-06 0.08
13 6.0e-05 1.7e-04 3.0e-05 9.98e-01 5.921172672e+03 5.921104873e+03 1.5e-07 0.08
14 3.3e-06 9.1e-06 3.9e-07 1.00e+00 5.922085568e+03 5.922081871e+03 8.2e-09 0.08
15 1.0e-07 2.8e-07 2.2e-09 1.00e+00 5.922136664e+03 5.922136547e+03 2.6e-10 0.08
16 4.9e-09 1.4e-08 2.2e-11 1.00e+00 5.922138254e+03 5.922138249e+03 1.2e-11 0.08
Optimizer terminated. Time: 0.09

MOSEK error 3915: There is no barx available for the solution type 2.
ERROR: Mosek.MosekError(3915, “There is no barx available for the solution type 2.”)
Stacktrace:
[1] getbarxj(task_::Mosek.Task, whichsol_::Mosek.Soltype, j_::Int32)
@ Mosek ~.julia\packages\Mosek\6LuE3\src\msk_functions.jl:2087
[2] getbarxj
@ ~.julia\packages\Mosek\6LuE3\src\msk_functions.jl:2077 [inlined]
[3] matrix_solution(m::MosekModel, sol::Mosek.Soltype)
@ MosekTools ~.julia\packages\MosekTools\sppJY\src\MosekTools.jl:268
[4] optimize!(m::MosekModel)
@ MosekTools ~.julia\packages\MosekTools\sppJY\src\MosekTools.jl:275
[5] optimize!(b::MathOptInterface.Bridges.LazyBridgeOptimizer{MosekModel})
@ MathOptInterface.Bridges ~.julia\packages\MathOptInterface\5WwpK\src\Bridges\bridge_optimizer.jl:293
[6] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
@ MathOptInterface.Utilities ~.julia\packages\MathOptInterface\5WwpK\src\Utilities\cachingoptimizer.jl:237
[7] optimize!(model::Model, optimizer_factory::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ JuMP ~.julia\packages\JuMP\b3hGi\src\optimizer_interface.jl:185
[8] optimize! (repeats 2 times)
@ ~.julia\packages\JuMP\b3hGi\src\optimizer_interface.jl:157 [inlined]
[9] macro expansion
@ .\timing.jl:368 [inlined]
[10] optimize_model!(aim::SDPWRMPowerModel; relax_integrality::Bool, optimizer::Function, solution_processors::Vector{Any})
@ InfrastructureModels ~.julia\packages\InfrastructureModels\ts81X\src\core\base.jl:397
[11] run_model(data::Dict{String, Any}, model_type::Type, optimizer::typeof(Mosek.Optimizer), build_method::typeof(build_opf); ref_extensions::Vector{Any}, solution_processors::Vector{Any}, relax_integrality::Bool, multinetwork::Bool, multiconductor::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PowerModels ~.julia\packages\PowerModels\bsxAD\src\core\base.jl:52
[12] run_model(data::Dict{String, Any}, model_type::Type, optimizer::Function, build_method::Function)
@ PowerModels ~.julia\packages\PowerModels\bsxAD\src\core\base.jl:35
[13] run_model(file::String, model_type::Type, optimizer::Function, build_method::Function; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ PowerModels ~.julia\packages\PowerModels\bsxAD\src\core\base.jl:27
[14] run_model
@ ~.julia\packages\PowerModels\bsxAD\src\core\base.jl:26 [inlined]
[15] #run_opf#1077
@ ~.julia\packages\PowerModels\bsxAD\src\prob\opf.jl:13 [inlined]
[16] run_opf(file::String, model_type::Type, optimizer::Function)
@ PowerModels ~.julia\packages\PowerModels\bsxAD\src\prob\opf.jl:13
[17] top-level scope
@ none:1

I would appreciate your help in this regard.

Optimal solution is third when there are starting values and conic constraints

When there are both starting values and conic constraints, the optimal value is the third solution and the first solution is just the starting value.

using JuMP
using MosekTools: Mosek

solver = Mosek.Optimizer

model = Model(solver)
@variable(model, x, start=2)
@constraint(model, [x, 1]  SecondOrderCone())
@objective(model, Min, 2x)
optimize!(model)
@show termination_status(model)
@show primal_status(model)
@show primal_status(model, result=2)
@show primal_status(model, result=3)
@show value(x)
@show value(x, result=2)
@show value(x, result=3)

pow1 test fail

The tests pow1v and pow1f of MOI fails with Mosek.jl v1.1.1 (i.e. Mosek v9.1) but works with Mosek.jl v1.0.4 (i.e. Mosek v9.0):

using MosekTools
model = Mosek.Optimizer()
using MathOptInterface
const MOI = MathOptInterface
v = MOI.add_variables(model, 3)
vov = MOI.VectorOfVariables(v)
vc = MOI.add_constraint(model, vov, MOI.PowerCone(0.9))
cx = MOI.add_constraint(model, MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, v[1])], 0.), MOI.EqualTo(2.))
cy = MOI.add_constraint(model, MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, v[2])], 0.), MOI.EqualTo(1.))
MOI.set(model, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(), MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, v[3])], 0.0))
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
MOI.optimize!(model)
@show MOI.get(model, MOI.ConstraintDual(), vc)
Mosek.writedata(model.task, "pow.cbf")

gives

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

Optimizer started.
Presolve started.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 0                 time                   : 0.00            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.00    
Problem
  Name                   :                 
  Objective sense        : max             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 2               
  Cones                  : 1               
  Scalar variables       : 3               
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer  - threads                : 4               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 0
Optimizer  - Cones                  : 0
Optimizer  - Scalar variables       : 1                 conic                  : 0               
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
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 : 0                 after factor           : 0               
Factor     - dense dim.             : 0                 flops                  : 0.00e+00        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   8.7e-01  1.0e+00  1.0e+00  0.00e+00   0.000000000e+00   0.000000000e+00   1.0e+00  0.00  
1   1.6e-01  1.9e-01  1.4e-01  1.18e-01   7.445916446e-01   4.868007185e-01   1.9e-01  0.00  
2   1.3e-02  1.5e-02  4.1e-03  6.32e-01   1.803552444e+00   1.762816564e+00   1.5e-02  0.00  
3   7.1e-06  8.2e-06  5.3e-08  9.77e-01   1.866042285e+00   1.866015928e+00   8.2e-06  0.00  
4   3.7e-11  4.3e-11  2.8e-13  1.00e+00   1.866065983e+00   1.866065983e+00   4.3e-11  0.00  
Optimizer terminated. Time: 0.00
MOI.get(model, MOI.ConstraintDual(), vc) = [0.8397296921264373, 0.18660659825031936, 0.9999999997561113]
3-element Array{Float64,1}:
 0.8397296921264373 
 0.18660659825031936
 0.9999999997561113 

on Mosek v1.1.1 and gives

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

Optimizer started.
Presolve started.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 0                 time                   : 0.00            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.00    
Problem
  Name                   :                 
  Objective sense        : max             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 2               
  Cones                  : 1               
  Scalar variables       : 3               
  Matrix variables       : 0               
  Integer variables      : 0               

Optimizer  - threads                : 4               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 0
Optimizer  - Cones                  : 1
Optimizer  - Scalar variables       : 3                 conic                  : 3               
Optimizer  - Semi-definite variables: 0                 scalarized             : 0               
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 : 0                 after factor           : 0               
Factor     - dense dim.             : 0                 flops                  : 0.00e+00        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   6.2e-01  1.0e+00  4.8e+00  0.00e+00   0.000000000e+00   3.805618599e+00   1.0e+00  0.01  
1   5.5e-02  8.9e-02  2.5e-01  3.93e-01   1.606601792e+00   1.912296322e+00   8.9e-02  0.02  
2   2.6e-03  4.2e-03  2.5e-03  9.28e-01   1.858086151e+00   1.873893873e+00   4.2e-03  0.02  
3   4.4e-05  7.1e-05  5.3e-06  9.99e-01   1.865883617e+00   1.866156437e+00   7.1e-05  0.02  
4   4.3e-06  7.0e-06  1.7e-07  1.00e+00   1.866054134e+00   1.866081329e+00   7.0e-06  0.02  
5   4.6e-07  7.4e-07  5.7e-09  1.00e+00   1.866065085e+00   1.866067959e+00   7.4e-07  0.02  
6   1.6e-08  2.5e-08  3.6e-11  1.00e+00   1.866065955e+00   1.866066055e+00   2.5e-08  0.02  
7   1.8e-09  3.2e-09  1.6e-12  1.00e+00   1.866065980e+00   1.866065993e+00   3.3e-09  0.02  
Optimizer terminated. Time: 0.02
MOI.get(model, MOI.ConstraintDual(), vc) = [0.8397073684239428, 0.1866512563450408, -0.9999999950328783]
3-element Array{Float64,1}:
  0.8397073684239428
  0.1866512563450408
 -0.9999999950328783

on Mosek v1.0.4.
The MOI tests expects -1 for the third component.

I checked, the pow.cbf generated is the same for both Mosek versions.
The cbf file can be obtained here (the txt extension was added so that Github accept it as attachment)

`MOSEK error 3915: There is no barx available for the solution type 2.`

This issue is probably related to #71.

The following PowerModelsDistribution problem throws the following exception when using the Mosek solver. The issue is not present with other conic solvers like SCS.

using PowerModelsDistribution
using LinearAlgebra
using MosekTools, SCS

m = PowerModelsDistribution.Model()

for i in 1:10
    add_bus!(m, "SS$i";
        terminals = [1, 2, 3, 4],
        grounded  = [4],
        vm_lb = [0.9, 0.9, 0.9, -0.1],
        vm_ub = [1.1, 1.1, 1.1,  0.1]
    )
end

add_linecode!(m, "16mm",  diagm(fill(1.15,  3)), diagm(fill(0.092484,    3)))
add_linecode!(m, "70mm",  diagm(fill(0.268, 3)), diagm(fill(0.080424772, 3)))
add_linecode!(m, "95mm",  diagm(fill(0.193, 3)), diagm(fill(0.082309728, 3)))
add_linecode!(m, "150mm", diagm(fill(0.127, 3)), diagm(fill(0.08,        3)))

add_line!(m, "L0", "SS1",  "SS2",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.010)
add_line!(m, "L1", "SS1",  "SS7",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.160)
add_line!(m, "L2", "SS7",  "SS9",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.125)
add_line!(m, "L3", "SS9",  "SS8",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.125)
add_line!(m, "L4", "SS2",  "SS3",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.170)
add_line!(m, "L5", "SS3",  "SS4",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.200)
add_line!(m, "L6", "SS4",  "SS6",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="95mm", length=0.200)
add_line!(m, "L7", "SS4",  "SS10", [1, 2, 3, 4], [1, 2, 3, 4]; linecode="70mm", length=0.110)
add_line!(m, "L8", "SS10", "SS5",  [1, 2, 3, 4], [1, 2, 3, 4]; linecode="70mm", length=0.155)

add_voltage_source!(m, "PCC", "SS1", [1, 2, 3, 4]; pg_cost_parameters=[0.01, 12.2, 0.0])
add_vbase_default!(m, "SS1", 0.4)

add_load!(m, "LOAD1", "SS3", [1,2,3,4]; configuration=WYE, model=POWER, pd_nom=fill(10, 3), qd_nom=zeros(3))
add_load!(m, "LOAD2", "SS4", [1,2,3,4]; configuration=WYE, model=POWER, pd_nom=fill(10, 3), qd_nom=zeros(3))
add_load!(m, "LOAD3", "SS7", [1,2,3,4]; configuration=WYE, model=POWER, pd_nom=fill(10, 3), qd_nom=zeros(3))
add_load!(m, "LOAD4", "SS9", [1,2,3,4]; configuration=WYE, model=POWER, pd_nom=fill(10, 3), qd_nom=zeros(3))
julia> @time solution = solve_mc_opf(m, SDPUBFPowerModel,      Mosek.Optimizer)
Problem
  Name                   :
  Objective sense        : min
  Type                   : CONIC (conic optimization problem)
  Constraints            : 1130
  Cones                  : 0
  Scalar variables       : 501
  Matrix variables       : 12
  Integer variables      : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 36
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00
Lin. dep.  - tries                  : 1                 time                   : 0.00
Lin. dep.  - number                 : 0
Presolve terminated. Time: 0.05
Problem
  Name                   :
  Objective sense        : min
  Type                   : CONIC (conic optimization problem)
  Constraints            : 1130
  Cones                  : 0
  Scalar variables       : 501
  Matrix variables       : 12
  Integer variables      : 0

Optimizer  - threads                : 4
Optimizer  - solved problem         : the primal
Optimizer  - Constraints            : 954
Optimizer  - Cones                  : 1
Optimizer  - Scalar variables       : 379               conic                  : 217
Optimizer  - Semi-definite variables: 12                scalarized             : 765
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 : 3.15e+04          after factor           : 6.51e+04
Factor     - dense dim.             : 2                 flops                  : 6.08e+06
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME
0   3.5e+05  1.0e+00  1.0e+00  0.00e+00   0.000000000e+00   0.000000000e+00   1.0e+00  0.05
1   3.4e+04  9.6e-02  3.2e-01  -1.00e+00  4.807429355e-05   9.369142538e+00   9.6e-02  0.06  
2   1.2e+03  3.3e-03  6.0e-02  -1.00e+00  1.567500347e-03   2.996151703e+02   3.3e-03  0.08  
3   1.7e+02  4.9e-04  2.3e-02  -9.98e-01  1.072117175e-02   2.019305834e+03   4.9e-04  0.09  
4   8.3e+01  2.3e-04  1.5e-02  -9.63e-01  2.678886496e-02   3.845959462e+03   2.3e-04  0.09  
5   2.6e+01  7.4e-05  6.2e-03  -7.19e-01  8.419940658e-02   6.562508166e+03   7.4e-05  0.09
6   3.1e+00  8.8e-06  5.6e-04  -1.66e-01  1.853925308e-01   3.790287974e+03   8.8e-06  0.11  
7   4.0e-01  1.1e-06  2.7e-05  8.04e-01   2.138253061e-01   5.500939222e+02   1.1e-06  0.11  
8   8.6e-02  2.4e-07  2.6e-06  9.74e-01   2.304645372e-01   1.116011287e+02   2.4e-07  0.11
9   1.7e-02  4.8e-08  2.2e-07  9.94e-01   2.461047111e-01   1.928346096e+01   4.8e-08  0.13  
10  2.2e-03  6.3e-09  9.6e-09  9.99e-01   2.576576567e-01   2.467891887e+00   6.3e-09  0.13  
11  4.3e-04  1.2e-09  8.1e-10  1.00e+00   2.575984599e-01   6.840588861e-01   1.2e-09  0.14
12  5.3e-05  1.5e-10  3.6e-11  1.00e+00   2.583372403e-01   3.110143397e-01   1.5e-10  0.14  
13  7.2e-06  2.0e-11  1.7e-12  1.02e+00   2.504743045e-01   2.570062596e-01   2.0e-11  0.14  
14  5.4e-07  1.5e-12  1.9e-14  1.14e+00   1.994654662e-01   1.996050318e-01   1.5e-12  0.16
15  8.1e-08  2.4e-13  1.3e-15  1.48e+00   1.268711081e-01   1.268992901e-01   2.3e-13  0.16  
16  8.8e-09  3.5e-14  4.4e-17  1.08e+00   1.208033165e-01   1.208061450e-01   2.5e-14  0.17  
17  4.8e-10  3.2e-13  5.6e-19  1.02e+00   1.201295945e-01   1.201297476e-01   1.4e-15  0.17
Optimizer terminated. Time: 0.19    

MOSEK error 3915: There is no barx available for the solution type 2.
ERROR: Mosek.MosekError(3915, "There is no barx available for the solution type 2.")
Stacktrace:
  [1] getbarxj(task_::Mosek.Task, whichsol_::Mosek.Soltype, j_::Int32)
    @ Mosek C:\Users\Cornejo\.julia\packages\Mosek\6LuE3\src\msk_functions.jl:2087
  [2] getbarxj
    @ C:\Users\Cornejo\.julia\packages\Mosek\6LuE3\src\msk_functions.jl:2077 [inlined]
  [3] matrix_solution(m::MosekModel, sol::Mosek.Soltype)
    @ MosekTools C:\Users\Cornejo\.julia\packages\MosekTools\sppJY\src\MosekTools.jl:268
  [4] optimize!(m::MosekModel)
    @ MosekTools C:\Users\Cornejo\.julia\packages\MosekTools\sppJY\src\MosekTools.jl:275
  [5] optimize!(b::MathOptInterface.Bridges.LazyBridgeOptimizer{MosekModel})
    @ MathOptInterface.Bridges C:\Users\Cornejo\.julia\packages\MathOptInterface\YDdD3\src\Bridges\bridge_optimizer.jl:319
  [6] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}})
    @ MathOptInterface.Utilities C:\Users\Cornejo\.julia\packages\MathOptInterface\YDdD3\src\Utilities\cachingoptimizer.jl:252
  [7] optimize!(model::JuMP.Model, optimizer_factory::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JuMP C:\Users\Cornejo\.julia\packages\JuMP\b3hGi\src\optimizer_interface.jl:185
  [8] optimize! (repeats 2 times)
    @ C:\Users\Cornejo\.julia\packages\JuMP\b3hGi\src\optimizer_interface.jl:157 [inlined]
  [9] macro expansion
    @ .\timing.jl:368 [inlined]
 [10] optimize_model!(aim::SDPUBFPowerModel; relax_integrality::Bool, optimizer::Function, solution_processors::Vector{Function})
    @ InfrastructureModels C:\Users\Cornejo\.julia\packages\InfrastructureModels\k2fNE\src\core\base.jl:397
 [11] _solve_mc_model(data::Dict{String, Any}, model_type::Type, optimizer::typeof(Mosek.Optimizer), build_method::typeof(build_mc_opf); multinetwork::Bool, ref_extensions::Vector{Function}, solution_processors::Vector{Function}, relax_integrality::Bool, kwargs::Base.Iterators.Pairs{Symbol, Set{String}, Tuple{Symbol}, NamedTuple{(:global_keys,), Tuple{Set{String}}}})
    @ PowerModelsDistribution C:\Users\Cornejo\.julia\packages\PowerModelsDistribution\YSSyF\src\prob\common.jl:48
 [12] solve_mc_model(data::Dict{String, Any}, model_type::Type, optimizer::typeof(Mosek.Optimizer), build_mc::typeof(build_mc_opf); ref_extensions::Vector{Function}, multinetwork::Bool, global_keys::Set{String}, eng2math_extensions::Vector{Function}, eng2math_passthrough::Dict{String, Vector{String}}, make_pu_extensions::Vector{Function}, map_math2eng_extensions::Dict{String, Function}, make_si::Bool, make_si_extensions::Vector{Function}, dimensionalize_math_extensions::Dict{String, Dict{String, Vector{String}}}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ PowerModelsDistribution C:\Users\Cornejo\.julia\packages\PowerModelsDistribution\YSSyF\src\prob\common.jl:194
 [13] solve_mc_model(data::Dict{String, Any}, model_type::Type, optimizer::Function, build_mc::Function)
    @ PowerModelsDistribution C:\Users\Cornejo\.julia\packages\PowerModelsDistribution\YSSyF\src\prob\common.jl:184
 [14] #solve_mc_opf#2008
    @ C:\Users\Cornejo\.julia\packages\PowerModelsDistribution\YSSyF\src\prob\opf.jl:3 [inlined]
 [15] solve_mc_opf(data::Dict{String, Any}, model_type::Type, solver::Function)
    @ PowerModelsDistribution C:\Users\Cornejo\.julia\packages\PowerModelsDistribution\YSSyF\src\prob\opf.jl:3
 [16] top-level scope
    @ .\timing.jl:210 [inlined]
 [17] top-level scope
    @ .\REPL[87]:0

set_start_value causes constraints added after first call of "optimize!" to not be recognized

When running a cutting-plane method using Mosek/JuMP.jl, using the set_start_value function to initialize variables before running the next iterate of a cutting-plane method causes any constraints added after the first iterate of the method to be ignored.

Minimal working example:

using Mosek, MosekTools, JuMP, Suppressor, LinearAlgebra, Compat, Arpack

pitprops=[[1,0.954,0.364,0.342,-0.129,0.313,0.496,0.424,0.592,0.545,0.084,-0.019,0.134];
       [0.954,1,0.297,0.284,-0.118,0.291,0.503,0.419,0.648,0.569,0.076,-0.036,0.144];
       [0.364,0.297,1,0.882,-0.148,0.153,-0.029,-0.054,0.125,-0.081,0.162,0.22,0.126];
       [0.342,0.284,0.882,1,0.22,0.381,0.174,-0.059,0.137,-0.014,0.097,0.169,0.015];
       [-0.129,-0.118,-0.148,0.22,1,0.364,0.296,0.004,-0.039,0.037,-0.091,-0.145,-0.208];
       [0.313,0.291,0.153,0.381,0.364,1,0.813,0.09,0.211,0.274,-0.036,0.024,-0.329];
       [0.496,0.503,-0.029,0.174,0.296,0.813,1,0.372,0.465,0.679,-0.113,-0.232,-0.424];
       [0.424,0.419,-0.054,-0.059,0.004,0.09,0.372,1,0.482,0.557,0.061,-0.357,-0.202];
       [0.592,0.648,0.125,0.137,-0.039,0.211,0.465,0.482,1,0.526,0.085,-0.127,-0.076];
       [0.545,0.569,-0.081,-0.014,0.037,0.274,0.679,0.557,0.526,1,-0.319,-0.368,-0.291];
       [0.084,0.076,0.162,0.097,-0.091,-0.036,-0.113,0.061,0.085,-0.319,1,0.029,0.007];
       [-0.019,-0.036,0.22,0.169,-0.145,0.024,-0.232,-0.357,-0.127,-0.368,0.029,1,0.184];
       [0.134,0.144,0.126,0.015,-0.208,-0.329,-0.424,-0.202,-0.076,-0.291,0.007,0.184,1];]
pitprops=reshape(pitprops, (13,13));
function solveSDPRelax_cuts(Sigma, k)
    n=size(Sigma,1)
    firstOrderRelaxation=Model(with_optimizer(Mosek.Optimizer))
    @variable(firstOrderRelaxation, X[1:n, 1:n], Symmetric)
    @variable(firstOrderRelaxation, U[1:n, 1:n])
    @constraint(firstOrderRelaxation, 0 .<= U .- X)
    @constraint(firstOrderRelaxation, 0 .<= U .+ X)
    @constraint(firstOrderRelaxation, relaxSDOConstraint[i=1:n, j=1:n], [X[i,i]+X[j,j]; [2.0*X[i,j];X[i,i]-X[j,j]]] in SecondOrderCone())
    @constraint(firstOrderRelaxation, sum(U)<=k)
    @constraint(firstOrderRelaxation, l2norm, sum(LinearAlgebra.diag(X))==1.0)
    @objective(firstOrderRelaxation, Max, Compat.dot(Sigma, X))
    @suppress optimize!(firstOrderRelaxation)
    @show objective_value(firstOrderRelaxation)
    j=0
    maxCuts=20
    while j<maxCuts
        λ, ϕ=eigs(value.(X),  nev=1, which=:SR)
            if real(λ[1])<=-1e-4
                cutV=real(ϕ[:, 1])
                @constraint(firstOrderRelaxation, Compat.dot(cutV*cutV', X)>=0.0)
            else
                break
            end
set_start_value.(X, value.(X))
set_start_value.(U, value.(U))
        @suppress optimize!(firstOrderRelaxation)
        @show objective_value(firstOrderRelaxation)
        j=j+1
    end
    @suppress optimize!(firstOrderRelaxation)
    return objective_value(firstOrderRelaxation)
end

t=5
ofv=solveSDPRelax_cuts(pitprops, t)

Correct output (if we comment out the set_start_value calls): 3.4581030289044317
Output if we don't comment out the set_start_value calls: 3.477166152749877

Admittedly this isn't such a major issue for continuous variables, since warm-starts for IPMs don't do that much (and therefore we can avoid using set_start_value here without losing too much performance), but it seems like it could potentially be a more general issue.

Apologies if this is posted in the wrong place.

solve!() breaks with BoundsError when decision variable multiplied by 0

Here's a simple MWE that causes the solver to break.

using Convex
using Mosek
using MosekTools

x = Variable()
y = Variable()
problem = minimize(0.0 * x + y)
solve!(problem, () -> Mosek.Optimizer())
ERROR: LoadError: BoundsError: attempt to access 2-element Array{Float64,1} at index [3]
Stacktrace:
 [1] getindex at ./array.jl:809 [inlined]
 [2] getindex at ./multidimensional.jl:557 [inlined]
 [3] variable_primal at /Users/mfairley/.julia/packages/MosekTools/prFdq/src/attributes.jl:44 [inlined]
 [4] variable_primal at /Users/mfairley/.julia/packages/MosekTools/prFdq/src/attributes.jl:54 [inlined]
 [5] get(::MosekModel, ::MathOptInterface.VariablePrimal, ::MathOptInterface.VariableIndex) at /Users/mfairley/.julia/packages/MosekTools/prFdq/src/attributes.jl:261
 [6] get!(::Array{Float64,1}, ::MosekModel, ::MathOptInterface.VariablePrimal, ::Array{MathOptInterface.VariableIndex,1}) at /Users/mfairley/.julia/packages/MosekTools/prFdq/src/attributes.jl:268
 [7] get at /Users/mfairley/.julia/packages/MosekTools/prFdq/src/attributes.jl:275 [inlined]
 [8] get(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.VariablePrimal, ::Array{MathOptInterface.VariableIndex,1}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Utilities/cachingoptimizer.jl:621
 [9] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.VariablePrimal, ::Array{MathOptInterface.VariableIndex,1}) at /Users/mfairley/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:818
 [10] moi_populate_solution!(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::Problem{Float64}, ::OrderedCollections.OrderedDict{UInt64,Convex.AbstractVariable}, ::Dict{Convex.ConicConstr,Constraint}, ::Array{Convex.ConicConstr,1}, ::Dict{UInt64,Array{MathOptInterface.VariableIndex,1}}, ::Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Zeros},1}) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:288
 [11] solve!(::Problem{Float64}, ::MosekModel; check_vexity::Bool, verbose::Bool, warmstart::Bool, silent_solver::Bool) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:249
 [12] solve! at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:223 [inlined]
 [13] solve!(::Problem{Float64}, ::var"#1#2"; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:192
 [14] solve!(::Problem{Float64}, ::Function) at /Users/mfairley/.julia/packages/Convex/aYxJA/src/solution.jl:191
 [15] top-level scope at /Users/mfairley/Projects/AdaptiveSurveillance/test/cvx_mwe_bug.jl:8
 [16] include(::Function, ::Module, ::String) at ./Base.jl:380
 [17] include(::Module, ::String) at ./Base.jl:368
 [18] exec_options(::Base.JLOptions) at ./client.jl:296
 [19] _start() at ./client.jl:506
in expression starting at /Users/mfairley/Projects/AdaptiveSurveillance/test/cvx_mwe_bug.jl:8

MOSEK: support to MOI.FEASIBILITY_SENSE?

Hi all,

I am now using the Julia/MosekTools to solve the quadratic programming (QP) problem. I encountered the following error:

ERROR: LoadError: ArgumentError: Objective bridge of type MathOptInterface.Bridges.Objective.SlackBridge{Float64,MathOptInterface.ScalarQuadraticFunction{Float64},MathOptInterface.ScalarQuadraticFunction{Float64}} does not support modifying the objective sense. As a workaround, set the sense to MOI.FEASIBILITY_SENSE to clear the objective function and bridges.

My objective function is sum(y_i-phi_i)^2, where y is given data (parameter) and phi is the decision variable. So, I would like to know how to fix this issue. Could you please give me some suggestions? Many thanks in advance!

Quadratic Objectives not being solved

When using JuMP v0.19 and MathOptInterfaceMosek.jl, I cannot solve models that I was previously solving with JuMP v0.18 and Mosek.jl
These models have a quadratic objective... I even tried with very simple models (objective such as x[i].^2) but it says that the solver (Mosek) cannot handle Scalar Quadratic objects or something similar.
Do you know what to do? or how should I be writing these functions? Thank you

Conic reformulation of nonlinear terms in Mosek

Hi @mlubin @BenChung @blegat @odow @chriscoey

I am new to conic programming using Mosek.
I am trying to reformulate a model into conic programming, and then I would need to solve it using Mosek/MosekTools.
Based on the definition of the exponential cone see here, a constraints like x*e^(y/x) <= t can be represented as ( t, x , y) \in K_exp.

However, I have faced the following constraint in a part of my model:

(c1): x*e^y <= t (where x >=0)

My question is: How can I represent this constraint (non-convex)?

It seems Mosek cannot handle such a constraint. Is there any other solver that could address this issue?
Any suggestion would be appreciated.

Can't add eq-constraint on matrix variable

Assume I want to solve the following SDP with JuMP / Mosek:

using MosekTools, MathOptInterface, JuMP
const MOI = MathOptInterface
const MOIB = MathOptInterface.Bridges
const MOIU = MOI.Utilities


# Solve Problem in JuMP (works!)
no = 3
model = JuMP.Model(with_optimizer(Mosek.Optimizer));
@variable(model, X[1:no,1:no], PSD);
@objective(model, Min, X[1]);
@constraint(model, X[1, 2] == 1.)
JuMP.optimize!(model);

This works. Now, I want to solve the same problem with just MOI:

# Solve Problem in MOI (fails!)
model2 = MOIU.UniversalFallback(MOIU.Model{Float64}());
x = MOI.add_variables(model2, 6);
# add objective
MOI.set(model2, MOI.ObjectiveFunction{MOI.SingleVariable}(), MOI.SingleVariable(x[1]));
MOI.set(model2, MOI.ObjectiveSense(), MOI.MIN_SENSE);
# add constraints
MOI.add_constraint(model2, MOI.SingleVariable(x[2]), MOI.EqualTo(1.));
MOI.add_constraint(model2, MOI.VectorOfVariables(x), MOI.PositiveSemidefiniteConeTriangle(no));

optimizer = MOIU.CachingOptimizer(MOIU.UniversalFallback(MOIU.Model{Float64}()), Mosek.Optimizer());
bridged = MOIB.full_bridge_optimizer(optimizer, Float64);
MOI.copy_to(bridged, model2)
MOI.optimize!(bridged);

This fails with the following error:

ERROR: Cannot add MathOptInterface.EqualTo{Float64} constraint on a matrix variable
Stacktrace:
 [1] error(::String) at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 [2] add_constraint(::MosekModel, ::MathOptInterface.SingleVariable, ::MathOptInterface.EqualTo{Float64}) at /Users/Micha/.julia/packages/MosekTools/ywNQy/src/constraint.jl:385
 [3] add_constraint(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.SingleVariable, ::MathOptInterface.EqualTo{Float64}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/cachingoptimizer.jl:250
 [4] _broadcast_getindex_evalf at ./broadcast.jl:630 [inlined]
 [5] _broadcast_getindex at ./broadcast.jl:603 [inlined]
 [6] getindex at ./broadcast.jl:563 [inlined]
 [7] macro expansion at ./broadcast.jl:909 [inlined]
 [8] macro expansion at ./simdloop.jl:77 [inlined]
 [9] copyto! at ./broadcast.jl:908 [inlined]
 [10] copyto! at ./broadcast.jl:863 [inlined]
 [11] copy at ./broadcast.jl:839 [inlined]
 [12] materialize at ./broadcast.jl:819 [inlined]
 [13] add_constraints(::MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::Array{MathOptInterface.SingleVariable,1}, ::Array{MathOptInterface.EqualTo{Float64},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/constraints.jl:168
 [14] add_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::Array{MathOptInterface.SingleVariable,1}, ::Array{MathOptInterface.EqualTo{Float64},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:1065
 [15] copy_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::MathOptInterface.Utilities.IndexMap, ::Array{MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.EqualTo{Float64}},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:228
 [16] pass_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.EqualTo{Float64}},1},1}, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle},1},1}, ::typeof(MathOptInterface.Utilities.copy_constraints), ::typeof(MathOptInterface.set)) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:243
 [17] pass_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.EqualTo{Float64}},1},1}, ::Array{DataType,1}, ::Array{Array{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle},1},1}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:240
 [18] default_copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Bool) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:340
 [19] #automatic_copy_to#97 at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:15 [inlined]
 [20] automatic_copy_to at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Utilities/copy.jl:14 [inlined]
 [21] #copy_to#3 at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:254 [inlined]
 [22] copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{MosekModel,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}) at /Users/Micha/.julia/packages/MathOptInterface/A2UPd/src/Bridges/bridge_optimizer.jl:254
 [23] top-level scope at REPL[20]:1

However, when the MOI-equality-constraint is replaced by the following line:

MOI.add_constraint(model2, MOI.ScalarAffineFunction{Float64}([MOI.ScalarAffineTerm{Float64}(1., x[2])], 0.), MOI.EqualTo(1.));

it works again.

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.