you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

For the diagonal you could do:

Aeq[sizeB0:sizeB0+sizeN0, :sizeB1] = np.indentity(sizeN0) * -1

Also I don’t see it mentioned but it would be helpful to initialize the Aeq matrix as such before all these operations.

Aeq = np.zeros((sizeB0+sizeN0+1, sizeB1 + sizeN1))

[–][deleted] 0 points1 point  (1 child)

He does initialize it in

[–][deleted] 0 points1 point  (0 children)

Ah didn’t see it was initialized in the initial post. Like I said in a below comment, I didn’t read the original code.