Skip to content

Instantly share code, notes, and snippets.

@gftabor
Created February 1, 2020 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gftabor/58c8cd49849ab2615629bfbdb5174883 to your computer and use it in GitHub Desktop.
Save gftabor/58c8cd49849ab2615629bfbdb5174883 to your computer and use it in GitHub Desktop.
from gurobipy import *
import numpy as np
import time
dims = 10
m = Model("mip")
u = m.addVars(dims,1)
z = m.addVars(dims,1)
m.update()
u = np.array([[u[i,0]] for i in range(dims)])
z = np.array([[z[i,0]] for i in range(dims)])
matrix = np.eye(dims)
example = u
for i in range(100):
start = time.time()
example = np.dot(matrix,example)
print(time.time() - start)
if(i%10 == 0):
print(example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment