From: Michael Schroeder Date: Tue, 25 Jul 2017 08:32:03 +0000 (+0200) Subject: mix_depblocks -> distribute_depblocks X-Git-Tag: 0.6.29~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c3b24ba0c4e3f0e7d4e9a9aef9fea80f18b90cb;p=thirdparty%2Flibsolv.git mix_depblocks -> distribute_depblocks And add a comment what it does. --- diff --git a/TODO_1.0 b/TODO_1.0 index 468bc4f7..7494c31f 100644 --- a/TODO_1.0 +++ b/TODO_1.0 @@ -23,3 +23,7 @@ - write more manpages +IDEAS: +- support REL_UNLESS aka (A & ~B) + useful for "Conflicts: (A unless B)" +- support REL_WITHOUT diff --git a/src/cplxdeps.c b/src/cplxdeps.c index a26e69ae..8579eb6a 100644 --- a/src/cplxdeps.c +++ b/src/cplxdeps.c @@ -127,12 +127,14 @@ invert_depblocks(Pool *pool, Queue *bq, int start, int r) return -1; } +/* distributive property: (a1*a2 + b1*b2) * (c1*c2 + d1*d2) = + a1*a2*c1*c2 + a1*a2*d1*d2 + b1*b2*c1*c2 + b1*b2*d1*d2 */ static int -mix_depblocks(Pool *pool, Queue *bq, int bqcnt, int bqcnt2, int flags) +distribute_depblocks(Pool *pool, Queue *bq, int bqcnt, int bqcnt2, int flags) { int i, j, bqcnt3; #ifdef CPLXDEBUG - printf("COMPLEX MIX %d %d %d\n", bqcnt, bqcnt2, bq->count); + printf("COMPLEX DISTRIBUTE %d %d %d\n", bqcnt, bqcnt2, bq->count); #endif bqcnt2 = expand_simpledeps(pool, bq, bqcnt, bqcnt2); bqcnt3 = bq->count; @@ -209,7 +211,7 @@ normalize_dep_or(Pool *pool, Id dep1, Id dep2, Queue *bq, int flags, int invflag if (r2 == 0) return r1; if ((flags & CPLXDEPS_TODNF) == 0) - return mix_depblocks(pool, bq, bqcnt, bqcnt2, flags); + return distribute_depblocks(pool, bq, bqcnt, bqcnt2, flags); return -1; } @@ -234,7 +236,7 @@ normalize_dep_and(Pool *pool, Id dep1, Id dep2, Queue *bq, int flags, int invfla if (r2 == 1) return r1; if ((flags & CPLXDEPS_TODNF) != 0) - return mix_depblocks(pool, bq, bqcnt, bqcnt2, flags); + return distribute_depblocks(pool, bq, bqcnt, bqcnt2, flags); return -1; } @@ -258,7 +260,7 @@ normalize_dep_if_else(Pool *pool, Id dep1, Id dep2, Id dep3, Queue *bq, int flag if (r2 == 1) return r1; if ((flags & CPLXDEPS_TODNF) != 0) - return mix_depblocks(pool, bq, bqcnt, bqcnt2, flags); + return distribute_depblocks(pool, bq, bqcnt, bqcnt2, flags); return -1; }