def from_1D_to_2D(constant):
 if (isinstance(constant, np.ndarray) and (constant.ndim == 1)):
  return np.mat(constant).T
 else:
  return constant

def from_1D_to_2D ( constant ) : if ( isinstance ( constant , np . ndarray ) and ( constant . ndim == 1 ) ) : return np . mat ( constant ) . T else : return constant
convert 1d numpy arrays to matrices .