rp_transform function

Transform a weights vector to satisfy constraints