diff options
Diffstat (limited to 'packages/base/src/C/lapack-aux.c')
-rw-r--r-- | packages/base/src/C/lapack-aux.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/packages/base/src/C/lapack-aux.c b/packages/base/src/C/lapack-aux.c index 72f2382..af515ca 100644 --- a/packages/base/src/C/lapack-aux.c +++ b/packages/base/src/C/lapack-aux.c | |||
@@ -1556,26 +1556,28 @@ int stepI(KIVEC(x),IVEC(y)) { | |||
1556 | 1556 | ||
1557 | //////////////////// cond ///////////////////////// | 1557 | //////////////////// cond ///////////////////////// |
1558 | 1558 | ||
1559 | int compareF(KFVEC(x),KFVEC(y),IVEC(r)) { | 1559 | #define COMPARE_IMP \ |
1560 | REQUIRES(xn==yn && xn==rn ,BAD_SIZE); | 1560 | REQUIRES(xn==yn && xn==rn ,BAD_SIZE); \ |
1561 | DEBUGMSG("compareF") | 1561 | int k; \ |
1562 | int k; | 1562 | for(k=0;k<xn;k++) { \ |
1563 | for(k=0;k<xn;k++) { | 1563 | rp[k] = xp[k]<yp[k]?-1:(xp[k]>yp[k]?1:0); \ |
1564 | rp[k] = xp[k]<yp[k]?-1:(xp[k]>yp[k]?1:0); | 1564 | } \ |
1565 | } | ||
1566 | OK | 1565 | OK |
1566 | |||
1567 | |||
1568 | int compareF(KFVEC(x),KFVEC(y),IVEC(r)) { | ||
1569 | COMPARE_IMP | ||
1567 | } | 1570 | } |
1568 | 1571 | ||
1569 | int compareD(KDVEC(x),KDVEC(y),IVEC(r)) { | 1572 | int compareD(KDVEC(x),KDVEC(y),IVEC(r)) { |
1570 | REQUIRES(xn==yn && xn==rn ,BAD_SIZE); | 1573 | COMPARE_IMP |
1571 | DEBUGMSG("compareD") | 1574 | } |
1572 | int k; | 1575 | |
1573 | for(k=0;k<xn;k++) { | 1576 | int compareI(KIVEC(x),KIVEC(y),IVEC(r)) { |
1574 | rp[k] = xp[k]<yp[k]?-1:(xp[k]>yp[k]?1:0); | 1577 | COMPARE_IMP |
1575 | } | ||
1576 | OK | ||
1577 | } | 1578 | } |
1578 | 1579 | ||
1580 | |||
1579 | #define COND_IMP \ | 1581 | #define COND_IMP \ |
1580 | REQUIRES(xn==yn && xn==ltn && xn==eqn && xn==gtn && xn==rn ,BAD_SIZE); \ | 1582 | REQUIRES(xn==yn && xn==ltn && xn==eqn && xn==gtn && xn==rn ,BAD_SIZE); \ |
1581 | int k; \ | 1583 | int k; \ |
@@ -1597,27 +1599,27 @@ int condI(KIVEC(x),KIVEC(y),KIVEC(lt),KIVEC(eq),KIVEC(gt),IVEC(r)) { | |||
1597 | } | 1599 | } |
1598 | 1600 | ||
1599 | 1601 | ||
1600 | int chooseF(KIVEC(cond),KFVEC(lt),KFVEC(eq),KFVEC(gt),FVEC(r)) { | 1602 | #define CHOOSE_IMP \ |
1601 | REQUIRES(condn==ltn && ltn==eqn && ltn==gtn && ltn==rn ,BAD_SIZE); | 1603 | REQUIRES(condn==ltn && ltn==eqn && ltn==gtn && ltn==rn ,BAD_SIZE); \ |
1602 | DEBUGMSG("chooseF") | 1604 | int k; \ |
1603 | int k; | 1605 | for(k=0;k<condn;k++) { \ |
1604 | for(k=0;k<condn;k++) { | 1606 | rp[k] = condp[k]<0?ltp[k]:(condp[k]>0?gtp[k]:eqp[k]); \ |
1605 | rp[k] = condp[k]<0?ltp[k]:(condp[k]>0?gtp[k]:eqp[k]); | 1607 | } \ |
1606 | } | ||
1607 | OK | 1608 | OK |
1608 | } | ||
1609 | 1609 | ||
1610 | int chooseF(KIVEC(cond),KFVEC(lt),KFVEC(eq),KFVEC(gt),FVEC(r)) { | ||
1611 | CHOOSE_IMP | ||
1612 | } | ||
1610 | 1613 | ||
1611 | int chooseD(KIVEC(cond),KDVEC(lt),KDVEC(eq),KDVEC(gt),DVEC(r)) { | 1614 | int chooseD(KIVEC(cond),KDVEC(lt),KDVEC(eq),KDVEC(gt),DVEC(r)) { |
1612 | REQUIRES(condn==ltn && ltn==eqn && ltn==gtn && ltn==rn ,BAD_SIZE); | 1615 | CHOOSE_IMP |
1613 | DEBUGMSG("chooseD") | ||
1614 | int k; | ||
1615 | for(k=0;k<condn;k++) { | ||
1616 | rp[k] = condp[k]<0?ltp[k]:(condp[k]>0?gtp[k]:eqp[k]); | ||
1617 | } | ||
1618 | OK | ||
1619 | } | 1616 | } |
1620 | 1617 | ||
1618 | int chooseI(KIVEC(cond),KIVEC(lt),KIVEC(eq),KIVEC(gt),IVEC(r)) { | ||
1619 | CHOOSE_IMP | ||
1620 | } | ||
1621 | |||
1622 | |||
1621 | //////////////////////// extract ///////////////////////////////// | 1623 | //////////////////////// extract ///////////////////////////////// |
1622 | 1624 | ||
1623 | #define EXTRACT_IMP \ | 1625 | #define EXTRACT_IMP \ |