parameters: (bjac)
return_statement: return newjac
docstring: Convert a real matrix of the form (for example)
  
          [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, every other column is shifted up one.
docstring_summary: Convert a real matrix of the form (for example)
docstring_tokens: Convert a real matrix of the form ( for example )
function: def _transform_banded_jac(bjac):
      """
      Convert a real matrix of the form (for example)
  
          [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, every other column is shifted up one.
      """
      # Shift every other column.
      newjac = zeros((bjac.shape[0] + 1, bjac.shape[1]))
      newjac[1:,::2] = bjac[:, ::2]
      newjac[:-1, 1::2] = bjac[:, 1::2]
      return newjac
function_tokens: def _transform_banded_jac ( bjac ) : # Shift every other column. newjac = zeros ( ( bjac . shape [ 0 ] + 1 , bjac . shape [ 1 ] ) ) newjac [ 1 : , : : 2 ] = bjac [ : , : : 2 ] newjac [ : - 1 , 1 : : 2 ] = bjac [ : , 1 : : 2 ] return newjac