Exemple #1
0
 def mul(lh_sign, lh_size, rh_sign, rh_size):
     neg_mat = BoolMat.mul(lh_sign.neg_mat, lh_size, 
                           rh_sign.pos_mat, rh_size) | \
               BoolMat.mul(lh_sign.pos_mat, lh_size, 
                           rh_sign.neg_mat, rh_size)
     pos_mat = BoolMat.mul(lh_sign.neg_mat, lh_size,
                           rh_sign.neg_mat, rh_size) | \
               BoolMat.mul(lh_sign.pos_mat, lh_size,
                           rh_sign.pos_mat, rh_size)
     return Sign(neg_mat, pos_mat)
Exemple #2
0
 def sign_mul(sign, lh_size, curv, rh_size):
     cvx_mat = BoolMat.mul(sign.pos_mat, lh_size, 
                           curv.cvx_mat, rh_size) | \
               BoolMat.mul(sign.neg_mat, lh_size, 
                           curv.conc_mat, rh_size)
     conc_mat = BoolMat.mul(sign.pos_mat, lh_size,
                            curv.conc_mat, rh_size) | \
                BoolMat.mul(sign.neg_mat, lh_size,
                            curv.cvx_mat, rh_size)
     return Curvature(cvx_mat, conc_mat, curv.constant)