bp vector and partial optpfor encoding