I need to add Lagrange multipliers to an existing system of equations, which requires me to expand the matrix.
I figured I would allocate a new larger matrix with the appropriate non-zero structure, and then copy the entries from the smaller matrix over to it. But I was wondering if there might be a better way to do this? Thanks, David