def sign_mul(sign, lh_size, curv, rh_size): cvx_mat = bu.mul(sign.pos_mat, lh_size, curv.cvx_mat, rh_size) | \ bu.mul(sign.neg_mat, lh_size, curv.conc_mat, rh_size) conc_mat = bu.mul(sign.pos_mat, lh_size, curv.conc_mat, rh_size) | \ bu.mul(sign.neg_mat, lh_size, curv.cvx_mat, rh_size) return Curvature(cvx_mat, conc_mat, curv.constant)
def mul(lh_sign, lh_size, rh_sign, rh_size): neg_mat = bu.mul(lh_sign.neg_mat, lh_size, rh_sign.pos_mat, rh_size) | \ bu.mul(lh_sign.pos_mat, lh_size, rh_sign.neg_mat, rh_size) pos_mat = bu.mul(lh_sign.neg_mat, lh_size, rh_sign.neg_mat, rh_size) | \ bu.mul(lh_sign.pos_mat, lh_size, rh_sign.pos_mat, rh_size) return Sign(neg_mat, pos_mat)