damien's version where the constraint matrix is turned off when matrix-free is chosen