def _gs_decorrelation(w, W, j):
 w -= np.dot(np.dot(w, W[:j].T), W[:j])
 return w

def _gs_decorrelation ( w , W , j ) : w -= np . dot ( np . dot ( w , W [ : j ] . T ) , W [ : j ] ) return w
orthonormalize w wrt the first j rows of w parameters w : ndarray of shape(n) array to be orthogonalized w : ndarray of shape null space definition j : int < p the no of rows of null space w wrt which w is orthogonalized .