Skip to content

Commit

Permalink
trailing terms for mosek
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd committed Mar 5, 2020
1 parent 7bfea15 commit b8a0c84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gpkit/constraints/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,18 @@ def gen(self):
varexponents = defaultdict(list)
self.exps = []
self.cs = np.zeros(len(self.p_idxs))
row, col, data = [], [], []
for m_idxs, hmap in zip(self.m_idxs, self.hmaps):
self.exps.extend(hmap.keys())
for i, (exp, c) in zip(m_idxs, hmap.items()):
self.cs[i] = c
if not exp: # space the matrix out for trailing constant terms
row.append(i)
col.append(0)
data.append(0)
for var, x in exp.items():
self.varlocs[var].append(i)
varexponents[var].append(x)
row, col, data = [], [], []
for j, var in enumerate(self.varlocs):
row.extend(self.varlocs[var])
col.extend([j]*len(self.varlocs[var]))
Expand Down

0 comments on commit b8a0c84

Please sign in to comment.