diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-05-22 12:00:42 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-05-22 12:00:42 +0200 |
commit | e635f3889aed9b4bf7ef02c98945e9065d114df3 (patch) | |
tree | 1ae46c334e55052ec1eaa3b3c20bf5becdec164c /packages/base/src/C | |
parent | 0c8a545e67ebef2b3a4e376fac8f23a651dfbe6d (diff) |
extraction modes
Diffstat (limited to 'packages/base/src/C')
-rw-r--r-- | packages/base/src/C/lapack-aux.c | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/packages/base/src/C/lapack-aux.c b/packages/base/src/C/lapack-aux.c index d56d466..e76d31e 100644 --- a/packages/base/src/C/lapack-aux.c +++ b/packages/base/src/C/lapack-aux.c | |||
@@ -1623,44 +1623,64 @@ int chooseD(KIVEC(cond),KDVEC(lt),KDVEC(eq),KDVEC(gt),DVEC(r)) { | |||
1623 | //////////////////////// extract ///////////////////////////////// | 1623 | //////////////////////// extract ///////////////////////////////// |
1624 | 1624 | ||
1625 | #define EXTRACT_IMP \ | 1625 | #define EXTRACT_IMP \ |
1626 | REQUIRES((tm == 0 && jn==rr && mc==rc) || (jn==rr && mr==rc) ,BAD_SIZE); \ | 1626 | /*REQUIRES((tm == 0 && jn==rr && mc==rc) || (jn==rr && mr==rc) ,BAD_SIZE); */ \ |
1627 | DEBUGMSG("extractRD") \ | 1627 | DEBUGMSG("extractRD") \ |
1628 | int k,i,s; \ | 1628 | int k,i,s; \ |
1629 | if (tm==0) { \ | 1629 | if (tm==0) { \ |
1630 | for (k=0;k<jn;k++) { \ | 1630 | if (mode==0) { \ |
1631 | s = jp[k]; \ | 1631 | for (k=0; k<jp[1]-jp[0]+1; k++) { \ |
1632 | for (i=0; i<mc; i++) { \ | 1632 | s = k + jp[0]; \ |
1633 | rp[rc*k+i] = mp[mc*s+i]; \ | 1633 | printf("%d\n",s); \ |
1634 | } \ | 1634 | for (i=0; i<mc; i++) { \ |
1635 | } \ | 1635 | rp[rc*k+i] = mp[mc*s+i]; \ |
1636 | } \ | ||
1637 | } \ | ||
1638 | } else { \ | ||
1639 | for (k=0;k<jn;k++) { \ | ||
1640 | s = jp[k]; \ | ||
1641 | for (i=0; i<mc; i++) { \ | ||
1642 | rp[rc*k+i] = mp[mc*s+i]; \ | ||
1643 | } \ | ||
1644 | } \ | ||
1645 | } \ | ||
1636 | } else { \ | 1646 | } else { \ |
1637 | for (k=0;k<jn;k++) { \ | 1647 | if (mode==0) { \ |
1638 | s = jp[k]; \ | 1648 | for (k=0; k<jp[1]-jp[0]+1; k++) { \ |
1639 | for (i=0; i<mr; i++) { \ | 1649 | s = k + jp[0]; \ |
1640 | rp[rc*k+i] = mp[mc*i+s]; \ | 1650 | printf("%d\n",s); \ |
1641 | } \ | 1651 | for (i=0; i<mr; i++) { \ |
1642 | } \ | 1652 | rp[rc*k+i] = mp[mc*i+s]; \ |
1653 | } \ | ||
1654 | } \ | ||
1655 | } else { \ | ||
1656 | for (k=0;k<jn;k++) { \ | ||
1657 | s = jp[k]; \ | ||
1658 | for (i=0; i<mr; i++) { \ | ||
1659 | rp[rc*k+i] = mp[mc*i+s]; \ | ||
1660 | } \ | ||
1661 | } \ | ||
1662 | } \ | ||
1643 | } \ | 1663 | } \ |
1644 | OK | 1664 | OK |
1645 | 1665 | ||
1646 | 1666 | ||
1647 | int extractRD(int tm, KIVEC(j), KDMAT(m), DMAT(r)) { | 1667 | int extractRD(int mode, int tm, KIVEC(j), KDMAT(m), DMAT(r)) { |
1648 | EXTRACT_IMP | 1668 | EXTRACT_IMP |
1649 | } | 1669 | } |
1650 | 1670 | ||
1651 | int extractRF(int tm, KIVEC(j), KFMAT(m), FMAT(r)) { | 1671 | int extractRF(int mode, int tm, KIVEC(j), KFMAT(m), FMAT(r)) { |
1652 | EXTRACT_IMP | 1672 | EXTRACT_IMP |
1653 | } | 1673 | } |
1654 | 1674 | ||
1655 | int extractRC(int tm, KIVEC(j), KCMAT(m), CMAT(r)) { | 1675 | int extractRC(int mode, int tm, KIVEC(j), KCMAT(m), CMAT(r)) { |
1656 | EXTRACT_IMP | 1676 | EXTRACT_IMP |
1657 | } | 1677 | } |
1658 | 1678 | ||
1659 | int extractRQ(int tm, KIVEC(j), KQMAT(m), QMAT(r)) { | 1679 | int extractRQ(int mode, int tm, KIVEC(j), KQMAT(m), QMAT(r)) { |
1660 | EXTRACT_IMP | 1680 | EXTRACT_IMP |
1661 | } | 1681 | } |
1662 | 1682 | ||
1663 | int extractRI(int tm, KIVEC(j), KIMAT(m), IMAT(r)) { | 1683 | int extractRI(int mode, int tm, KIVEC(j), KIMAT(m), IMAT(r)) { |
1664 | EXTRACT_IMP | 1684 | EXTRACT_IMP |
1665 | } | 1685 | } |
1666 | 1686 | ||