PySCIPOpt  5.1.1
Python Interface for the SCIP Optimization Suite
Multidict.py
Go to the documentation of this file.
1 
3 def multidict(D):
4  '''creates a multidictionary'''
5  keys = list(D.keys())
6  if len(keys) == 0:
7  return [[]]
8  try:
9  N = len(D[keys[0]])
10  islist = True
11  except:
12  N = 1
13  islist = False
14  dlist = [dict() for d in range(N)]
15  for k in keys:
16  if islist:
17  for i in range(N):
18  dlist[i][k] = D[k][i]
19  else:
20  dlist[0][k] = D[k]
21  return [keys]+dlist
pyscipopt.Multidict.multidict
def multidict(D)
Definition: Multidict.py:3