def _transform_banded_jac(bjac):
 newjac = zeros(((bjac.shape[0] + 1), bjac.shape[1]))
 newjac[1:, ::2] = bjac[:, ::2]
 newjac[:(-1), 1::2] = bjac[:, 1::2]
 return newjac

def _transform_banded_jac ( bjac ) : newjac = zeros ( ( ( bjac . shape [ 0 ] + 1 ) , bjac . shape [ 1 ] ) ) newjac [ 1 : , : : 2 ] = bjac [ : , : : 2 ] newjac [ : ( - 1 ) , 1 : : 2 ] = bjac [ : , 1 : : 2 ] return newjac
convert a real matrix of the form [0 0 a b] [0 0 0 b] [0 0 c d] [0 0 a d] [e f g h] to [0 f c h] [i j k l] [e j g l] [i 0 k 0] that is .