Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* ENCODING=ISO-8859-1 | |
NAME | |
ROWS | |
N obj | |
L c1 | |
G c2 | |
L c3 | |
G c4 | |
L c5 | |
G c6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M = Model("minimal sphere enclosing a set of points dual") | |
print('Declaring the variables...') | |
y= M.variable('y',NDSet(k,n+1),Domain.inQCone(k,n+1)) | |
c=[0. for i in range(n+1)] | |
c[0]=1. | |
print('Defining the constraints...') | |
M.constraint('equalities', Expr.mul(DenseMatrix(1,k,1.0), y), Domain.equalsTo(c) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sphere_enclosing_dual(n,k,p): | |
print('Creating the Fusion optimization model...') | |
start=time.clock() | |
M = Model("minimal sphere enclosing a set of points dual") | |
print('Declaring the variables...') | |
y= M.variable('y',NDSet(k,n+1),Domain.inQCone(k,n+1)) | |
print('done!\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import mosek | |
from mosek.fusion import * | |
import numpy as np | |
import time | |
import plot | |
def sphere_enclosing_primal(n,k,p): |