Skip to content

Commit

Permalink
fix: bug with equality constraints
Browse files Browse the repository at this point in the history
variable counting number of constraints was named incorrect
  • Loading branch information
Lachlan Grose committed Feb 15, 2022
1 parent 2493c8f commit b192cff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LoopStructural/interpolators/discrete_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def build_matrix(self, square=True, damp=0.0, ie=False):
# can help speed up solving, but might also introduce some errors

if len(self.equal_constraints) > 0:
logger.info("Equality block is %i x %i" % (self.eq_const_c_, self.nx))
logger.info("Equality block is %i x %i" % (self.eq_const_c, self.nx))
# solving constrained least squares using
# | ATA CT | |c| = b
# | C 0 | |y| d
Expand All @@ -433,7 +433,7 @@ def build_matrix(self, square=True, damp=0.0, ie=False):
cols.extend(c["col"].flatten()[~mask].tolist())
C = coo_matrix(

(np.array(a), (np.array(rows), cols)), shape=(self.eq_const_c_, self.nx), dtype=float
(np.array(a), (np.array(rows), cols)), shape=(self.eq_const_c, self.nx), dtype=float
).tocsr()

d = np.array(b)
Expand Down

0 comments on commit b192cff

Please sign in to comment.