1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811
|
%% Build and check from R:
%% news(db = tools:::.build_news_db_from_package_NEWS_Rd("<Matrix>/inst/NEWS.Rd"))
\name{NEWS}
\title{News for \R{} Package \pkg{Matrix}}
\encoding{UTF-8}
\newcommand{\MPR}{\pkg{Matrix} \href{https://R-forge.R-project.org/tracker/index.php?func=detail&aid=#1&group_id=61&atid=294}{PR##1}}
\section{Changes in version 1.7-4 (2025-08-27, svn r5172)}{
\subsection{Installation}{
\itemize{
\item Warnings surfaced by \option{-Wtautological-overlap-compare}
are squashed. These revealed two typos in \file{src/matmult.c}
causing optimizations for \code{crossprod(\var{.sRMatrix}, y)} and
\code{tcrossprod(x, \var{.sRMatrix})} to be skipped. Thanks to
Brian Ripley and Michael Chirico for the reports.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Methods for \code{band}, \code{triu}, and \code{tril} with
signature \code{x="matrix"} returned a formally invalid
\code{.geMatrix} (with \code{x} slot of class \code{"matrix"}) in
some no-op cases, where no bands are set to zero.
}
}
}
\section{Changes in version 1.7-3 (2025-03-05, svn r5126)}{
\subsection{Bug Fixes}{
\itemize{
\item \code{<matrix>} \code{o} \code{<sparseVector>} binary
\code{"Ops"} work again, returning a matrix (of \code{"Matrix"}).
\item \code{- new("lgeMatrix")} and more \code{ - <Matrix>} now work.
\item Use \code{int} instead of \code{Rboolean} in 2x2 cases in \file{utils-R.c}.
}
}
}
\section{Changes in version 1.7-2 (2025-01-20, svn r5115)}{
\subsection{Installation}{
\itemize{
\item \pkg{Matrix} can be installed with parallel \command{bmake}.
Thanks to Sebastian Meyer for the report and patch in \MPR{6861}.
}
}
\subsection{Misc}{
\itemize{
\item Test in \file{tests/matprod.R} comparing
\code{t(x) \%*\% x} and \code{crossprod(x)} is amended to tolerate
small numerical differences seen under \samp{aarch64} Linux.
}
}
}
\section{Changes in version 1.7-1 (2024-10-17, svn r4948)}{
\subsection{Installation}{
\itemize{
\item Installation under architecture-specific builds of \R{}
works again. It was broken in \pkg{Matrix} version 1.7-0,
where changes to \file{src/Makevars} resulted in \env{CPPFLAGS}
not including \option{-I"${R_INCLUDE_DIR}${R_ARCH}"}.
}
}
\subsection{SuiteSparse}{
\itemize{
\item Internal SuiteSparse and METIS library sources are patched
to avoid possible use of illegal entry points.
}
}
\subsection{C-Level API}{
\itemize{
\item Registered routine \code{sexp_as_cholmod_factor} no longer
calls \code{cholmod_check_factor} before returning, leaving the
decision to check to the caller. Accordingly, most
\code{cholmod_check_*} are registered; packages wanting to use
them need \code{LinkingTo: Matrix (>= 1.7-1)}.
}
}
\subsection{Misc}{
\itemize{
\item Non-API entry points \code{OBJECT}, \code{IS_S4_OBJECT},
\code{SET_OBJECT}, \code{ATTRIB}, and \code{SET_ATTRIB} are no
longer used.
}
}
}
\section{Changes in version 1.7-0 (2024-03-16, svn r4662)}{
\subsection{Installation}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 1.7-0 depends on \R{}
\eqn{\ge}{>=} 4.4.
}
}
\subsection{Linking}{
\itemize{
\item The \pkg{Matrix} ABI version is incremented from 1 to 2.
\item Reverse \code{LinkingTo} built under earlier versions of
\pkg{Matrix} should be rebuilt from sources by users and
maintainers of binary repositories.
}
}
\subsection{SuiteSparse}{
\itemize{
\item The internal SuiteSparse library sources are updated from
version 5.10.1 to version 7.6.0. We have so far identified one
backwards incompatible change: since SuiteSparse version 7.3.0,
\code{cholmod_sort(A)} sorts but \emph{does not pack} the matrix
\code{A}. It seems that now \code{cholmod_sort} and
\code{cholmod_copy} must be used in conjuction if a sorted
\emph{and packed} result is desired. This change affects only
reverse \code{LinkingTo} relying on the old behaviour. It seems
that currently there are no such packages on CRAN or Bioconductor.
\item CHOLMOD component Partition is compiled along with its
dependencies (METIS, CAMD, CCOLAMD).
\item CXSparse is compiled instead of CSparse, which did not
support complex matrices.
\item The internal SuiteSparse and METIS library sources are
patched to squash a significant number of warnings surfaced by
\option{-Wall}.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item The diagonal elements of the \code{R} factor computed by
\code{qr(<sparseMatrix>)} are no longer constrained to be
non-negative, due to differences in the implementation of function
\code{cs_house} between SuiteSparse libraries CSparse and
CXSparse.
}
}
\subsection{Classes}{
\itemize{
\item \code{indMatrix} no longer extends virtual class
\code{compMatrix} and so no longer inherits a (never used)
\code{factors} slot. Objects serialized under \pkg{Matrix}
\eqn{<} 1.7-0 and unserialized under \pkg{Matrix} \eqn{\ge}{>=}
1.7-0 remain valid, retaining a harmless \code{factors}
\emph{attribute}.
\item Unexported class union \code{replValueSp} is effectively
removed, now having zero members. Actual removal is delayed until
package binaries caching the old definition are rebuilt under
\pkg{Matrix} version 1.7-0.
\item The validity method for class \code{sparseQR} no longer
requires non-negative \code{diag(R)}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item The unary subscript \code{x[i]} is correct again for
\code{x} of class \code{.s[CT]Matrix} and logical \code{i}
indexing entries outside of the stored triangle.
}
}
}
\section{Changes in version 1.6-5 (2024-01-06, svn r4560)}{
\subsection{C-Level API}{
\itemize{
\item Registered routine \code{cholmod_triplet_as_sexp} transposes
entries \dQuote{opposite} the \code{stype} when that is nonzero,
following CHOLMOD.
\item \code{cholmod_defaults} is registered so that calls to
API function \code{M_cholmod_defaults} actually work.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{x[]} works for \code{x} inheriting from virtual class
\code{sparseVector}.
\item \code{length(x)} is always an integer for \code{x}
inheriting from virtual class \code{sparseVector}. Truncation did
not occur for \code{x@length} of type \code{"double"} equal to or
greater than \code{.Machine[["integer.max"]] + 1}.
\item \code{tril(<n-by-n>, -n)} now works again.
\item \code{tri[ul](<indMatrix>, k)} now works correctly for
\code{k != 0}.
}
}
\subsection{Misc}{
\itemize{
\item \code{\%||\%} is defined in the \pkg{Matrix} namespace only
for \R{} \eqn{<} 4.4.0.
}
}
}
\section{Changes in version 1.6-4 (2023-11-29, svn r4523)}{
\subsection{Installation}{
\itemize{
\item Warnings surfaced by \option{-Wformat} are squashed.
}
}
\subsection{C-Level API}{
\itemize{
\item API function \code{M_chm_triplet_to_SEXP}, removed in
\pkg{Matrix} version 1.6-2, is restored (as a macro). It was
\dQuote{covertly} used by package \pkg{Rmosek}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item better deprecation message for \code{..2dge()}.
}
}
}
\section{Changes in version 1.6-3 (2023-11-13, svn r4513)}{
\subsection{Misc}{
\itemize{
\item With an \R{} built with \command{configure} option
\option{--disable-long-double}, \code{prod(M)} now very slightly
differs for two differently classed versions of \code{M}.
\item \code{checkMatrix()} from \file{test-tools-Matrix.R} gets
optional \code{MSG} argument for suppressing \code{prod()}
differences.
}
}
}
\section{Changes in version 1.6-2 (2023-11-05, svn r4503)}{
\subsection{Compatibility}{
\itemize{
\item \pkg{Matrix} did not pass its checks under \R{} version
3.5.0, implicitly violating \code{Depends: R (>= 3.5)}. This
release restores compatibility.
}
}
\subsection{Linking}{
\itemize{
\item Support is added for an ABI version relevant to packages
that link against \pkg{Matrix}. The ABI version is 1 in this
release and will be incremented by 1 in each future release that
changes the ABI. It is implicitly 0 in previous releases.
Versions and their components are defined in a header for use by
packages with \code{LinkingTo: Matrix (>= 1.6-2)} in their
\file{DESCRIPTION}. See \file{inst/include/Matrix/version.h} and
(below) \code{Matrix.Version}.
\item Reverse \code{LinkingTo} built under earlier versions of
\pkg{Matrix} should be rebuilt from sources by users and
maintainers of binary repositories.
}
}
\subsection{C-Level API}{
\itemize{
\item API headers are organized under \file{inst/include/Matrix/}
for easier namespacing. Packages should start using
\code{LinkingTo: Matrix (>= 1.6-2)} and include the API headers
with, e.g., \code{#include <Matrix/Matrix.h>}.
\item Packages including API headers can define macro
\code{R_MATRIX_INLINE}, typically with
\code{#define R_MATRIX_INLINE inline}, in order to allow the
compiler to inline stubs for registered routines.
\item Some API function prototypes and macros not used by any
reverse \code{LinkingTo} are removed or remapped.
\item Several API function prototypes used \code{const} qualifiers
where the registered routines do not.
\item The prototype of API function \code{M_cholmod_band_inplace}
did not match that of registered routine
\code{cholmod_band_inplace}. The prototype of \code{cholmod_band}
was copied by mistake.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item Methods for generic functions \code{rbind2}, \code{cbind2},
\code{\%*\%}, \code{\%&\%}, \code{crossprod}, and
\code{tcrossprod} determine the class of the result using more
strict rules, designed to avoid \dQuote{surprising} coercions
where possible. Notably, operations involving
\code{RsparseMatrix} now return an \code{RsparseMatrix} in more
cases. \code{TsparseMatrix} and \code{diagonalMatrix} may be
handled as \code{CsparseMatrix} or as \code{RsparseMatrix},
depending on context.
}
}
\subsection{Classes}{
\itemize{
\item New nonvirtual class \code{ndiMatrix} representing diagonal
nonzero pattern matrices. It extends virtual classes
\code{diagonalMatrix} and \code{nMatrix}. \code{ndiMatrix} are
typically obtained as the result of \code{is.na}, \code{is.nan},
or \code{is.infinite} applied to a \code{diagonalMatrix} or as the
result of coercing a \code{diagonalMatrix} to \code{nMatrix}.
(The result of that coercion used to be an \code{ntCMatrix}. It
is still possible to obtain an \code{ntCMatrix} by coercion to
\code{nsparseMatrix}.)
\item The validity method for class \code{sparseVector} requires
\code{length} not exceeding \code{2^53}, which on most platforms
is the minimum positive integer \eqn{k} such that \eqn{k + 1} is
not exactly representable in double precision.
\item A \code{dsparseVector} with \code{x} slot of type
\code{"integer"} is formally invalid, as always intended.
\item Certain never or seldom used class unions are removed.
}
}
\subsection{New Features}{
\itemize{
\item \code{mean(<sparseVector>, trim=)} now works efficiently for
nonzero values of \code{trim}.
\item \code{rep(<sparseVector>, each=)} now works efficiently,
avoiding \code{rep(., times = rep(each, times = length(.)))}.
\item \code{.m2dense} and \code{.m2sparse} gain an argument
\code{trans} indicating if vectors that are not matrices should be
coerced to 1-row matrices rather than 1-column matrices.
\item \code{.m2dense} and \code{.m2sparse} can be called with one
argument. Their \code{class} arguments admit new default values
\code{".ge"} and \code{".gC"}.
\item \code{.diag2dense} and \code{.diag2sparse} gain an argument
\code{kind} indicating the \dQuote{kind} of the result.
\item New exports \code{.M2V} and \code{.m2V}, for coercing
\code{Matrix} and \code{matrix} (and in fact \code{vector}) to
\code{sparseVector}.
\item New exports \code{isUniqueT} and \code{asUniqueT}, with
optional argument \code{byrow} allowing for row-major ordering of
entries. \code{asUniqueT} supercedes \code{uniqTsparse}, which is
no longer documented.
\item New export \code{aggregateT}, for aggregating
\code{TsparseMatrix} \emph{without} sorting.
\item Methods for \code{all.equal} now report the packages where
S4 classes are defined.
\item \code{sum(x)} and \code{prod(x)} no longer require a
coercion from \code{symmetricMatrix} to \code{generalMatrix}.
Results where coercions are now avoided may differ numerically due
to reordering of adds and multiplies, most commonly on systems
where \code{sizeof(long double) == sizeof(double)}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Methods for \code{cbind2} and \code{rbind2} did not in all
cases handle vectors as 1-column and 1-row matrices, respectively.
\item Methods for \code{cbind2} and \code{rbind2} did not handle
0-length vectors (including \code{NULL}) correctly where the
result would have 0 rows and columns, respectively.
\item Methods for \code{cbind2} and \code{rbind2} did not handle
\code{NA} in the \code{x} slot of \code{ndenseMatrix} correctly
(i.e., as \code{TRUE}).
\item \code{cbind2(<ndenseMatrix>, <ldenseMatrix>)} gave
\code{ngeMatrix} instead of \code{lgeMatrix}.
\code{cbind2(<lsparseMatrix>, <lsparseMatrix>)} gave
\code{dgCMatrix} instead of \code{lgCMatrix}. Methods for
\code{rbind2} had similar problems.
\item \code{rcond(<0-by-0>)} now returns \code{Inf}; see
\PR{18543}.
\item \code{round(<dp[op]Matrix>)} and
\code{signif(<dp[op]Matrix>)} now return \code{ds[yp]Matrix}
rather than \code{dp[op]Matrix} and now discard \code{factors}.
\item Methods for \code{length} now return \code{integer} rather
than \code{double} if the result does not exceed \code{INT_MAX}.
\item Methods for subscripting \code{sparseVector} did not behave
compatibly with \pkg{base} when supplied with fractional,
\code{NA}, or out-of-bounds subscripts.
\item \code{symmpart(x)}, \code{skewpart(x)}, \code{band(x, k1,
k2)}, \code{triu(x, k)}, and \code{tril(x, k)} now always return a
\code{.diMatrix} for \code{x} inheriting from
\code{diagonalMatrix}.
\item \code{colSums(<(n|l|ind)Matrix>)} and
\code{rowSums(<(n|l|ind)Matrix>)} now always give a result of type
\code{"integer"}. Methods differed previously, some giving
\code{"double"} (as \pkg{base} does, suboptimally, traditional
matrices of type \code{"logical"}).
\item Some methods for generic function \code{lu} did not transmit
\code{Dimnames} to the result.
\item Some methods for group generic function \code{Summary}
ignored arguments matching \code{\dots}. Other methods did not
ignore the \dQuote{garbage} elements of the \code{x} slot of
dense, triangular matrices.
\item \code{kronecker(<n.TMatrix>, <diagonalMatrix>)} threw an
error for attempting to access the nonexistent \code{x} slot of
its first argument.
\item Matrix products now behave exactly as \pkg{base} when
testing for conformable arguments.
\item Numeric products (\code{\%*\%}) did not always return a
\code{dMatrix}.
\item Methods for \code{all.equal} now \dQuote{see} attributes of
S4 objects that are not slots. This can be disabled by setting
argument \code{check.attributes} to \code{NA}, which is otherwise
equivalent to \code{TRUE}.
\item \code{prod(x)} is computed more diligently for \code{x}
inheriting from \code{sparseMatrix}, \code{sparseVector}, or
\code{.t[rp]Matrix}, i.e., those \code{x} that can be understood
to have \dQuote{structural} zeros. Now, multiplication by zero
occurs at the position of the first structural zero in the matrix
or vector (when traversed by row in the case of
\code{RsparseMatrix}). An exception is \code{TsparseMatrix}, for
which multiplication by zero occurs before multiplication by any
stored entry, regardless of the position of the first structural
zero in the corresponding sorted matrix (to avoid the cost of
sorting).
\item \code{tri[ul](<.t[rp]Matrix>, k)} was often wrong for
nonzero \code{k}, setting too many bands to zero.
\item C-level \code{tCsparse_diag} (formerly \code{diag_tC}) now
handles structural zeros and \code{NaN} on the main diagonal
correctly. Option \code{"diagBack"} now works correctly.
\item \code{expm(x)} failed for \code{x} of class \code{dtpMatrix}
or \code{dspMatrix}, since \pkg{Matrix} version 1.6-1.
\item \code{.m2dense(x, ".ge")} allocated unnecessarily for
\code{x} without attributes.
}
}
\subsection{Misc}{
\itemize{
\item \proglang{C} code now refers to the symbol \code{factors} as
\code{Matrix_factorsSym}, rather than \code{Matrix_factorSym}.
\item The content of \file{src/Mutils.[ch]} has been migrated to
more transparently named files: \file{src/attrib.[ch]},
\file{src/objects.[ch]}, etc. Similarly, much of
\file{src/factorizations.[ch]} have been migrated to
\file{src/solve.[ch]} and \file{src/determinant.[ch]}.
\item All matrix product code has been migrated to
\file{products.[Rch]}.
\item Files in \file{po/} and \file{inst/po/} have been updated
due to more frequent use of \code{gettextf} in \file{R/*.R}.
\item \proglang{C} code is prepared to handle complex matrices and
their factorizations. Notably, new machinery in
\file{src/cs-etc.[ch]} will enable linking the CXSparse library
instead of the CSparse library, the latter supporting numeric
types but not complex ones.
}
}
}
\section{Changes in version 1.6-1.1 (2023-09-08, hotfix)}{
\subsection{Misc}{
\itemize{
\item Export the generics \code{crossprod()} and
\code{tcrossprod()} explicitly, needed for R-devel when they
become primitive internal generics.
}
}
}
\section{Changes in version 1.6-1 (2023-08-11, svn r4228)}{
\subsection{C-Level API}{
\itemize{
\item Registered routine \code{chm_sparse_to_SEXP} sorts and packs
its first argument \emph{before} assigning any struct members to
variables, preventing use-after-free.
}
}
\subsection{Memory}{
\itemize{
\item Four Valgrind-detected memory bugs are fixed.
}
}
\subsection{Classes}{
\itemize{
\item Validity methods for classes \code{Cholesky} and
\code{pCholesky} test for a valid \code{perm} slot.
}
}
\subsection{New Features}{
\itemize{
\item Several new coercion utilities, exported and documented in
\code{help("fastMisc")}. Some of these supercede ones made
available (experimentally) in \pkg{Matrix} 1.5-4; for example,
\code{.M2m} makes both \code{.dense2m} and \code{.sparse2m}
redundant. The superceded ones are not yet formally deprecated,
but are no longer documented.
\item \code{drop0} is now implemented independently of
\code{CHOLMOD}, becoming more efficient notably for logical
arguments, no longer requiring a coercion to double.
\item \code{drop0} gains an argument \code{give.Csparse} to
complement \code{is.Csparse}. \code{FALSE} indicates that
\code{RsparseMatrix}, \code{TsparseMatrix}, and \code{indMatrix}
arguments should be handled directly, without a coercion to
\code{CsparseMatrix}. The default value is \code{TRUE}, for
backwards compatibility.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{<diagonalMatrix> \%*\% <RsparseMatrix>} works again.
\item \code{diag(<non-square RsparseMatrix>) <- value} works
again, no longer giving a \code{p} slot of length \code{Dim[2]}
rather than \code{Dim[1]}.
\item \code{as(<diagonalMatrix>, "symmetricMatrix")} now checks
for symmetric \code{Dimnames}, for consistency.
\item as(<indMatrix>, "[nld](sparse)?Matrix") now returns a
\code{.gRMatrix} or a \code{.gCMatrix} depending on the
\code{margin} slot.
\item \code{as(<[CR]sparseMatrix>, "generalMatrix")} now checks if
the number of nonzero entries in the result would exceed
\code{INT_MAX} and throws an error in that case.
}
}
\subsection{Misc}{
\itemize{
\item Run speed-measuring tests only \code{if(doExtras)}: these
were too slow when run under Valgrind.
\item Most coercion code has been migrated to \file{coerce.[Rch]}
from elsewhere.
\item The number of methods for generic functions \code{coerce}
and \code{as.*} has been reduced substantially, from 306 to 194
(not counting deprecated ones), partly as a result of efforts to
do more fine-grained dispatch in \proglang{C} code.
\item Files in \file{po/} and \file{inst/po/} have been updated
(again), as many more \proglang{C} level messages now use format
strings as a result of \code{vsnprintf} usage in
\file{src/validity.c}.
}
}
}
\section{Changes in version 1.6-0 (2023-06-30, svn r4125)}{
\subsection{Dependencies}{
\itemize{
\item The following \dQuote{weak} dependencies, needed only for a
small number of Rd cross references, are removed:
\pkg{MatrixModels}, \pkg{expm}, \pkg{igraph}, \pkg{maptools},
\pkg{sp}, \pkg{spdep}. Links to CRAN or Bioconductor in Rd files
are preserved.
\item \pkg{sfsmisc} is moved from \code{Enhances} to
\code{Suggests}, as \pkg{Matrix} does not formally enhance it with
methods or links to documentation.
\item \pkg{grDevices} and \pkg{datasets} are added to
\code{Imports} and \code{Suggests}, respectively, as \pkg{Matrix}
does import from \pkg{grDevices} and (in vignettes) does load data
from \pkg{datasets}.
\item Example, test, and vignette code no longer fails when
\env{R_DEFAULT_PACKAGES} is set to \code{NULL}.
\item Example code uses \code{requireNamespace} instead of
\code{require} to preserve the user's search path.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item Methods for generic function \code{chol} that previously
returned an object of class \code{p?Cholesky} now return an
equivalent object of class \code{dtrMatrix} or \code{dtpMatrix}.
Existing code that relied (correctly) on \code{chol} to return the
upper triangular Cholesky factor as a \code{Matrix} can be
expected to work as before.
}
}
\subsection{Classes}{
\itemize{
\item Class \code{indMatrix} gains a \code{margin} slot with value
\code{1L} or \code{2L} (\code{1L} being the prototype and
previously implicit value), indicating that the object represents
a row or column index matrix, with ones at \code{[i, perm[i]]} or
\code{[perm[j], j]}, respectively.\cr
\cr
Methods with \code{indMatrix} or its subclass \code{pMatrix} in
the signature have been adjusted to account for the new slot.
Notably, multiplication on the right by an \code{indMatrix} with
\code{margin = 2} is now implemented as a column subscript, and
the transpose of an \code{indMatrix} is now the same object but
with \dQuote{opposite} \code{margin}.
\item Virtual class \code{MatrixFactorization} gains a
\code{Dimnames} slot. Now all factorizations preserve the
\code{Dimnames} of the original, factorized \code{Matrix}, whereas
previously classes \code{Schur}, \code{sparseLU}, \code{sparseQR},
\code{dCHMsimpl}, and \code{dCHMsuper} did \emph{not}. Users can
get the value of the new \code{Dimnames} slot with
\code{dimnames(.)} and set it with \code{dimnames(.) <- value}.
\item Classes \code{p?BunchKaufman} and \code{p?Cholesky} no
longer extend \code{dtrMatrix} or \code{dtpMatrix} and in turn no
longer extend \code{Matrix}. They retain slots \code{Dim},
\code{Dimnames}, \code{uplo}, and \code{x}, but not \code{diag}.
This change implies that virtual classes \code{Matrix} and
\code{MatrixFactorization} no longer intersect.
\item Classes \code{p?Cholesky} gain a \code{perm} slot with
prototype \code{integer(0L)} to support representation of pivoted
factorizations, as typically computed by LAPACK routine
\code{dpstrf}. \code{perm} of length 0 is valid and equivalent to
the identity permutation.
\item New nonvirtual class \code{pcorMatrix} extending
\code{dppMatrix}. It is the counterpart of \code{corMatrix} using
packed storage, supporting more efficient storage of dense
correlation matrices. Now \code{pack(<corMatrix>)} gives a
\code{pcorMatrix} preserving the \code{sd} slot, rather than a
\code{dppMatrix} without an \code{sd} slot.
\item New virtual classes \code{BunchKaufmanFactorization},
\code{SchurFactorization}, and \code{QR}, extended by existing
nonvirtual classes \code{p?BunchKaufman}, \code{Schur}, and
\code{sparseQR}, respectively. These are parallel to the existing
virtual classes \code{CholeskyFactorization} and \code{LU}.
Packages defining new factorization classes may extend these.
\item Virtual class \code{CHMfactor} and its subclasses gain
formal validity methods.
\item The validity method for class \code{sparseQR} now tests that
the \code{V} slot is lower trapezoidal and that the \code{R} slot
has non-negative diagonal elements.
\item The validity method for class \code{corMatrix} now tolerates
nonfinite elements in the \code{sd} slot. It no longer tolerates
nonunit diagonal elements in the \code{x} slot.
\item The prototype of the \code{Dim} slot of virtual class
\code{MatrixFactorization} is now \code{integer(2L)}. It was
previously \code{integer(0L)}, with the result that
\code{validObject(new(<nonvirtual>))} was always an error.
\item The prototype of the \code{L} slot of class \code{sparseLU}
is now formally lower triangular, so that
\code{validObject(new("sparseLU"))} is not an error.
\item The prototypes of the \code{Q} and \code{T} slots of class
\code{Schur} are now 0-by-0 \code{dgeMatrix}, so that
\code{validObject(new("Schur"))} is not an error.
}
}
\subsection{Generic Functions}{
\itemize{
\item New generic functions \code{expand1} and \code{expand2},
intended to replace \code{expand} and coercions from (subclasses
of) \code{MatrixFactorization} to (subclasses of) \code{Matrix}.
\code{expand1} is used as
\code{expand1(<MatrixFactorization>, <character string>)} and
constructs by name factors appearing in the factorization.
\code{expand2} is used as \code{expand2(<MatrixFactorization>)}
and returns a named list of \emph{all} factors appearing in the
factorization, in order and with row names on the first factor
and column names on the last factor. The result can be used to
reconstruct the factorized \code{Matrix} as the product of the
elements of the list, namely
\code{Reduce(`\%*\%`, expand2(.))}.\cr
\cr
\code{expand} and its methods are retained for backwards
compatibility. They may be formally deprecated in the future,
hence new code should use \code{expand1} and \code{expand2}.
Notably, \code{expand1} and \code{expand2} have methods for all
factorizations in \pkg{Matrix}, whereas \code{expand} continues to
have methods only for \code{denseLU}, \code{sparseLU}, and
\code{CHMfactor}. See \code{help("expand-methods")} for a list of
methods, including useful optional arguments.
}
}
\subsection{New Features}{
\itemize{
\item Methods for subscripting \code{Matrix} now use the more
systematic code in \file{R/subscript.R} and
\file{src/subscript.c}, becoming more efficient for all
\code{lsparseMatrix}
(no longer coercing to \code{dsparseMatrix} and back),
sparse \code{symmetricMatrix}
(no longer coercing to \code{generalMatrix} and back when \code{i}
in \code{x[i, i]} is monotone),
\code{unpackedMatrix}
(no longer coercing to \code{matrix} and back), and
\code{RsparseMatrix}
(no longer coercing to \code{TsparseMatrix}, then to
\code{CsparseMatrix}, then back to \code{TsparseMatrix} [!]).\cr
\cr
\code{x[i, j, drop = FALSE]} preserves the class of \code{x} in
more cases where \code{x} is a \code{triangularMatrix},
\code{diagonalMatrix}, or \code{pMatrix}, doing more complete
checks on \code{i} and \code{j}.\cr
\cr
Notably, for \code{x} inheriting from \code{RsparseMatrix}, the
result is now always an \code{RsparseMatrix}, rather than always a
\code{TsparseMatrix}.
\item \code{NULL} subscripts, as in \code{x[NULL]}, \code{x[NULL,
j]}, and \code{x[i, NULL]}, are now supported for \code{x}
inheriting from \code{Matrix}. They are handled as
\code{integer(0)}, consistent with \pkg{base}.
\item Generic function \code{Cholesky} gains methods for
\code{denseMatrix} returning an object of class \code{p?Cholesky}.
The method for subclass \code{dsyMatrix} admits an argument
\code{perm} indicating if the pivoted factorization should be
computed. The corresponding \code{chol} method gains an argument
\code{pivot} indicating the same. By default, \code{Cholesky}
pivots and \code{chol} does not.
\item Many subclasses of \code{MatrixFactorization} can now be
coerced to \dQuote{nearby} subclasses of \code{Matrix}. The
resulting \code{Matrix} reflects the internal representation of
the factorization and not necessarily a particular matrix factor.
The new coercions are:
\code{as(<denseLU>, "dgeMatrix")},
\code{as(<BunchKaufman>, "dtrMatrix")},
\code{as(<pBunchKaufman>, "dtpMatrix")},
\code{as(<Cholesky>, "dtrMatrix")},
\code{as(<pCholesky>, "dtpMatrix")},
\code{as(<CHMsimpl>, "dtCMatrix")}, and
\code{as(<CHMsuper>, "dgCMatrix")}.
See \code{help("denseLU-class")} (and similar) for details.
\item \code{determinant(x, \dots)} and \code{solve(a, b, \dots)}
now work for \code{x} and \code{a} inheriting from
\code{MatrixFactorization}, behaving as if \code{x} and \code{a}
were replaced by the factorized \code{Matrix}. The exception is
\code{x} inheriting from \code{CHMfactor}, where for backwards
compatibility the default behaviour is still to compute the
determinant of the Cholesky factor. This exception should be
considered \emph{temporary}, hence defensive code will call
\code{determinant} with (new) optional argument \code{sqrt} set to
\code{TRUE} or \code{FALSE} explicitly, to not rely on the current
default value. See \code{help("CHMfactor-class")} for details.
\item Generic function \code{diag} gains methods for
\code{p?Cholesky} and \code{CHMfactor}. The result is a numeric
vector containing the diagonal entries of the diagonal matrix
\eqn{D}, as defined in \code{help("Cholesky-class")} and
\code{help("CHMfactor-class")}.
\item The \code{lu} and \code{qr} methods for class
\code{dgCMatrix} now admit an \code{order} argument with value in
\code{0:3}, allowing the expert user to choose among all ordering
methods made available by the CSparse library.
\item \code{solve(<dgCMatrix>, b, sparse = TRUE)} is now handled
entirely in \proglang{C} code via \code{cs_spsolve} from the
CSparse library.
\item New utilities \code{invertPerm}, \code{signPerm},
\code{isPerm}, and \code{asPerm} for computing the inverse and
sign of a permutation vector, testing if an integer vector is a
permutation vector, and coercing a transposition vector to a
permutation vector. \code{invertPerm} is a more general version
of the already exported function \code{invPerm}, which is retained
as a wrapper around \code{invertPerm} for backwards compatibility.
\item The \code{qr.R} method for class \code{sparseQR} gains a
\code{backPermute} argument with default \code{FALSE}, for
compatibility with \pkg{base}. Function \code{qrR}, which existed
primarily to provide a back-permuting option, is retained for
backwards compatibility.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{x[integer(0), ]} and \code{x[, integer(0)]} now give a
\code{generalMatrix} result when \code{x} is a 0-by-0
\code{diagonalMatrix}, for consistency with all other cases of
\code{x[seq_len(n), ]} and \code{x[, seq_len(n)]}, where \code{x}
is an \code{n}-by-\code{n} triangular, symmetric, or diagonal
matrix.
\item For \code{x} inheriting from \code{RsparseMatrix},
subassignment of the form \code{x[i, ] <- value} is now correctly
distinguished from \code{x[i] <- value}.
\item \code{rownames(x[integer(0), , drop = FALSE])} and
\code{colnames(x[, integer(0), drop = FALSE])} are now always
\code{NULL} and never \code{character(0)}, consistent with the
implementation in \pkg{base}.
\item Subscript operations on \code{Matrix} now correctly error
whenever the formal argument \dots{} is matched, as in \code{x[i,
j, drop]}, where \code{x[i, j, drop = drop]} is almost always
intended.
\item \code{x[i, ]} now correctly drops dimensions when \code{x}
is a 1-by-\code{n} \code{Matrix} and \code{i} is \code{TRUE}.
\item Methods for \code{solve} now obey the following rules much
more strictly:
\itemize{
\item \code{solve(a=<Matrix>, b=<vector>)}
must return a vector.
\item \code{solve(a=<denseMatrix>, b=<Matrix>)}
must return a \code{denseMatrix}.
\item \code{solve(a=<sparseMatrix>, b=<Matrix>, sparse=FALSE)}
must return a \code{denseMatrix}.
\item \code{solve(a=<sparseMatrix>, b=<Matrix>, sparse=TRUE)}
must return a \code{sparseMatrix}.
}
resolving some longstanding incompatibilities with \pkg{base}.\cr
\cr
Note that methods for sparse \code{a} and missing or sparse
\code{b} have default \code{sparse = TRUE}, while methods for
sparse \code{a} and dense \code{b} have default
\code{sparse = FALSE}.
\item \code{solve(<symmetricMatrix>)} now always gives a
\code{symmetricMatrix} result. \code{solve(<dpoMatrix>)} and
\code{solve(<dppMatrix>)} preserve formal positive definiteness,
giving a \code{dpoMatrix} and \code{dppMatrix}, respectively.
\item \code{BunchKaufman(<matrix>)} now works when argument
\code{uplo} (documented to be optional) is missing.
\item Coercions to \code{corMatrix} now set the diagonal elements
of the result to 1, consistent with \code{cov2cor}.
\item \code{dimnames(x) <- value} now validates \code{x@Dim}
before \code{value} to avoid undefined behaviour in C-level check.
\item \code{chol2inv(x)} now ignores the lower triangular part of
\code{x} not inheriting from \code{triangularMatrix}.
\item \code{chol2inv(x)} now computes \code{crossprod(solve(x))}
instead of \code{tcrossprod(solve(x))} for all formally lower
triangular \code{x}. Previously, \code{crossprod} was used only
for dense \code{x}.
\item \code{rcond(x, norm)} throws a nicer error for \code{x} of
length 0.
\item Error messages due to invalid \code{norm} in \code{rcond(x,
norm)} now refer to the argument as \code{norm} rather than
\code{type}.
\item \code{rcond(x, norm)} now validates \code{norm} also for
\code{x} of class \code{d(sy|sp|po|pp)Matrix}, even if for such
\code{x} all valid \code{norm} give the same result.
\item \code{which(<[RT]sparseMatrix>, ...)} now gives indices in
column-major order in all cases, to be consistent with
\code{help("which")}.
\item Factorizations inheriting from virtual class \code{LU} are
now cached under the name \code{denseLU} or \code{sparseLU},
depending on the nonvirtual class, rather than always under the
name \code{LU}. Note that user code should \emph{not} rely on the
details of the cache and should instead rely on functions such as
\code{lu} to retrieve cached factorizations.
\item Errors signaled by \code{as(<dsyMatrix>, "dpoMatrix")} and
\code{as(<dspMatrix>, "dppMatrix")} now clarify that the coercions
do not attempt to test for positive semidefiniteness when the
matrix is not positive definite.
}
}
\subsection{Memory}{
\itemize{
\item \code{invPerm(p)} no longer segfaults for \code{p} that are
not valid permutation vectors. \code{invPerm(NA)} was enough to
trigger a segfault.
\item \proglang{C} code interfacing the CSparse library tests in
more places for failed allocations inside of \code{cs_*}.
}
}
\subsection{Misc}{
\itemize{
\item Help pages for matrix factorization classes and methods have
been broadly expanded and updated to use consistent notation.
\item The length of the \pkg{Matrix} namespace has been reduced by
~15\%. More than 100 unused symbols have been removed.
\item Updates to \file{po/*.\{po,pot\}} and \file{inst/po/*} for
translators.
}
}
}
\section{Changes in version 1.5-4.1 (2023-05-16, hotfix)}{
\subsection{Installation}{
\itemize{
\item \file{src/Lapack-etc.h} uses \code{#ifdef PR18534fixed},
adapting to \PR{18534} without breaking installation under \R{}
\eqn{<} 4.3.1.
}
}
}
\section{Changes in version 1.5-4 (2023-04-02, svn r3837)}{
\subsection{Compatibility}{
\itemize{
\item \code{sequence.default} is defined for \R{} \eqn{<} 4.0.0.
}
}
\subsection{C-Level API}{
\itemize{
\item \file{Rinternals.h} is included in
\file{inst/include/Matrix.h} instead of deprecated
\file{Rdefines.h}. The inclusion is done outside of
\code{extern "C"}.
}
}
\subsection{Deprecated and Defunct}{
\itemize{
\item The following low level coercion utilities, which were
previously exported but always \dQuote{hidden} and undocumented,
are now deprecated: \code{..2dge}, \code{.C2nC}, \code{.T2Cmat},
\code{.asmatrix}, \code{.dense2sy}, \code{.diag2mat},
\code{.diag2sT}, \code{.diag2tT}, \code{.dsy2dsp},
\code{.dsy2mat}, \code{.dxC2mat}, \code{.m2dgC}, \code{.m2lgC},
\code{.m2ngC}, \code{.m2ngCn}, \code{.m2ngTn}, \code{.n2dgT},
\code{.nC2d}, \code{.nC2l}.\cr
\cr
The deprecations follow efforts to define more general and more
systematic (but still fast) coercion utilities, to allow expert
users to bypass S4 dispatch in more cases. The subset of these
currently exported is documented under \code{help("fastMisc")}.
Deprecation warnings will suggest an appropriate replacement,
mostly from that list.\cr
\cr
It is not always the case that the replacement can be
\dQuote{dropped in}, hence users should consult the relevant
documentation when changing their code.
\item Warnings signaled by coercion methods deprecated in
\pkg{Matrix} 1.5-0 now correctly inherit from class
\code{deprecatedWarning}.
}
}
\subsection{Memory}{
\itemize{
\item Calls to \code{sprintf} are replaced by equivalent calls
\code{snprintf} to avoid potential buffer overflow.
}
}
\subsection{Misc}{
\itemize{
\item C-level utilities \code{Matrix_memset()} and
\code{Matrix_memcpy()}, both new, are now used in many places
instead of API macros \code{Memzero()} and \code{Memcpy()} which
never check for overflow. C-level macro \code{AZERO()} is no
longer defined.
\item C-level macro \code{Calloc_or_Alloca_TO()} now
zero-initializes also in the \code{alloca}-using case.
}
}
}
\section{Changes in version 1.5-3 (2022-11-10, svn r3772)}{
\subsection{Dependencies}{
\itemize{
\item \pkg{methods} is moved from \code{Imports} to \code{Depends}
as suggested in the WRE manual. Now \code{as} and other basic S4
machinery are available whenever \pkg{Matrix} is attached. This
change affects \R{} processes started with environment variable
\env{R_DEFAULT_PACKAGES} set to \code{NULL} (or any list not
containing \pkg{methods}).
}
}
\subsection{Compatibility}{
\itemize{
\item Test involving sparse \code{POSIXlt} in
\file{tests/Simple.R} is adapted to possible (unconditional since
\R{} version 4.3.0) existence of character component \code{zone}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{dimScale(x)} with argument \code{d1} missing is no
longer an error. (The default value had \code{diag(x, FALSE)}
instead of \code{diag(x, names = FALSE)}.)
\item \code{(dim|row|col)Scale(x)} is no longer an error for
traditional matrices \code{x} without a \code{dimnames} attribute.
\item Our \code{cov2cor()} methods now again preserve
(symmetrized!) \code{dimnames}, fixing \MPR{6783} reported by
Ben Bolker.
\item \code{colSums()} and friends now always give a \emph{named}
result when the marginal \code{Dimnames} are non-\code{NULL}.
(Names were \dQuote{forgotten} for \code{diagonalMatrix} and
\code{indMatrix} arguments.)
\item \code{colSums()} and friends now respect \code{na.rm} when
handling \code{diagonalMatrix} with \code{NA} diagonal entries.
\item \code{expand(<denseLU>)} now \dQuote{copies-on-modify}, no
longer duplicating the \code{m*n}-length \code{x} slot in the
\code{m == n} case, when it can be used directly.
\item \code{lu(<m-by-0>)}, \code{lu(<0-by-n>)}, and
\code{BunchKaufman(<0-by-0>)} now give sensible (0-extent)
results, rather than a LAPACK error, for \code{denseMatrix}.
}
}
\subsection{New Features}{
\itemize{
\item \code{Diagonal()} gets a new optional \code{names} argument.
\item \code{diag(x) <- value} is now done in \proglang{C} also for
\code{[CRT]sparseMatrix}.
\item \code{.diagU2N()} gets fast counterpart \code{.diagN2U()}.
\item \code{colSums()} and friends are now implemented more
efficiently for \code{denseMatrix} and \code{[CRT]sparseMatrix}.
Notably, methods for triangular and symmetric matrices no longer
go via \code{generalMatrix}, and methods for
\code{[CRT]sparseMatrix} now handle nonzero pattern and logical
matrices directly (no longer coercing to double, a constraint of
the earlier implementation using CHOLMOD).
\item \code{determinant(<ds[yp]Matrix>)} is now computed via the
Bunch-Kaufman factorization. Factorizations are cached in the
\code{factors} slot for future reuse.
}
}
\subsection{Misc}{
\itemize{
\item C-level wrappers for LAPACK \code{d..trf} routines gain an
argument \code{warn} indicating how to handle \code{info > 0}:
\code{warn <= 0} is silent, \code{warn = 1} is a warning, and
\code{warn > 1} is an error. In the case of \code{dp[op]trf}, for
which \code{info > 0} implies an incomplete factorization,
\code{info} is now returned as a length-1 integer.
}
}
}
\section{Changes in version 1.5-2 (2022-10-21, svn r3702)}{
\subsection{Classes}{
\itemize{
\item The validity methods for classes \code{l[st]CMatrix} now
correctly test for structurally nonzero entries on the wrong side
of the main diagonal, and fail in that case. Previously, this
test was performed only for \code{d[st]Matrix}.
\item The validity method for virtual class \code{sparseVector} is
more diligent, catching more edge cases such as \code{NA} in the
\code{length} or \code{i} slot.
\item New validity methods for \code{n[st][CRT]Matrix},
\code{Schur}, \code{denseLU}, \code{p?BunchKaufman},
\code{p?Cholesky}, \code{sparseLU}, and \code{sparseQR}. Notably,
the following properties of factorizations are now checked: the
dimensions of each factor, the orientation of each triangular (or
trapezoidal) factor, and the validity of each permutation vector.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{lu(x)@L@uplo} is now \code{"L"}, not \code{"U"}, for
0-by-0 and 1-by-1 \code{dgCMatrix} \code{x}.
\item The validity method for \code{corMatrix} now throws a better
error when the \code{sd} slot is of type \code{"integer"} rather
than \code{"double"}.
\item \code{.sparseDiagonal()} now agrees with \code{Diagonal()}
when called with no arguments, returning a 0-by-0 (rather than
1-by-1) diagonal \code{Matrix}.
\item \code{sparseMatrix(i, j)} with 0-length \code{i} and
\code{j} now returns a 0-by-0 matrix rather than throwing a
perplexing error.
\item \code{sparseMatrix(dims = <list>)} and
\code{sparseMatrix(x = <dMatrix>)} now produce errors.
\item \code{diag(x) <- value} now coerces \code{diagonalMatrix}
\code{x} if \code{typeof(value)} is \dQuote{higher} than
\code{typeof(x@x)} in the usual hierarchy, for consistency with
methods for \code{denseMatrix} and with \code{base::`diag<-`}.
\item Methods for \code{kronecker()} no longer ignore the
\code{make.dimnames} argument.
\item Printing a \code{sparseMatrix} with \code{NA} row or column
names is no longer an error.
\item Products of two \code{pMatrix} objects \code{x} and \code{y}
are now computed correctly. Previously, \code{y \%*\% x} was
returned instead of \code{x \%*\% y}!
\item Products \code{x \%*\% y} with \code{x} a
\code{diagonalMatrix} or \code{indMatrix} and \code{y} a
traditional matrix or vector, or with \code{x} a traditional
matrix or vector and \code{y} a \code{diagonalMatrix} or
\code{pMatrix}, now treat the unclassed argument as a
\code{.geMatrix} and return a \code{.geMatrix}, for greater
consistency with other products involving one \code{Matrix} and
one non-\code{Matrix}.
\item Similarly, \code{kronecker(x, y)} with one of \code{x} and
\code{y} a \code{Matrix} and the other a traditional matrix or
vector now treats the unclassed argument as a \code{.geMatrix}.
\item \code{dimnames(solve(x))} is now \code{rev(dimnames(x))} for
\code{denseMatrix} \code{x}, consistent with the handling of
\code{dimnames} by \code{solve.default}. Methods for
\code{sparseMatrix} \code{x} have not been addressed (yet).
}
}
\subsection{Memory}{
\itemize{
\item In many more (but not yet all) places, \proglang{C}
functions protect the values of \code{R_do_slot},
\code{Rf_getAttrib}, \code{Rf_mkString}, etc. from garbage
collections, squashing many new and some old \command{rchk}
warnings.
}
}
\subsection{New Features}{
\itemize{
\item \code{is.nan(x)} is now implemented for all \code{x}
inheriting from virtual class \code{Matrix} or
\code{sparseVector}.
\item \code{Diagonal(n=, x=)} now recycles \code{x} of any
positive length to length \code{n}. Previously, recycling was
supported only for \code{x} of length 1.
\item Products involving \code{diagonalMatrix} or \code{indMatrix}
have been broadly improved as follows:
\itemize{
\item \code{dimnames(A \%*\% B)} is now always
\code{c(dimnames(A)[1], dimnames(B)[2])}.
\item \code{t?crossprod()} methods involving \code{indMatrix} or
its subclass \code{pMatrix} gain a \code{boolArith} argument.
\item Numeric and boolean products are always returned as
\code{dMatrix} and \code{nMatrix}, respectively, except in a few
special cases where the product can be represented as an
\code{indMatrix}. (Previously, coercions were skipped when one
of the operands was unit diagonal.)
\item Products of \code{diagonalMatrix} with dense
\code{triangularMatrix} now correctly give a
\code{triangularMatrix} result (and without unpacking).
\item Products of \code{diagonalMatrix} with
\code{[RT]sparseMatrix} now preserve storage, no longer coercing
to \code{CsparseMatrix}.
\item \code{crossprod(x, y)} no longer requires the product of
\code{ncol(x)} and \code{ncol(y)} to be less than \code{2^31}
when both \code{x} and \code{y} are \code{indMatrix}. (The new
implementation now always gives a \code{dgTMatrix} result,
whereas previously the result would typically but not always be
a \code{dgCMatrix}.)
}
\item \code{kronecker(<Matrix>, <Matrix>)} now gives the correct
\dQuote{shape} (general, [unit] triangular, symmetric, diagonal)
in all cases where it can be known without checking.
\item \code{kronecker(<[CR]sparseMatrix>, <Matrix>)} now retains
the storage of the first argument, no longer coercing to
\code{TsparseMatrix}.
\item New exported functions \code{dimScale}, \code{rowScale}, and
\code{colScale}, for scaling rows and columns of a
\code{[mM]atrix} without losing \code{dimnames} and where
appropriate without losing symmetry.
}
}
}
\section{Changes in version 1.5-1 (2022-09-12, svn r3642)}{
\subsection{Memory}{
\itemize{
\item ASan-detected memory bugs are fixed in \proglang{C}
functions \code{Tsparse_as_CRsparse} and \code{pMatrix_validate}.
The former was triggered by \code{.T2C(<0-by-0>)} and the latter
was triggered by \code{as(<length-10000 integer>, "pMatrix")}.
}
}
}
\section{Changes in version 1.5-0 (2022-09-09, svn r3636)}{
\subsection{Deprecated and Defunct}{
\itemize{
\item With a few exceptions, direct coercions to non-virtual
subclasses of \code{Matrix} (e.g., \code{dsCMatrix}) have been
formally deprecated. For now, these will continue to work as
before, but with a warning indicating how to accomplish the
desired coercion via virtual classes (e.g.,
\code{symmetricMatrix}) alone. How such warnings are signaled is
controlled by the global option
\code{Matrix.warnDeprecatedCoerce}.
\describe{
\item{\code{0} or less}{is to be silent.}
\item{\code{1}}{is to signal a warning with each deprecated
coercion.}
\item{\code{2} or greater}{is to signal an error with each
deprecated coercion.}
\item{\code{NA}}{is to signal a message or warning (see below)
with the next deprecated coercion and be silent after that.}
}
If unset or invalid, then the value of the environment variable
\env{R_MATRIX_WARN_DEPRECATED_COERCE} (\code{NA} if unset) is
used. This is cached when the \pkg{Matrix} namespace is
loaded.\cr
\cr
Option values are coerced to integer before use.\cr
\cr
To reduce disruption to existing code, the \code{NA} case signals
messages rather than warnings with coercions to the most-used
non-virtual subclasses of \code{Matrix}, namely \code{dg.Matrix}
and \code{d.CMatrix}. This may change in the future.
}
}
\subsection{Classes}{
\itemize{
\item New virtual class \code{unpackedMatrix} representing dense
matrices in unpacked format. It extends \code{denseMatrix} and is
extended by \code{[nld](ge|sy|tr)Matrix}, i.e., the subclasses of
\code{denseMatrix} not extending \code{packedMatrix}.
\item The validity method for \code{dppMatrix} requires
non-negative diagonal elements, matching the validity method for
\code{dpoMatrix}.
\item The validity method for \code{Matrix} tolerates vector types
other than \code{"character"} for \code{Dimnames[[i]]}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Symmetrization of \code{<Matrix>@Dimnames} and
\code{dimnames(<matrix>)} now goes through \proglang{C} utility
\code{symmDN()} in most places, resolving some earlier
inconsistencies.
\item Many more validity methods now correctly operate under the
assumption that methods for superclasses have already been called,
eliminating many redundant checks.
\item Validation of \code{<Matrix>@Dim} now looks at type
\emph{before} length, avoiding a misleading error message.
\item Validation of \code{<Matrix>@Dimnames} now avoids
\code{isNewList}, which had allowed an error message suggesting
that \code{NULL} is a list.
\item Setting a factor on a \code{compMatrix} is now to install
the factor itself, not a copy, for efficiency and consistency with
the semantics of \code{<compMatrix>@factors[[name]] <- value}.
\item Long vector support in methods for packing and unpacking
\code{denseMatrix}, and others.
\item \code{diag<-} incorrectly preserved the class of dense
matrices, so that, e.g., \code{`diag<-`(x=<dpoMatrix>, value=-1)}
was still a \code{dpoMatrix}. Now the result is always one of the
more general \code{.(ge|tr|sy|tp|sp)Matrix}.
\item \code{t(<corMatrix>)} no longer clears the \code{sd} slot.
\code{t(<p?BunchKaufman>)} now returns one of the more general
\code{dt[rp]Matrix}, rather than preserving class and clearing the
\code{perm} slot.
\item \code{t(<symmetricMatrix>)} no longer reverses the
\code{Dimnames} slot. Symmetrization of \code{dn <- x@Dimnames}
and \code{t(x)@Dimnames} had given different results when
\code{dn[[1]]} and \code{dn[[2]]} were non-\code{NULL} and
asymmetric.
\item \code{isTriangular(x, upper)} had incorrectly returned
\code{FALSE} for \code{x} of class \code{triangularMatrix} when
\code{upper = TRUE} and \code{x@uplo = "L"} or when \code{upper =
FALSE} and \code{x@uplo = "U"}. \code{isTriangular} is now
equivalent to \code{isDiagonal} in those cases.
\item \code{isSymmetric()} was equivalent to \code{isDiagonal()}
for triangular matrices, \emph{not} allowing numerical fuzz via an
argument \code{tol}. A \code{tol} argument is now implemented for
all subclasses of \code{dMatrix} except for those inheriting from
\code{symmetricMatrix} or \code{diagonalMatrix}.
\item Methods for \code{isSymmetric} now also look at
\code{Dimnames} and \code{names(Dimnames)}, following
\code{isSymmetric.matrix} from \pkg{base}. See also New Features.
\item \code{band(x, -k, k)} for sparse \code{x} used
\code{isSymmetric(x)} (which tolerates numerical fuzz) to test for
symmetry, resulting in loss of information in some cases. Now it
tests that \code{x} inherits from \code{symmetricMatrix}, and so
returns \code{symmetricMatrix} in fewer cases.
\item \code{triu(x, k)} and \code{tril(x, k)} incorrectly required
\code{k <= m} (instead of \code{k <= n}), for \code{m}-by-\code{n}
sparse \code{x}. They now accept all \code{k} from \code{-m} to
\code{n}, with fewer errors in the \code{m < n} case.
\item \code{crossprod(<Rsparse>, <Tsparse>)} and similar now work
again (optional \code{boolArith} was not passed on), fixing
\MPR{6766} by David Cortes. Ditto for \code{tcrossprod()}, where
the old result was even wrong when it had \dQuote{worked}, before
\pkg{Matrix} 1.2-0.
\item \code{as(<matrix>, "nMatrix")} can now be sparse \emph{or}
dense, going via \code{Matrix()}, for greater consistency with
coercions to \code{dMatrix} and \code{lMatrix}. (Previously, the
result was always an \code{ngTMatrix}.)
\item \code{forceSymmetric(<[RT]sparseMatrix>)} are now more
efficient, returning symmetric \code{[RT]sparseMatrix} without
intermediate coercions to \code{CsparseMatrix}.
\item \code{tcrossprod(a, b)} for unit triangular sparse matrices
now works correctly.
\item \code{!<ltrMatrix>} is no longer an error in the 0-by-0 unit
diagonal case.
\item Coercions among \code{[CRT]sparseMatrix} preserve the
\code{factors} slot in more cases.
\item Coercions of overallocated \code{l.TMatrix} to
\code{denseMatrix} or \code{CsparseMatrix} now give \code{TRUE}
instead of \code{NA} in the \code{NA || TRUE} case, following
conventional logic.
\item Methods for unpacking and indexing \code{packedMatrix} and
for coercing from \code{[CRT]sparseMatrix} to \code{denseMatrix}
now check more consistently for overflow of \code{R_XLEN_T_MAX}.
\item \code{solve(<ddenseMatrix>, <ANY>)} is removed from the
method list. It had allowed infinite recursion, e.g., with
\code{solve(new("dgeMatrix"), NULL)}.
\item \code{is.na(<ndenseMatrix>)} gave \code{TRUE} where the
\code{x} slot had \code{NA}. Now the result is always a zero
matrix.
\item \code{is.na(<.t[rp]Matrix>)} and
\code{is.infinite(<.t[rp]Matrix>)} ignored the \code{diag} slot,
behaving always as though \code{diag == "N"}. They now give
\code{FALSE} on the diagonal in the \code{diag != "N"} case.
\item Now only \dQuote{nontrivial} matrix elements determine
whether \code{is.na(<denseMatrix>)} is an \code{ndenseMatrix} or
an \code{nsparseMatrix}.
\item \code{is.na(<ddenseMatrix>)} coerced to \code{lMatrix}.
This unnecessary step is avoided now, saving a potentially
nontrivial allocation.
\item \code{solve(<ddenseMatrix>, b)} coerced the first argument
to \code{dgeMatrix} when \code{b} was not a \code{ddenseMatrix} or
traditional \code{matrix}. This unnecessary step is avoided now,
so that specialized methods for \code{d(tr|sy|po|tp|sp|pp)Matrix}
are used where possible (including for \code{b} inheriting from
\code{[ln]denseMatrix}, \code{sparseMatrix}, or \code{numLike}).
\item \code{`dim<-`(x, -x@Dim)} is now an error, no longer
yielding an invalid \code{Matrix} object.
\item \code{`dim<-`(x, x@Dim)} is now faster, returning \code{x}
without allocation in all cases.
\item \code{`dim<-`(x, value)} gives a better error when
\code{value} contains \code{NA} or elements exceeding
\code{INT_MAX}.
\item \code{`dim<-`(<RsparseMatrix>, value)} is now an
\code{RsparseMatrix}, rather than a \code{TsparseMatrix}.
\item For consistency with other methods,
\code{symmpart(<diagonalMatrix>)} now always inherits from both
\code{dMatrix} and \code{symmetricMatrix}, and
\code{skewpart(<diagonalMatrix>)} now always has symmetric
\code{Dimnames}.
\item Zeros on the diagonal of
\code{skewpart(<[CRT]sparseMatrix>)} are now \emph{structural}.
\item \code{as(<ndenseMatrix>, "(vector|matrix|[dl]Matrix)")} and
\code{nnzero(<ndenseMatrix>)} now correctly treat \code{NA} in the
\code{x} slot as \code{TRUE}.
\item \code{as(<[nl].TMatrix>, "dMatrix")} now correctly handles
the overallocated case: data for each unique \code{[i,j]} pair are
aggregated logically (\code{x1 || ... || xn}) rather than
arithmetically (\code{x1 + ... + xn}), so that elements of the
result are restricted to the set \code{c(0, 1, NA)}. This bug had
also affected the result of \code{sum(<[nl].TMatrix>)}.
\item \code{dimnames(as(x, "matrix"))} is now \code{NULL} for
\emph{all} \code{x} inheriting from \code{Matrix}, when
\code{x@Dimnames} is the trivial \code{list(NULL, NULL)}.
\item \code{.bdiag(<named list>)} no longer propagates names to
the \code{Dim} slot of the result.
\item \code{as(<named vector>, "denseMatrix")} now correctly
propagates \code{names} to the result.
\item \code{as(<d.[CR]Matrix>, "lMatrix")} no longer drops
non-structural zeros, for greater consistency with analogous
coercions.
\item \code{Matrix(x, doDiag)} now behaves as documented for
diagonal matrices \code{x} with asymmetric \code{dimnames},
returning a \code{diagonalMatrix} when \code{doDiag = TRUE},
rather than a \code{triangularMatrix}.
\item Matrix(<n-dimensional table>) now works for \code{n != 2}.
\item \code{Matrix(<sparseVector>)} now works for vector lengths
other than 1, no longer giving an error about length mismatch when
neither of \code{nrow} and \code{ncol} are supplied.
\item \code{Matrix(<diagonalMatrix>, doDiag = FALSE)} is now a
\code{symmetricMatrix}, not a \code{diagonalMatrix}, matching the
documentation of \code{doDiag}.
\item \code{Matrix(<.geMatrix>, sparse = TRUE, forceCheck)} and
\code{Matrix(<.g[CRT]Matrix>, sparse = FALSE, forceCheck)} now
respect \code{forceCheck = FALSE} by always returning
\code{generalMatrix}, i.e., \emph{not} testing for symmetric or
triangular structure.
\item \code{Matrix(0, nrow, )}, \code{Matrix(0, , ncol)} now throw
(correct) errors for \code{nrow}, \code{ncol} in the interval
\eqn{[0,1)}, consistent with \code{base::matrix()}.
\item \code{sparseDefault(<sparseMatrix>)} now counts zeros
without coercing to \code{matrix}, making
\code{Matrix(<sparseMatrix>, sparse = NULL)} much more efficient.
\item Methods for group generic \code{Math} no longer preserve
\code{x@diag == "U"} or lose \code{x@Dimnames} when \code{f(0) ==
0} and \code{f(1) != 1}. (The former happened for
\code{triangularMatrix} \code{x} and the latter for
\code{diagonalMatrix} \code{x}.)
\item \code{image(Z)} for a completely \dQuote{empty} (all 0)
\code{sparseMatrix} works again (?!).
\item \code{x[i, ] <- value} and \code{y[, j] <- value} is now an
error in more cases for \code{m}-by-0 \code{CsparseMatrix}
\code{x} and 0-by-\code{n} \code{CsparseMatrix} \code{y}. In
these cases, subassignment gave a (formally) invalid result.
\item \code{chol(<ds[yp]Matrix>)} now calls the underlying C-level
routine exactly once. Previously, it was called an extra time in
order to test for positive definiteness, with the result thrown
away (!). Hence these methods should become approximately two
times faster.
\item \code{dimnames(chol(x))} is identical to \code{dimnames(x)}
in all cases, now even when \code{chol(x)} is constructed from a
cached \code{MatrixFactorization}, for greater consistency with
\code{base::chol.default()}.
\item \code{chol(<generalMatrix>)} no longer looks at
\code{Dimnames} when testing for symmetry.
\item \code{lu(<dtCMatrix>)} no longer returns an invalid
\code{sparseLU} object in the lower triangular case.
\item \code{lu(x)} had sometimes incorrectly cached its return
value as element \code{"lu"} (rather than \code{"LU"}) of
\code{x@factors}. Now it is always \code{"LU"}.
\item \code{Compare} operators, e.g., \code{a > b}, \code{x !=
y}, now work correctly in more dense unitriangular and sparse
0-extent cases.
\item \code{!<nMatrix>} is now always an \code{nMatrix}, never an
\code{lMatrix}.
\item \code{!<ndenseMatrix>} and \code{which(<ndenseMatrix>)} now
correctly handle \code{NA} as \code{TRUE}.
\item \code{anyNA(<denseMatrix>)} had incorrectly returned
\code{anyNA(.@x)} in many cases, giving false positives for some
\code{.(tr|sy)Matrix} and \code{ndenseMatrix}. Now methods
respect the \dQuote{rules} of these classes.
\item The boolean arithmetic product \code{A \%&\% B} and e.g.,
\code{crossprod(A, B, boolArith=TRUE)} now should behave as if
\code{drop0(A)} and \code{drop0(B)} were used, i.e., for formally
sparse matrices, the boolean product results should be stable with
respect to non-structural vs structural zeros.
\item \code{t(<symmetricMatrix>)} now retains the \code{factors}
slot, avoiding recomputation.
\item Fixed the (quite \emph{long standing}) \MPR{6777}, reported
by Manuel Koller: \code{tcrossprod(<matrix>, <[dln]sCMatrix>)} has
been wrong in some cases.
}
}
\subsection{Memory}{
\itemize{
\item \code{qr(<big sparse>)} could segfault due to integer
overflow inside of \code{cs_multiply}. Now an error is signaled
indicating \dQuote{out of memory}. Reported by Benjamin Tyner
as \MPR{6610}.
\item Valgrind warning originating in \code{cholmod_sdmult}
is squashed. Reported by David Cortes as \MPR{6726}.
}
}
\subsection{New Features}{
\itemize{
\item \code{KhatriRao()} gets new \code{sparseY = TRUE} option and
also works for more \code{Matrix} classes.
\item Virtual class \code{packedMatrix} gains methods for
\code{pack}, \code{unpack}, \code{isSymmetric},
\code{isTriangular}, and \code{isDiagonal} implemented in C,
replacing those defined for many subclasses individually.
\item Virtual class \code{unpackedMatrix} gains methods for
\code{pack}, \code{unpack}, \code{isSymmetric},
\code{isTriangular}, \code{isDiagonal}, \code{t}, \code{diag}, and
\code{diag<-} implemented in C, replacing those defined for many
subclasses individually.
\item \code{isTriangular} and \code{isDiagonal} are now
implemented in \proglang{C} also for \code{[CRT]sparseMatrix} and
standard \code{matrix}. \code{isSymmetric} is now implemented in
\proglang{C} for all \code{denseMatrix} and all
\code{[CRT]sparseMatrix}, though these \proglang{C} routines are
currently only called when testing for \emph{exact} symmetry
(always for \code{[ln]Matrix}, only when \code{tol = 0} for
\code{dMatrix}).
\item Methods for \code{isSymmetric} gain an argument
\code{checkDN = TRUE} indicating whether symmetry of
\code{Dimnames} should be checked. For backwards compatibility
and consistency with \code{isSymmetric.matrix} from \pkg{base},
the actual condition is \code{checkDN && check.attributes}.
\item \code{isTriangular(x, upper)} now has a \code{kind}
attribute \emph{if and only if} \code{x} is triangular and
\code{upper} is \code{NA}.
\item \code{diag(<unpackedMatrix>) <- value} now behaves like
\code{diag(<packedMatrix>) <- value}, supporting coercions
depending on \code{typeof(value)}, consistent with \code{diag<-}
from \pkg{base}.
\item \code{pack} and \code{unpack} are now identity functions for
\code{packedMatrix} and \code{unpackedMatrix} arguments,
respectively (previously an error). \code{pack(<.geMatrix>)}
(previously an error) now behaves as \code{pack(<matrix>)}, i.e.,
by checking for symmetry or triangularity before packing.
\code{unpack(<matrix>)} now works and is equivalent to
\code{as(<matrix>, "unpackedMatrix")}, with result inheriting from
\code{.(ge|tr|sy)Matrix}, as appropriate.
\item Many more validity methods implemented in C, for efficiency,
including methods for \code{Matrix}, \code{compMatrix},
\code{diagonalMatrix}, \code{indMatrix}, \code{pMatrix},
\code{corMatrix}, \code{[liz]Matrix}, and \code{ndenseMatrix}.
\item \code{band(x, k1, k2)} is optimized further for both dense
and sparse \code{x}, returning \code{triangularMatrix},
\code{symmetricMatrix}, and \code{packedMatrix} in more cases.
\item \code{band()} is now implemented also for
\code{diagonalMatrix} (only \code{tri[ul]()} worked before).
\item Coercions \code{.ge<->.g[CRT]}, \code{.t[rp]<->.t[CRT]},
\code{.s[yp]<->.s[CRT]}, and \code{..[CRT]<->matrix} are now fully
implemented and optimized, with minimal intermediate allocations.
These (and others) no longer rely on CHOLMOD, which had handled
integer types as double and required preprocessing in many cases
(with \code{diagU2N()}, etc.).
\item Fixes in group methods (e.g., \code{>}, \code{&}, \code{|}),
notably for matrices inheriting from class \code{symmetricMatrix},
\code{triangularMatrix}, \code{lMatrix}, or \code{nMatrix}.
\item \code{as.vector}, \code{as.numeric}, and \code{as.logical}
are now implemented for all \code{Matrix}.
\item Subassignment to \code{indMatrix} is no longer prohibited,
now going via \code{TsparseMatrix}.
\item \code{indMatrix} gains methods for \code{isTriangular},
\code{isDiagonal}, \code{diag}, \code{diag<-}, \code{band},
\code{tri[ul]}, and \code{forceSymmetric}. It also gains
coercions to more virtual classes (notably \code{denseMatrix}) and
a coercion to \code{pMatrix}.
\item \code{solve(<ddenseMatrix>, <numLike>)} now works in all
cases.
\item \code{determinant(<ds[yp]Matrix>)} is now much faster in the
positive definite case, no longer going via \code{dgeMatrix}.
\item \code{diag(<[CRT]sparseMatrix>)} is now done in \proglang{C}
and is highly optimized in the \code{.[ts][CR]Matrix} case.
\item \code{symmpart} and \code{skewpart} are now done in
\proglang{C} for all \code{denseMatrix} and all
\code{[CRT]sparseMatrix}. Both now more faithfully preserve the
\dQuote{storage} of their argument. (Previously,
\code{symmpart(<packedMatrix>)} was an \code{unpackedMatrix}, and
\code{(symm|skew)part(<[RT]sparseMatrix>)} was a
\code{CsparseMatrix}.)
\item \code{as(<vector|matrix>,
"([dln]?dense|[dlnCRT]?sparse)Matrix")} are now fully and more
consistently implemented. In the vector case, the result is now
always a \code{length}-by-1 \code{generalMatrix}. In the matrix
case, structure is now always examined, hence the result is a
\code{symmetricMatrix} or \code{triangularMatrix} in more cases.
\item \code{Matrix(<classed matrix>)} now works for classes
other than \code{table}.
\item \code{lu(<dt[rpCRT]Matrix>)} and \code{lu(<ddiMatrix>)} now
behave more consistently. In the diagonal, upper triangular, and
unit lower triangular cases, the result is obtained
\dQuote{directly}, i.e., without pivoting. In the non-unit lower
triangular case, it is obtained with pivoting. (Previously,
pivoting was never done for \code{dtCMatrix} and always done for
\code{dt[rpRT]Matrix} and \code{ddiMatrix}.)
\item \code{lu(x)} now caches its return value also for all
\code{ds.Matrix} \code{x} (by default).
\item \code{readMM()} now warns if the number of entries found is
less than number reported in the header.
\item \code{x[i]} now works for \code{nMatrix} \code{i}, just as
for \code{lMatrix} \code{i}. This supports constructions such as
\code{x[is.na(x)]}, where the logical operation produces an
\code{nMatrix} because it is never \code{NA}.
}
}
\subsection{Misc}{
\itemize{
\item \code{AZERO()} and friends gain an argument specifying a
zero constant (0 for \code{int} arrays, 0.0 for \code{double}
arrays).
\item C-level utilities \code{(R_)?[gs]et_factors()} have been
renamed \code{(R_)?[gs]et_factor()}, as they only ever get and set
\emph{one} factor.
\item The signature of \code{set_factor()} has been changed to
match other \code{set*()} functions: to \code{(object,name,value)}
from \code{(object,value,name)}.
\item For clarity, \code{set_factor()} now returns \code{void} and
is used like other \code{set*()} functions (i.e., for its side
effect). The \R{} interface is unchanged: \code{R_set_factor()}
continues to return the value being set.
\item C-level utilities
\code{make_[di]_matrix_(triangular|symmetric)()},
\code{packed_to_full_(double|int)()},
\code{full_to_packed_(double|int)()}, and
\code{install_diagonal(_int)?()} are replaced by safer, more
consistently named ones. Previous versions allowed integer
overflow.
\item C-level utilities \code{dup_mMatrix_as_d?geMatrix()} are
replaced by the more general \code{dense_as_general()}, which
takes arguments controlling memory allocation and the
\dQuote{kind} of the \code{.geMatrix} result.
\item New C-level utility \code{DimNames_is_symmetric()} with \R{}
interface \code{isSymmetricDN()}, which should be used
consistently to test for symmetry of \code{[dD]imnames}. Note
that these are intended to behave consistently with
\code{symmetricMatrix_validate()}, by allowing, e.g.,
\code{list(NULL, nms)}, but not, e.g.,
\code{list(A = NULL, B = nms)}.
\item Coercions to \code{triangularMatrix} and
\code{symmetricMatrix} are now almost all inherited from
\code{Matrix}, whose methods simply call \code{tri[ul]()} and
\code{forceSymmetric()} if \code{isTriangular()} and
\code{isSymmetric()}, respectively, return \code{TRUE}.
\item Many of the exported \code{.*2*} utilities have been
redefined as aliases or wrappers of new, more general functions
(see below). These not-yet-deprecated functions have been
centralized in \file{R/denseMatrix.R} and \file{R/sparseMatrix.R}.
\item New C-level utilities
\code{R_(dense|sparse)_as_kind()}
for coercion from one \dQuote{kind} to another;
\code{R_(dense|sparse)_as_general()}
for coercion from triangular and symmetric to general;
\code{R_(dense|sparse)_band()}
for coercion to triangular (and other banded);
\code{R_(unpacked*|packed*|sparse)_force_symmetric()}
for coercion to symmetric;
\code{R_(dense|sparse)_as_(sparse|dense)()}
for coercion between dense and sparse of the same \dQuote{kind}
and \dQuote{structure};
\code{R_diagonal_as_sparse()}
for coercion from \code{diagonalMatrix} to any
\code{[CRT]sparseMatrix};
\code{R_(dense|sparse|geMatrix)_as_(matrix|vector)()}
for coercion to base matrix and vector; and
\code{tCRsparse_as_RCsparse()} for the idioms
\code{as(t(<[CR]sparseMatrix>), "[RC]sparseMatrix")}.
These all have not-yet-exported \R{} wrappers.
\item \code{indTri()} and \code{indDiag()} now in C, with a new
argument \code{packed} for efficiently indexing
\code{packedMatrix}. \code{indDiag()} now behaves sensibly in the
\code{n = 0} case.
\item \code{.M.kind()}, \code{.M.shape()}, and (new)
\code{.M.repr()} are now done in \proglang{C} via
\code{R_check_class_etc()}, requiring a class definition only in
\dQuote{rare} cases.
}
}
}
\section{Changes in version 1.4-1 (2022-03-21, svn r3446)}{
\subsection{Installation}{
\itemize{
\item Some warnings surfaced by \option{-Wconversion} are
squashed.
}
}
\subsection{Compatibility}{
\itemize{
\item \code{tryInvokeRestart} is defined for \R{} \eqn{<} 4.0.0.
Thanks to Michael Chirico for the report.
}
}
\subsection{SuiteSparse}{
\itemize{
\item The patch for header
\file{SuiteSparse_config/SuiteSparse_config.h}
is improved for Windows.
}
}
\subsection{Classes}{
\itemize{
\item New virtual class \code{packedMatrix} representing dense
matrices in packed format. It extends \code{denseMatrix} and is
extended by \code{[nld](sp|tp)Matrix}.
}
}
\subsection{Memory}{
\itemize{
\item Protection stack imbalances detected by \command{rchk} are
fixed.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{diag(x)} methods now mostly also keep \code{names}
from \code{dimnames(x)} by default and obey \code{names=*} more
generally.
}
}
\subsection{New Features}{
\itemize{
\item Methods for subscripting \code{packedMatrix}, including
\code{diag()}, notably keeping names by default and for \code{t()}
which are memory efficient, i.e., do not work via unpacking,
thanks to Mikael Jagan.
\item New \code{dmperm()} implementing a Dulmage-Mendelsohn
decomposition, thanks to the persistency of Mauricio Vargas
(@uc.cl).
\item Export more low-level conversion utilities: \code{.n2dgT},
\code{.m2ngCn}, \code{.m2ngTn}.
\item Provide some matrix multiplication methods for
\code{RsparseMatrix}.
}
}
\subsection{Misc}{
\itemize{
\item Our \proglang{C} sources now use \code{R_Calloc()},
\code{R_Free()} etc, instead of the shorter versions without
'R_'. Consequently, we get closer to \code{STRICT_R_HEADERS}.
Also, include \code{<float.h>} for \code{DBL_EPSILON}.
\item Modified \code{AZERO()} to work with \code{R_xlen_t} and new
\code{AZEROs()} for \code{size_t}.
}
}
}
\section{Changes in version 1.4-0 (2021-12-08, svn r3419)}{
\subsection{Compatibility}{
\itemize{
\item \file{inst/test-tools-1.R}: \code{Sys.memGB} returns
\code{NA.value = 2.10201} on Windows, no longer calling
\code{memory.limit} which is a stub since \R{} version 4.2.0.
}
}
\subsection{Memory}{
\itemize{
\item Several low level functions are adjusted to avoid integer
overflow in \code{i+j*m} or similar. Reported by Dario Strbenac
on the R-devel mailing list (\dQuote{dgTMatrix Segmentation
Fault}, June 10, 2021).
\item Leak in \code{as(<dtCMatrix>, "denseMatrix")} when the
argument is unit triangular is fixed. Thanks to Bill Dunlap for
the report and patch in \PR{18204}.
\item Leak in \code{crossprod(<dsCMatrix>)} is fixed. Thanks to
Bill Dunlap for the report and patch in \PR{18205}.
\item Leaks in \code{solve(<dgCMatrix>, <ddenseMatrix>)} and
\code{lu(<dgCMatrix>)} and when the argument is near-singular (or
when memory is exhausted) are fixed. Thanks to Bill Dunlap for
the report and patch in \PR{18206}.
\item Leaks in \code{[cr]bind2(x, y)} when both arguments are
sparse and exactly one is nonzero pattern are fixed. Thanks to
Bill Dunlap for the report and patch in \PR{18210}.
\item \code{solve(<dsCMatrix>, \dots)} restarts after catching
warnings signaled from \code{dsCMatrix_*_solve} so that memory is
freed rather than leaked. Thanks to Bill Dunlap for the report
and patch in \PR{18214}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{sparse.model.matrix(.., contrasts.arg = <.. ddiMatrix
..>)} now works correctly, fixing \MPR{6673} by Davor Josipovic.
\item \code{sparse.model.matrix(..)} now also works in cases the
contrast matrix has become a \code{denseMatrix}; e.g., in a case
using \code{poly(.)} in the formula; now works correctly, fixing
\MPR{6657} and useful suggestions by Nick Hanewinckel.
\item Fixed the internal \code{attr.all_Mat()} auxiliary for
\code{all.equal()}, notably for the case when exactly one of the
matrices is a base \code{matrix}.
\item Fixed long-standing bug in the \code{rbind2()} method for
logical dense matrices, specifically \code{lgeMatrix}, thanks to
the notice by Aaron Lun.
\item \code{band(M, k1, k2)} now also works when \code{k1 * k2} is
larger than 2^31-1, the maximal integer, fixing \MPR{6743} by
Ariel Paulson. Further, it works when \code{M} is a sparse
\code{symmetricMatrix} but the band is not symmetric,
\code{k1 != -k2}.
\item \code{sparseVector(i=integer(), length=2^33)} now does
show/print, after fixing a bug in the \code{head()} method for
\emph{empty} sparseVectors. Reported by David Cortes as
\MPR{6745}.
\item \code{ss <- <sparseVector>[i]} gave an invalid sparseVector
\code{ss} as \code{ss@i} was not necessarily sorted; thanks to a
report by Quran Wu.
\item \code{as(<dsyMatrix>, "generalMatrix")} and similar,
sometimes did \emph{not} use (C-level) \code{symmetric_Dimnames()}
etc; report (to \R{}'s \PR{18250} by Mikael Jagan); fixed all on C
level. As a consequence, you will now see \emph{more} preserved
dimnames after matrix transformations or operations which involved
symmetric matrices.
\item \code{as(<ddiMatrix>, "matrix")} no longer loses dimnames,
thanks to Mikael Jagan's report as \MPR{6751}.
}
}
\subsection{Misc}{
\itemize{
\item No longer include \file{Rdefines.h} as it is somewhat
deprecated.
}
}
}
\section{Changes in version 1.3-4 (2021-05-24, svn r3392)}{
\subsection{Compatibility}{
\itemize{
\item Tests are further revised for length mismatch warning in
\code{matrix(data, nrow, ncol)} under \R{} \eqn{\ge}{>=} 4.2.0.
}
}
}
\section{Changes in version 1.3-3 (2021-05-01, svn r3390)}{
\subsection{Installation}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 1.3-3 depends on \R{}
\eqn{\ge}{>=} 3.5, relaxing the dependency on \R{} \eqn{\ge}{>=}
3.6 introduced in \pkg{Matrix} version 1.3-0.
}
}
\subsection{Compatibility}{
\itemize{
\item Tests are revised for length mismatch warning in
\code{matrix(data, nrow, ncol)} under \R{} \eqn{\ge}{>=} 4.2.0.
}
}
\subsection{C-Level API}{
\itemize{
\item \file{inst/include/cholmod.h} and
\file{inst/include/Matrix_stubs.c} needed adjustment after the
SparseSuite update in \pkg{Matrix} version 1.3-0. \MPR{6714}
reported by Kasper Kristensen, who maintains \CRANpkg{TMB}.
}
}
\subsection{Deprecated and Defunct}{
\itemize{
\item \code{cBind()} and \code{rBind()} are now defunct: simply
use \code{cbind()} and \code{rbind()} instead.
}
}
\subsection{Classes}{
\itemize{
\item Class unions \code{Mnumeric} and \code{numericVectors} are
removed. These were unexported and unused but nonetheless
visible to users, appearing as superclasses of many basic classes.
Notably, a proposed change to the validity method for
\code{Mnumeric} would have broken class \code{factor}, which
extended \code{Mnumeric} but would not have been valid under the
proposal.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Fixed a thinko (in 1.3-2): Now direct coercion from
\code{ddiMatrix} to \code{dgCMatrix}, and hence, e.g.,
\code{as(Matrix(1, sparse=TRUE), "dgCMatrix") now works.}
\item Fixed error message in <dtrMatrix> multiplication.
\item Fixed long-standing bug in \code{R[,j] <- v} when \code{R}
is an \code{RsparseMatrix}, \MPR{6709} by David Cortes.
\item \code{as.matrix()} and \code{as.array()} now work for
\code{sparseVector} as expected; see \MPR{6708}.
\item \code{M[,]} (and similar) now work as in base \R{};
\MPR{6720} by David Cortes.
\item \code{-S} now works also when \code{S} has no \code{factors}
slot. It signalled an error, e.g., for sparse triangular matrices
\code{S}; \MPR{6656}, reported by Chun Fung (Jackson) Kwok.
\item \code{M*2} and similar no longer keep cached factorizations
(in `factors` slot), but drop them via internal new
\code{.empty.factors()}. \MPR{6606}, reported by Thomas Lumley.
\item removed a few duplicated \code{.alias{.}} from
\file{man/*.Rd}.
}
}
\subsection{Misc}{
\itemize{
\item translation updates (of outlines only); finally added
Italian (by Daniele Medri) to svn; updated French (by Philippe
Grosjean), forgotten (\R{} part of) Korean. New Lithuanian
translations by Gabriele Stupuriene & Rimantas Zakauskas.
\item In internal \code{diagOdiag()} method, no longer use
\code{matrix(x, n,n)} when \code{x} is longer than n*n.
\item Eliminating the need for \file{ftp://*}, add the very small
\code{jgl009} MatrixMarket example to our \file{external/} files.
}
}
}
\section{Changes in version 1.3-2 (2021-01-05, svn r3362)}{
\subsection{Installation}{
\itemize{
\item \code{USE_FC_LEN_T} is defined before \file{Rconfig.h} is
included. Under \R{} \eqn{\ge}{>=} 3.6.2, the effect is that
\code{FC_LEN_T} is defined when \file{R_ext/BLAS.h} is included,
and the result is that \file{R_ext/BLAS.h} defines \code{FCONE}
as a nonempty value suitable for passing character lengths from
\proglang{C} to Fortran.
}
}
\subsection{Memory}{
\itemize{
\item \code{matrix_trf} protects two more objects from garbage
collection, squashing two \command{rchk} warnings.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{rankMatrix()} tweaks for the singular values based
methods, notably \code{method = "maybeGrad"}.
\item \code{as(new("dtCMatrix", diag="U"), "matrix")} now works,
as C-level \code{diagU2N()} now also works for 0-dimensional
triangular matrices; this also fixes a subsetting
(\dQuote{indexing}) bug of such 0-dimensional matrices, thanks to
a report by Aaron Lun.
\item logical subsetting of 0-dim. (diagonal/triangular) matrices
fixes.
\item \code{chol(<diagonal dt[CRT]Matrix>)} now works.
}
}
}
\section{Changes in version 1.3-1 (2020-12-23, svn r3352)}{
\subsection{Bug Fixes}{
\itemize{
\item \code{rankMatrix(<dense>, method="qr.R")} no longer assumes
non-negative diagonal entries of the \eqn{R} matrix.
}
}
}
\section{Changes in version 1.3-0 (2020-12-15, svn r3351)}{
\subsection{Installation}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 1.3-0 depends on \R{}
\eqn{\ge}{>=} 3.6.
\item Macro \code{FCONE} is defined and used to pass character
lengths from \proglang{C} to Fortran under \R{} \eqn{\ge}{>=}
3.6.2 (without breaking installation under older \R{}). Thanks
to Brian Ripley.
}
}
\subsection{SuiteSparse}{
\itemize{
\item The internal SuiteSparse library sources are updated from
version 4.2.1 to version 5.7.1. The change is visible in
\code{.SuiteSparse_version()}.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item \code{Matrix(*, doDiag=TRUE)} where \code{doDiag=TRUE} has
always been the default is now obeyed also in the sparse case, as
all \code{diagonalMatrix} are also \code{sparseMatrix}.\cr
\cr
\code{Matrix(0, 3,3)} returns a \code{ddiMatrix} instead of a
\code{dsCMatrix} previously. The latter is still returned from
\code{Matrix(0, 3,3, doDiag=FALSE)}, and e.g.,
\code{.symDiagonal(3,pi)}.\cr
\cr
Also a triangular matrix, e.g., \code{dtrMatrix} is detected now
in cases with \code{NA}s.\cr
\cr
This is both a bug fix \emph{and} an API change which breaks code
that assumes \code{Matrix(.)} to return a \code{CsparseMatrix}
in cases where it now returns a \code{diagonalMatrix} (which
does extend \code{sparseMatrix}).
}
}
\subsection{New Features}{
\itemize{
\item Subassignment to \code{diagonalMatrix} now returns sparse
\code{triangularMatrix} more often; also (sparse)
\code{symmetricMatrix}.
\item \code{nearPD()} gets new option: If \code{base.matrix =
TRUE}, the resulting \code{mat} component is a \pkg{base}
\code{matrix}, as often used desired when \code{nearPD()} is used
outside the \pkg{Matrix} package context.
\item Factored out new \code{qr2rankMatrix()} utility from
\code{rankMatrix()}.
\item New \code{BunchKaufman(<matrix>)} method.
\item Added \code{wrld_1deg} sparse matrix example to
\emph{distributed} version of \pkg{Matrix} (no longer excluding it
via \file{.Rbuildignore}).
\item New (simple) \code{mat2triplet()} function to be used
instead of \code{summary(<sparseMatrix>)} in code.
\item Internal \code{.diag2tT()} gains new option \code{drop0 =
TRUE} and hence now by default drops zero diagonal entries.
Consequently, e.g., \code{as(<diagonalMatrix>, "CsparseMatrix")}
now drops such zeros, too.
\item \code{sparseMatrix()} gets new argument \code{repr = "C"},
superseding the (now deprecated) \code{giveCsparse = TRUE}.
Allows to return \code{RsparseMatrix}.
Similarly, \code{rsparsematrix()}, \code{fac2sparse()} and
\code{fac2Sparse()} get the new \code{repr} argument and their
\code{giveCsparse} is deprecated, sometimes only informally for
now.% no deprecation warning yet
\item \code{sparse.model.matrix()} gets option \code{sep = ""},
with, e.g., \code{sep = ":"} allowing to get easier column names;
from \MPR{6581}, by Vitalie Spinu.
}
}
\subsection{Memory}{
\itemize{
\item The second argument in calls to \code{cholmod_factorize_p}
from \code{internal_chm_factor} was a pointer to 1 \code{double}
instead of a \code{double} array of length 2, resulting in buffer
overflow there.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{rankMatrix(<sparse>, method="qr")} now returns
\code{NA} (or \code{NaN}) instead of signalling an error in the
case the sparse \eqn{Q R} decomposition gave \code{NA}s in
\code{diag(R)}.
\item Coercion (\code{as(., .)}) from e.g., \code{lsyMatrix} to
\code{CsparseMatrix} silently made asymmetric dimnames
symmetric, as did the \emph{internal} \code{forceCspSymmetric(*,
dimNames)} which may be called from \code{forceSymmetric()}.
\item \MPR{6659}, reported by Georg Kindermann:
\code{<sparseVector>[i] <- val} bug is fixed.
\item \MPR{6666}, reported by Ezra Tucker:
\code{which(<ldiMatrix>, array.ind=TRUE)} thinko is fixed.
\item For R-devel Dec 4, 2020: adapt all.equal() check of sparse
matrix images (which contain panel functions with environments).
}
}
}
\section{Changes in version 1.2-18 (2019-11-26, svn r3300)}{
\subsection{Compatibility}{
\itemize{
\item \file{inst/test-tools-1.R}: a bug-fixed \code{canCoerce}
is used under \R{} \eqn{<} 3.6.2.
}
}
\subsection{Memory}{
\itemize{
\item \code{ddense_skewpart} protects another object from garbage
collection, squashing a remaining \command{rchk} warning.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{as(m, "dgTMatrix")} does not lose \code{dimnames}
anymore when \code{m} is a (traditional) \code{matrix}.
\item \code{M[logical(0), ]} now has dimension \eqn{0 x k} for
sparse \code{M} as for base matrices.
\item \code{log(M, base)} (the 2-argument version of \code{log()})
wrongly gave the result for \code{base = exp(1)}, i.e., the
1-argument default.
\item \file{test-tools-Matrix.R}: \code{Qidentical()} no longer
assumes \code{class(<matrix>)} to be of length 1.
}
}
}
\section{Changes in version 1.2-17 (2019-03-20, svn r3294)}{
\subsection{Compatibility}{
\itemize{
\item \code{isFALSE} is defined for \R{} \eqn{<} 3.5.0.
}
}
\subsection{Memory}{
\itemize{
\item \proglang{C} functions protect more objects from garbage
collection, squashing several \command{rchk} warnings.
}
}
}
\section{Changes in version 1.2-16 (2019-03-04, svn r3291)}{
\subsection{New Features}{
\itemize{
\item regression tests depending on \code{sample()} now are future
proof reproducible, via \code{RNGversion(.)}.
\item give information about #\{rows\} and #\{columns\} that are
suppressed in print()ing if the matrix is larger than
\code{max.print}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{data(<Matrix-data>)} no longer attaches \pkg{Matrix}
to the search path.
\item \code{Ops} group methods, i.e., \code{Arith},
\code{Compare}, \code{Logic}, now should all work with 0-extent
matrices as well, thanks to bug reports by Aaron Lun, University
of Cambridge.
\item when printing and formatting sparse matrices, see
\code{formatSpMatrix()}, the \code{maxp} option, e.g., from
\code{getOption("max.print")}, is \dQuote{rounded up} to 100, as
very small values are very rarely appropriate.
}
}
}
\section{Changes in version 1.2-15 (2018-08-20, svn r3283)}{
\subsection{New Features}{
\itemize{
\item \code{image()} gets new optional argument
\code{border.color}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{image(Matrix(0, n,m))} now works.
}
}
}
\section{Changes in version 1.2-14 (2018-04-08, svn r3278)}{
\subsection{New Features}{
\itemize{
\item German translation updates.
}
}
\subsection{Memory}{
\itemize{
\item \code{dgCMatrix_cholsol} protects one more object from
garbage collection, squashing an \command{rchk} warning.
}
}
}
\section{Changes in version 1.2-13 (2018-03-25, svn r3275)}{
\subsection{New Features}{
\itemize{
\item Faster \code{as(<matrix>, "sparseMatrix")} and coercion to
\code{dgCMatrix}, \code{ngCMatrix}, etc, via new direct
\proglang{C} \code{matrix_to_Csparse()} which does \emph{not} go
via \code{dgeMatrix}. This also works for large matrices
\code{m}, i.e., when \code{length(m) >= .Machine$integer.max}.
Also provide low-level \R{} functions \code{.m2dgC()},
\code{.m2lgC()}, and \code{.m2ngC()} for these.
}
}
\subsection{Memory}{
\itemize{
\item \proglang{C} functions protect more objects from garbage
collection, to be \dQuote{rather safe than sorry}. Thanks to
Tomas Kalibera's \command{rchk} tools.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{cbind(NULL,<Matrix>)} no longer return \code{NULL};
analogously for \code{rbind()}, \code{rbind2()}, \code{cbind2()},
fixing very long standing typo in the corresponsing
\code{cbind2()} and \code{rbind2()} methods.
\item The deprecation warning (once per session) for
\code{cBind()} and \code{rBind()} finally works (fixing a simple
thinko).
\item \code{cbind()} and \code{rbind()} for largish sparse
matrices no longer gives an error because of integer overflow (in
the default case where \code{sparse} is not been specified hence
is chosen by a \code{nnzero()} based heuristic).
\item \code{.symDiagonal(5, 5:1)} and \code{.trDiagonal(x = 4:1)}
now work as expected.
\item \code{Sp[i]} now is much more efficient for large sparse
matrices \code{Sp}, notably when the result is short.
\item \code{<sparseVector>[ <negative integer> ]} now also gives
the correct answer when the result is \dQuote{empty}, i.e., all
zero or false.
\item large \code{dspMatrix} and \code{dtpMatrix} objects can
now be constructed via \code{new(*, Dim = *, x = *)} also when
\code{length(x)} is larger than 2^31 (as the \proglang{C} internal
validation method no longer suffers from integer overflow).
}
}
}
\section{Changes in version 1.2-12 (2017-11-10, svn r3239)}{
\subsection{New Features}{
\itemize{
\item \code{crossprod(x,y)} and \code{kronecker(x,y)} have become
considerably more efficient for large \code{indMatrix} objects
\code{x, y}, thanks to private nudging by Boris Vaillant.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \MPR{6185}: \code{c < 0} now also works for derived sparse
Matrices (which only \emph{contain} Matrix classes); via improving
hidden \code{MatrixClass()}. Part of such derived matrices only
work in \R{} \eqn{\ge}{>=} 3.5.0.
\item using \code{Authors@R} in \file{../DESCRIPTION} to list all
contributors.
\item \code{solve(-m)} no longer should use a cached Cholesky
factorization (of \code{m}).
}
}
}
\section{Changes in version 1.2-11 (2017-08-10, svn r3225)}{
\subsection{Compatibility}{
\itemize{
\item \code{length(<NULL>) <- value} is avoided as it is
deprecated in \R{} \eqn{\ge}{>=} 3.5.0.
}
}
\subsection{New Features}{
\itemize{
\item S4 method dispatch no longer emits ambiguity notes (by
default) for everybody, apart from the package maintainer. You
can reactivate them by \code{options(Matrix.ambiguityNotes =
TRUE)}
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{rankMatrix(<matrix of all 0>)} now gives zero for all
methods, as it should be.
\item \code{qr.coef(<sparseQR>, y)} now finally has correct (row)
names (from pivot back permutation).
\item \code{.trDiagonal()} utility is now exported.
}
}
}
\section{Changes in version 1.2-10 (2017-04-19, svn r3216)}{
\subsection{Memory}{
\itemize{
\item \proglang{C} functions protect more objects from garbage
collection. Thanks to Tomas Kalibera's \command{rchk} tools.
}
}
}
\section{Changes in version 1.2-9 (2017-03-08, svn r3211)}{
\subsection{New Features}{
\itemize{
\item \code{Ops} between \code{table}, \code{xtabs}, and our
matrices now work.
\item \code{as(matrix(diag(3), 3, dimnames=rep(list(c("A","b","c")),2)), "diagonalMatrix")@x}
is no longer named.
\item \code{norm(x, "2")} now works as well (and equivalently to
\code{base::norm}).
\item \code{sparseVector()} now also works without \code{x}
argument.
\item \code{c.sparseVector()} method for \code{c()} of
sparseVectors (and available as regular function on purpose).
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{as(Diagonal(3), "denseMatrix")} no longer returns a
non-dense \code{ddiMatrix}.
\item \code{S[sel,] <- value} and similar no longer segfault, but
give a \code{"not (yet?) supported"} error for sparse matrices
\code{S} and logical \code{sel} when \code{sel} contains
\code{NA}s.
The same error (instead of a low-level one) is signalled for
\emph{indexing} (with NA-containing logical \code{sel}), i.e.,
\code{S[sel,]}.
%% from in ../TODO : \item \code{S[sel,]}, \code{S[,sel] <- value}
%% and similar now also work for sparse matrices \code{S} and
%% logical \code{sel} when \code{sel} contains \code{NA}s.
\item \code{which(x, arr.ind=TRUE, *)} (when \code{x} is a
\code{lMatrix} or \code{nMatrix}) now works the same as
\code{base::which}, obeying an optional \code{useNames} argument
which defaults to \code{TRUE}. Previously, the resulting
two-column matrix typically had empty \code{dimnames}.
}
}
}
\section{Changes in version 1.2-8 (2017-01-16, svn r3201)}{
\subsection{Compatibility}{
\itemize{
\item Methods for \code{Ops} handle 0-length operands more
consistently, matching changes planned for \R{} version 3.4.0.
}
}
\subsection{SuiteSparse}{
\itemize{
\item \code{SuiteSparse_long} is defined as \code{int64_t} on all
platforms. Hence we now include C99 header \file{inttypes.h}.
\item The internal CSparse library sources are patched to avoid
buffer overflow in \code{cs_usolve} and \code{cs_utsolve} when
\code{U} is singular.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{x[.] <- value} now also works for
\code{sparseVector}, both as \code{x} and as \code{value}.
\item \code{x[FALSE] <- value} now also works for
\code{sparseVector}.
\item \code{rep(x, *)} now works for \code{sparseVector} and
sparse and dense \code{Matrix}-classed matrices \code{x}.
}
}
}
\section{Changes in version 1.2-7.1 (2016-08-29, svn r3187)}{
\subsection{Installation}{
\itemize{
\item \code{_POSIX_C_SOURCE} is defined \emph{conditionally} with
\code{#ifdef __GLIBC__}.
}
}
}
\section{Changes in version 1.2-7 (2016-08-27, svn r3185)}{
\subsection{New Features}{
\itemize{
\item \code{cBind()} and \code{rBind()} have been almost silently
deprecated in \R{} \eqn{\ge}{>=} 3.2.0 and now give a warning,
\dQuote{once per session} only.
\item \code{bandSparse(*, k=k, *)} now returns matrices inheriting
from \code{triangularMatrix} when obvious from the diagonal
indices \code{k}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{KhatriRao(X,Y)} now also works when \code{X} or
\code{Y} is completely zero.
}
}
}
\section{Changes in version 1.2-6 (2016-04-27, svn r3175)}{
\subsection{Bug Fixes}{
\itemize{
\item The 0-dim. Matrix multiplication fix in 1.2-5 did trigger
wrong warnings in other diagonal matrix multiplications.
}
}
}
\section{Changes in version 1.2-5 (2016-04-14, svn r3170)}{
\subsection{New Features}{
\itemize{
\item \code{isSymmetric(m)} now also works for \code{indMatrix}
\code{m}.
\item \code{isSymmetric(m)} is faster for large dense asymmetric
matrices.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Matrix multiplications (\code{A \%*\% B}) now work correctly
when one of the matrices is diagonal and the other has a zero
dimension.
}
}
}
\section{Changes in version 1.2-4 (2016-02-29, svn r3162)}{
\subsection{New Features}{
\itemize{
\item \code{sparseMatrix()} gets new argument \code{triangular}
and a smarter default for \code{dims} when \code{symmetric} or
\code{triangular} is true.
\item \code{as(<sparse>, "denseMatrix")} now works in more cases
when \code{prod(dim(.))} is larger than \eqn{2^{31} - 1}. Hence,
e.g., \code{!S} now works for much larger sparse matrices
\code{S}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item creating very large dense matrices, e.g., by
\code{as(<sparseM.>, "matrix")} would segfault (in case it could
allocate enough storage).
}
}
}
\section{Changes in version 1.2-3 (2015-11-19, svn r3155)}{
\subsection{C-Level API}{
\itemize{
\item \file{inst/include/Matrix.h} tries harder to define
\samp{alloca} correctly for compilers that do not define
\code{__GNUC__}.
}
}
\subsection{New Features}{
\itemize{
\item \code{MatrixClass()} is exported now.
\item More exports of semi-internal functions (for speed, named
\code{.<foo>}, i.e., inofficial API), such as
\code{.solve.dgC.lu()}.
\item more Korean translations
}
}
\subsection{Bug Fixes}{
\itemize{
\item extended \code{n?CMatrix} classes (e.g., from
\code{setClass(., contains="ngCMatrix")}) now can be coerced via
\code{as(.)} to \code{d.CMatrix}.
\item The printing of largish sparse matrices is improved, notably
in the case where columns are suppressed, via new
\code{fitWidth = TRUE} option in \code{printSpMatrix2()}.
%%% FIXME __ EXAMPLES __
\item \code{cbind2()} and \code{rbind2()} no longer fail to
determine \code{sparse} when it is unspecified and hence
\code{NA}, fixing \MPR{6259}.
}
}
}
\section{Changes in version 1.2-2 (2015-07-03, svn r3131)}{
\subsection{Dependencies}{
\itemize{
\item Objects are more systematically imported from \dQuote{base}
packages like \pkg{stats}. It is no longer assumed that those
packages are attached.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Our \code{colSums(x)}, \code{rowMeans(y)}, \dots, methods
now \dQuote{keep names}, i.e., if the result is a numeric vector,
and the matrix \code{x} has column or row names, these become the
\code{names(.)} of the result, fixing \MPR{6018}.
}
}
}
\section{Changes in version 1.2-1 (2015-05-30, svn r3127)}{
\subsection{New Features}{
\itemize{
\item \code{Matrix} now has an \code{initialization()} method
coercing 0-length dimnames components to \code{NULL} and other
non-\code{NULL} dimnames to \code{character}. Before, e.g.,
numeric dimnames components partially worked, even though it has
always been documented that non-\code{NULL} dimnames should be
\code{character}.
\item \code{as.vector(<sparseVector>)} etc, now work, too.
\item \code{lu(<sparseMatrix>)} now keeps \code{dimnames}.
\item better \file{NEWS.Rd} (which pleases Kurt and
\command{tidy};-)
}
}
\subsection{Memory}{
\itemize{
\item Using \code{alloca} to perform large allocations could
overflow the stack, leading in some cases to a segfault. Now
\code{alloca} is used only for small allocations. Thanks to a
report on the R-help mailing list (\dQuote{does segfault mean
(always) a bug?}, May 5, 2015).
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{S[] <- T} and \code{S[] <- spV} now work (in more
cases) for sparse matrices S, T and sparseVector \code{spV}.
\item Optional arguments in \code{image()}, e.g.,
\code{main=<..>)} now also work for \code{lgCMatrix},
\code{nMatrix} etc; thanks to a 4.5 years old report by Mstislav
Elagin.
\item \code{dimnames(A) <- val} now resets the \code{factors} slot
to empty, as the factorizations now keep dimnames more often.
\item \code{crossprod(<matrix>, Diagonal(<n>))} works again (and
these are tested more systematically).
\item Matrix products (\code{\%*\%}, \code{crossprod}, and
\code{tcrossprod}) for \code{dtrMatrix} are correct in all
cases, including keeping dimnames.
\item \code{Matrix(d)} (and other coercions to \code{Matrix})
now correctly keeps \code{dimnames} also when \code{d} is a
traditional \emph{diagonal} matrix.
}
}
}
\section{Changes in version 1.2-0 (2015-04-03, svn r3096)}{
\subsection{Generic Functions}{
\itemize{
\item New generic function \code{\%&\%} for boolean matrix
multiplication: that is, matrix multiplication using boolean
arithmetic.
}
}
\subsection{New Features}{
\itemize{
\item New argument \code{boolArith = NA} in \code{crossprod()} and
\code{tcrossprod()}. \code{boolArith = TRUE} now forces boolean
arithmetic, where \code{boolArith = FALSE} forces numeric one.
Several of these products are more efficient thanks to new C
functionality based on our new \code{chm_transpose_dense()}, and
others based on \code{geMatrix_crossprod},
\code{geMatrix_matrix_mm}, etc.
\item Most dense matrix products, also for non-\code{dgeMatrix},
including \code{l..Matrix} and \code{n..Matrix} ones are now
directly handled by new \code{.Call()}s.
\item \code{dMatrix} (numeric) and \code{lMatrix} (logical)
matrices can now be coerced to \code{nMatrix} (non-zero pattern
or \dQuote{boolean}) even when they contain \code{NA}s, which then
become \code{TRUE}s.
\item More thorough checking of \code{cbind2()} and
\code{rbind2()} methods, notably as they are called from
\code{cbind()} and \code{rbind()} from \R{} \eqn{\ge}{>=} 3.2.0.
\code{rbind2(<dense>, <dense>)} is faster, being based on new C
code.
\item symmetric Matrices (i.e., inheriting from
\code{symmetricMatrix}) are allowed to have \code{dimnames} of
the form \code{list(NULL, <names>)} \emph{and} now print correctly
and get correctly coerced to general matrices.
\item \code{indMatrix} object (\dQuote{index matrices}) no longer
need to be \dQuote{skinny}.
\item \code{rsparseMatrix()} now accepts \code{rand.x = NULL} and
then creates a random \emph{patter\bold{n}} matrix
(\code{nsparseMatrix}).
\item \code{anyDuplicatedT()} and \code{uniqTsparse()} low level
utilities are exported now.
\item Partial Korean translations of messages.
}
}
\subsection{Deprecated and Defunct}{
\itemize{
\item For \R{} \eqn{\ge}{>=} 3.2.0, \code{cBind()} and
\code{rBind()} are deprecated, as they are no longer needed since
\code{cbind()} and \code{rbind()} do work automatically.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Fix some \code{rbind2()} methods.
\item \code{t()} now transposes the dimnames even for symmetric
matrices.
\item \code{diag(M) <- val} did not always recycle \code{val} to
full length, e.g., when \code{M} was a \code{dtrMatrix}.
\item \code{crossprod(<indMatrix>)} was wrong in cases where the
matrix had all-zero columns.
\item Matrix products (\code{\%*\%}, \code{crossprod}, and
\code{tcrossprod}) with one sparse and one dense argument now
return \emph{numeric} (a \code{dMatrix}) when they should, i.e.,
unless the new setting \code{boolArith = TRUE} is applied.
}
}
}
\section{Changes in version 1.1-5 (2015-01-18, svn r3037)}{
\subsection{Compatibility}{
\itemize{
\item Methods for matrix multiplication (\code{\%*\%},
\code{crossprod}, \code{tcrossprod}) are revised to match the
behaviour of \R{} \eqn{\ge}{>=} 3.2.0, which better tolerates
matrix-vector products.
}
}
\subsection{New Features}{
\itemize{
\item More use of \code{anyNA()} (for speedup).
\item \code{isTriangular()} gets new optional argument
\code{upper = NA}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{crossprod()} and \code{tcrossprod()} fixes for several
<diagonal> o <sparse> combinations.
\item \code{rowMeans(<dgeMatrix>, na.rm=TRUE)} was wrong
sometimes.
\item fix and speedup of coercions (\code{as(., .)}) from and to
symmetric or triangular matrices.
\item \code{invPerm()} coercion to integer
\item \code{dimnames( solve(.,.) )} fix [r3036]
\item \code{tril()} and \code{triu()} now return correct
\code{uplo}.
\item \code{names(dimnames(.))} now preserved, e.g. in
\code{symmpart()} or subsetting (\code{A[i,j]}).
}
}
}
\section{Changes in version 1.1-4 (2014-06-14, svn r2994)}{
\subsection{New Features}{
\itemize{
\item new \code{rsparsematrix()} for random sparse Matrices.
\item improved warnings, notably for unused arguments previously
swallowed into \code{...}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{crossprod(<vec>, <dsyMatrix>)} fixed.
\item \code{crossprod()} and \code{kronecker()} fixes for some
<indMatrix> cases.
}
}
}
\section{Changes in version 1.1-3 (2014-03-30, svn r2982)}{
\subsection{New Features}{
\itemize{
\item \code{\%*\%} and \code{crossprod()} now also work with
\code{sparseVector}s.
\item speedup of \code{crossprod(v, <sparseM>)}, thanks to nudge
by Niels Richard Hansen.
\item new help page for all such matrix products
(\file{../man/matrix-products.Rd}).
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{image()} now gets correct \code{ylim} again.
\item More consistent matrix products.
}
}
}
\section{Changes in version 1.1-2-2 (2014-03-04, svn r2966)}{
\subsection{Bug Fixes}{
\itemize{
\item correct adaption to \R{} 3.1.0
\item using \code{tolerance} (and not \sQuote{tol}) in
\code{all.equal()}
}
}
}
\section{Changes in version 1.1-2 (2014-01-28, svn r2962)}{
\subsection{New Features}{
\itemize{
\item export fast power-user coercion utilities \code{.dsy2mat()},
\code{.dxC2mat()}, \code{.T2Cmat()}, \code{..2dge()}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item matrix products now (mostly) work with \code{sparseVector}s;
and correctly in some more cases.
}
}
}
\section{Changes in version 1.1-1.1 (2013-12-30, svn r2957)}{
\subsection{Installation}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 1.1-1.1 depends on \R{}
\eqn{\ge}{>=} 2.15.2 to ease checking.
}
}
\subsection{Compatibility}{
\itemize{
\item \file{inst/test-tools-1.R}: \code{assertCondition} is
defined for \R{} \eqn{<} 3.0.2 and used by \code{assertWarning}
there.
}
}
}
\section{Changes in version 1.1-1 (2013-12-28, svn r2933)}{
\subsection{New Features}{
\itemize{
\item \code{image(.., xlim, ylim)}: nicer defaults for the axis
limits, and \code{ylim} is sorted decreasingly; not strictly
back-compatible but should never harm.
%% ../R/dgTMatrix.R
\item \code{rankMatrix(*, method="qr")} now using \code{tol}
\item \code{T2graph()} and \code{graph2T()} export old
functionality explicitly. Tweaks in conversions between
\code{graph} and \code{sparseMatrix} objects. Notably,
\code{as(<graph>, <Matrix>)} now more often returns a (0/1
pattern) n..Matrix.
\item \code{sparseMatrix()}: new \code{use.last.ij} argument.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{KhatriRao()}: fix rownames (X <-> Y)
\item \code{qr.coef()}, \code{qr.fitted}, and \code{qr.resid} now
also work with \emph{sparse} RHS \code{y}.
\item sparse matrix \dQuote{sub assignments}, e.g.,
\code{M[ii] <- v}, speedup and fixes.
\item bug fixes also in \code{M[negative indices] <- value} and
\code{<sparseMatrix>[cbind(i,j)]}.
}
}
}
\section{Changes in version 1.1-0 (2013-10-21, svn r2930)}{
\subsection{Dependencies}{
\itemize{
\item \pkg{methods}, \pkg{stats}, \pkg{utils}, and \pkg{lattice}
are moved from \code{Depends} to \code{Imports}.
}
}
\subsection{SuiteSparse}{
\itemize{
\item The internal SuiteSparse library sources are updated to the
latest version. Use new function \code{.SuiteSparse_version} to
get the version in use.
}
}
\subsection{C-Level API}{
\itemize{
\item \file{inst/include/cholmod.h} is updated to reflect changes
in SuiteSparse. Notably, there were changes in the layout of the
various \code{cholmod_*_struct}.
}
}
\subsection{New Features}{
\itemize{
\item \code{fac2sparse} and \code{fac2Sparse} now exported, with a
new \code{giveCsparse} option.
}
}
\subsection{Bug Fixes}{
\itemize{
\item fixed long lasting undetected \code{solve(<dsCMatrix>, *)}
bug.
\item Our \code{all.equal()} methods no longer sometimes return
\code{c("TRUE", "....difference..")}.
\item \code{rankMatrix(<matrix>)}: fix the internal \code{x.dense}
definition.
}
}
}
\section{Changes in version 1.0-14 (2013-09-12, svn r2907)}{
\subsection{Bug Fixes}{
\itemize{
\item Revert some wrong changes to \code{solve(<sparse>, *)} from
1.0-13 (\dQuote{stop gap fix} for \R{} 3.0.2).
}
}
}
\section{Changes in version 1.0-13 (2013-09-10, svn r2904)}{
\subsection{Classes}{
\itemize{
\item New nonvirtual class \code{indMatrix} representing row index
matrices, i.e., matrices whose rows are standard unit vectors. It
extends \code{sparseMatrix} and is extended by \code{pMatrix}, the
class of permutation matrices.
}
}
\subsection{Generic Functions}{
\itemize{
\item New generic functions \code{isTriangular} and
\code{isDiagonal} for testing if the argument is (upper or lower)
triangular or diagonal. These were defined previously but never
exported or documented.
}
}
\subsection{New Features}{
\itemize{
\item Many methods for \code{pMatrix} are generalized to support
\code{indMatrix}. All (initial) functionality was contributed by
Fabian Scheibl, Univ.\sspace{} Munich.
\item New (efficient) \code{KhatriRao()} function by Michael
Cysouw
\item \code{rankMatrix(M, method="qr")} no longer needs
\code{sval} which makes it considerably more useful for large
sparse \code{M}.
\item Start providing \code{anyNA} methods for \R{} \eqn{\ge}{>=}
3.1.0.
\item \code{solve(<sparse> a, <sparse> b)}: if \code{a} is
symmetric, now compute \emph{sparse} result.
\item \code{nearPD()} gets new option \code{conv.norm.type = "I"}.
\item \code{determinant(<dpoMatrix>)} now uses \code{chol()}, and
hence also an existing (\sQuote{cached}) Cholesky factor.
\item 3 new \code{C -> R} utilities (including hidden \R{}
function \code{.set.factors()} for caching also from \R{}, not
just in C).
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{M[] <- v} for unitriangular \code{M} now correct.
\item \code{lu(.)} no longer sometimes returns unsorted columns.
}
}
}
%% TODO: fill in from here <<<<<<<<<<<<<<<<<<<
%% ---- using ../ChangeLog and notably my ../svn-log-from.all
\section{Changes in version 1.0-12 (2013-03-26, svn r2872)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-11 (2013-02-02)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{as(<csr>, "dgCMatrix")} (from package
\CRANpkg{SparseM}) now works again.
\item .
}
}
}
\section{Changes in version 1.0-10 (2012-10-22)}{
\subsection{New Features}{
\itemize{
\item \code{.sparseDiagonal()}: new \code{unitri} argument, and
more flexibility;
\item new \code{solve(<dsCMatrix>, <missing>)} via efficient C
code.
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-9 (2012-09-05)}{
\subsection{New Features}{
\itemize{
\item new \code{sparseVector()} constructor function.
\item \code{is.finite()} \code{is.infinite()} now work for our
matrices and \code{sparseVector} objects.
\item \code{diag(.) <- V} now preserves symmetricity,
triangularity and even uni-triangularity sometimes.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Quite a few fixes for \code{Ops} (arithmetic, logic, etc)
group methods.
\item Ditto for \code{diagonalMatrix} methods.
}
}
}
\section{Changes in version 1.0-6 (2012-03-16)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-5 (2012-03-15)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-4 (2012-02-21)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-3 (2012-01-13)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-2 (2011-11-19)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-1 (2011-10-18)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 1.0-0 (2011-10-04)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 0.9996875-3 (2011-08-13)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 0.9996875-2 (2011-08-09)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 0.9996875-1 (2011-08-08)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 0.999375-50 (2011-04-08)}{
\subsection{New Features}{
\itemize{
\item .
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
%% ---------------- Start of DB+MM history -----------------------------
\section{Changes in version 0.95-1 (2005-02-18, svn r561)}{
\subsection{Authorship}{
\itemize{
\item During Douglas Bates' sabbatical in Zurich, Martin Maechler
becomes co-author of \pkg{Matrix}.
}
}
\subsection{New Features}{
\itemize{
\item Beginning of class reorganization with a more systematic
naming scheme.
}
}
\subsection{Bug Fixes}{
\itemize{
\item More (correct) coercions \code{as(<from>, <to>)}.
}
}
}
\section{Changes in version 0.9-1 (2005-01-24, svn r451)}{
\subsection{New Features}{
\itemize{
\item lme4 / lmer specific \R{} code moved out to \CRANpkg{lme4}
package.
}
}
\subsection{Bug Fixes}{
\itemize{
\item .
}
}
}
\section{Changes in version 0.8-2 (2004-04-05, svn r51)}{
\subsection{Description}{
\itemize{
\item \pkg{Matrix} version 0.8-2 is a full refactor. Classes,
generic functions, and methods are newly implemented in S4.
S3 machinery is removed. The remaining items in this section
describe the state of things in version 0.8-2 rather than changes
since version 0.3-26.
\item \pkg{Matrix} \eqn{\ge}{>=} 0.8-2 depends on \R{}
\eqn{\ge}{>=} 1.9.0.
\item \code{Depends: methods} is added to \file{DESCRIPTION}.
\item Douglas Bates becomes the sole author of \pkg{Matrix}.
\item The package is retitled \dQuote{Classes and Methods for
Numerical Linear Algebra using LAPACK, LDL, TAUCS, METIS, and
UMFPACK}.
\item The package sources are now maintained in a Subversion
repository.
}
}
}
%% ---------------- Start of S4 history --------------------------------
\section{Changes in version 0.3-26 (2003-11-03)}{
\subsection{Bug Fixes}{
\itemize{
\item The default expressions of formal arguments \code{transpose}
and \code{left} of generic function \code{facmul} are changed from
\code{F} and \code{T} to \code{FALSE} and \code{TRUE}, as only the
latter are reserved words.
}
}
}
\section{Changes in version 0.3-25 (2003-10-30)}{
\subsection{Deprecated and Defunct}{
\itemize{
\item S3 generic function \code{determinant} is removed as it was
ported to \R{} \eqn{\ge}{>=} 1.8.0.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item A namespace for \pkg{Matrix} is defined using directives in
\file{NAMESPACE}.
\item S3 generic functions \code{eigen}, \code{expand},
\code{facmul}, \code{lu}, \code{norm}, \code{rcond}, \code{schur},
and \code{unpack} are exported.
\item S3 methods are registered and not exported, hence they
continue to be available but only through calls to exported S3
generic functions.
\item Functions \code{Matrix}, \code{SVD}, \code{as.Matrix},
\code{diagDet}, and \code{hilbert} are exported.
\item Functions \code{Matrix.class}, \code{*.test}, and
\code{is.*} are exported but intended only for internal use.
\item Functions \code{asObject} and \code{prependClass} are not
exported.
\item Load hook \code{.First.lib} is removed and replaced by a
\code{useDynLib} directive in \file{NAMESPACE}.
}
}
}
\section{Changes in version 0.3-24 (2003-04-20)}{
\subsection{Significant User-Visible Changes}{
\itemize{
\item S3 generic function \code{det} is renamed
\code{determinant}.
}
}
\subsection{Methods}{
\itemize{
\item \code{determinant.Matrix} (formerly \code{det.Matrix})
computes the \eqn{LU} factorization of its argument instead of the
\eqn{QR} factorization.
}
}
}
\section{Changes in version 0.3-23 (2003-03-30)}{
\subsection{Description}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 0.3-23 depends on \R{}
\eqn{\ge}{>=} 1.7.0.
}
}
\subsection{Installation}{
\itemize{
\item \file{configure}, \file{configure.in}, \file{configure.win},
\file{cleanup}, \file{src/Makevars.in}, and
\file{src/Makevars.win} are removed and replaced by a simple
\file{src/Makevars} arranging for \pkg{Matrix} to use \R{}'s
\code{LAPACK_LIBS} and \code{BLAS_LIBS}. The simplification is
made possible by \R{} version 1.7-0, which is configured by
default to build, link against, and install a shared LAPACK.
}
}
}
\section{Changes in version 0.3-22 (2003-02-03)}{
\subsection{Bug Fixes}{
\itemize{
\item Empty directory \file{data} is removed.
}
}
}
\section{Changes in version 0.3-21 (2002-10-25)}{
\subsection{Description}{
\itemize{
\item The package is retitled \dQuote{Classes and Methods for
Numerical Linear Algebra using LAPACK}.
}
}
\subsection{Installation}{
\itemize{
\item \file{configure.win} and \file{src/Makevars.win} are added
to support installation under Windows, thanks to Brian Ripley.
\item More \code{#undef} in the \proglang{C++} sources to support
installation under Windows, thanks to Brian Ripley.
}
}
}
\section{Changes in version 0.3-20 (2002-10-08)}{
\subsection{Installation}{
\itemize{
\item \file{configure.ac} sets \code{CFLAGS} before expanding
\code{AC_PROG_CC} and sets \code{FLIBS} before expanding
\code{ACX_BLAS} and \code{ACX_LAPACK}.
\item Autoconf macro \code{OCTAVE_BLAS_LIBS}, which is no longer
used, is removed from \file{aclocal.m4}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Unwanted Autoconf output is removed from \file{aclocal.m4}.
}
}
}
\section{Changes in version 0.3-19 (2002-07-22)}{
\subsection{Bug Fixes}{
\itemize{
\item \code{PACKAGE = "Matrix"} is passed to \code{.Call} to
restrict name lookup to \pkg{Matrix}.
\item The \proglang{C++} sources use qualified name lookup (as in
\code{std::<name>}) in more places.
\item The \proglang{C++} sources get pointers to matrix data
without taking the address of the first element, which is wrong for
a matrix of length 0.
}
}
}
\section{Changes in version 0.3-18 (2002-05-03)}{
\subsection{Compatibility}{
\itemize{
\item \code{*_ELT} macros are no longer defined for \R{} \eqn{<}
1.2.0 as \pkg{Matrix} depends on \R{} \eqn{\ge}{>=} 1.5.0.
}
}
}
\section{Changes in version 0.3-17 (2002-04-30)}{
\subsection{Description}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 0.3-17 depends on \R{}
\eqn{\ge}{>=} 1.5.0.
}
}
\subsection{Installation}{
\itemize{
\item \file{configure.in} is replaced by \file{configure.ac}
contributed by Kurt Hornik. \file{configure.ac} makes use of
\command{R CMD config}, a utility added in \R{} version 1.5-0.
\item Autoconf macros \code{ACX_BLAS} and \code{ACX_LAPACK},
written by Steven G. Johnson, are added to \file{aclocal.m4} and
expanded in \file{configure.ac}.
\item The configured value of \code{LAPACK_LIBS} is prepended to
\code{PKG_LIBS} in \file{src/Makevars.in}.
}
}
}
\section{Changes in version 0.3-16 (2001-12-10)}{
\subsection{Documentation}{
\itemize{
\item A preliminary \file{ChangeLog}.
}
}
\subsection{Compatibility}{
\itemize{
\item Rd files are adapted to use \code{\\method{}{}} markup
introduced in \R{} version 1.2.2.
\item One usage of \code{.Alias}, deprecated in \R{} version
1.4.1, is removed.
}
}
\subsection{Bug Fixes}{
\itemize{
\item S3 methods gain formal argument \code{\dots} where needed to
match the generic function.
\item The name of a class member function in \file{src/tgmd.h} was
was spuriously qualified.
}
}
}
\section{Changes in version 0.3-15 (2001-05-15)}{
\subsection{Installation}{
\itemize{
\item The configured value of \code{BLAS_LIBS} is prepended to
\code{PKG_LIBS} in \file{src/Makevars.in}.
}
}
}
\section{Changes in version 0.3-13 (2001-05-10)}{
\subsection{Installation}{
\itemize{
\item The \proglang{C++} sources undefine macros \code{length} and
\code{append} in many places to allow for class member functions
with those names.
}
}
}
\section{Changes in version 0.3-10 (2001-05-04)}{
\subsection{Bug Fixes}{
\itemize{
\item The \proglang{C++} sources use qualified name lookup (as in
\code{std::<name>}) in more places.
}
}
}
\section{Changes in version 0.3-9 (2001-03-09)}{
\subsection{Bug Fixes}{
\itemize{
\item The \proglang{C++} sources no longer write to \code{stderr}
and (in most places) \code{stdout}, no longer use the
\code{assert} macro, and no longer call \code{exit}.
}
}
}
\section{Changes in version 0.3-8 (2001-01-10)}{
\subsection{Description}{
\itemize{
\item \file{DESCRIPTION} gets a \code{Maintainer} field and
Douglas Bates is named there.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Removes around 100 non-source files wrongly bundled in
\pkg{Matrix} version 0.3-7.
}
}
}
\section{Changes in version 0.3-7 (2000-12-03)}{
\subsection{Installation}{
\itemize{
\item \code{FLIBS} is appended to \code{PKG_LIBS} in
\file{src/Makevars.in}.
}
}
\subsection{Documentation}{
\itemize{
\item A basic \file{README}.
}
}
}
\section{Changes in version 0.3-6 (2000-10-30)}{
\subsection{Description}{
\itemize{
\item \pkg{Matrix} \eqn{\ge}{>=} 0.3-6 depends on \R{}
\eqn{\ge}{>=} 1.1.1.
}
}
\subsection{Installation}{
\itemize{
\item \file{configure} makes use of \code{HAVE_F77_UNDERSCORE} in
\file{Rconfig.h}.
\item \code{PKG_LIBS} and \code{PKG_LDFLAGS} to the configured
values of \code{LIBS} and \code{LDFLAGS} in \file{src/Makevars.in}.
}
}
}
\section{Changes in version 0.3-5 (2000-08-20)}{
\subsection{Deprecated and Defunct}{
\itemize{
\item \code{eigen.Matrix} argument \code{schur}, which was unused,
is removed.
}
}
\subsection{Methods}{
\itemize{
\item An S3 method \code{schur.Matrix} interfacing LAPACK routine
\code{dgeesx}. It returns \code{list(values, schur, vectors)}.
\item For arguments not inheriting from \code{Matrix} subclass
\code{Hermitian}, \code{eigen.Matrix} is now an interface to
LAPACK routine \code{dgeevx}, and its optional arguments
\code{balance} and \code{rcond}, which were unused, can now be
used to request balancing and the reciprocal condition numbers of
the eigenvalues and right eigenvectors. The return value is now
\code{list(values, vectors, rcond)} with
\code{vectors = list(left, right)} and
\code{rcond = list(values, vectors)}.
}
}
}
\section{Changes in version 0.3-3 (2000-08-11)}{
\subsection{Installation}{
\itemize{
\item \file{configure} skips the check for BLAS in the Sun
Performance Library if the \proglang{C} compiler is \command{gcc}.
}
}
\subsection{Compatibility}{
\itemize{
\item \code{STRING_ELT}, \code{SET_STRING_ELT}, \code{VECTOR_ELT},
and \code{SET_VECTOR_ELT} are used in place of \code{STRING} and
\code{VECTOR}. \code{*_ELT} macros are defined for \R{} \eqn{<}
1.2.0 to not break compatibility.
}
}
\subsection{Significant User-Visible Changes}{
\itemize{
\item \code{SVD(x, nu = 0, nv)$u} and \code{SVD(x, nu, nv = 0)$vt}
are \code{NULL} rather than empty matrices.
}
}
\subsection{Methods}{
\itemize{
\item An S3 method \code{lu.Matrix} interfacing LAPACK routine
\code{dgetrf}. It returns \code{list(l, u, permutation)}, with
attribute \code{norms = list(one, infinity)} containing the one
and infinity norms. An optional argument is provided to disable
computation of \code{one} and \code{infinity}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{SVD(x, nu, nv)} allocated for the right singular
values a matrix with dimensions \code{c(ncol(x), nv)} instead of
\code{c(nv, ncol(x))}. Buffer overflow could occur in LAPACK
routine \code{dgesvd} if \code{nv < ncol(x)}.
}
}
}
\section{Changes in version 0.3-1 (2000-07-24)}{
\subsection{Generic Functions}{
\itemize{
\item S3 generic function \code{eigen}.
}
}
\subsection{Methods}{
\itemize{
\item An S3 method \code{eigen.Matrix} interfacing LAPACK routines
\code{dgeev} and \code{dsyev}, the latter only for arguments
inheriting from \code{Matrix} subclass \code{Hermitian}. It
returns \code{list(values, vectors)}, where \code{vectors} is
\code{list(left, right)} for non-\code{Hermitian} arguments and a
numeric matrix for \code{Hermitian} arguments. An optional
argument is provided to disable computation of \code{vectors}.
\item S3 methods \code{det.Matrix}, \code{det.UpperTriangular},
\code{det.UnitUpperTriangular}, \code{det.LowerTriangular}, and
\code{det.UnitLowerTriangular} computing the modulus of the
determinant or its logarithm. These return
\code{list(modulus, sign)}. Component \code{modulus} has a
logical attribute \code{logarithm} indicating if the determinant
is \code{sign * exp(modulus)} or \code{sign * modulus}.
\code{det.Matrix} computes the \eqn{QR} factorization of its
argument using LAPACK routine \code{dgeqrf}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item \code{Matrix.class(x)} could be incomplete or contain bad
elements for orthogonal \code{x}.
}
}
\subsection{New Features}{
\itemize{
\item A function \code{as.Matrix} for coercing an object to
class \code{Matrix}, parallel to \code{as.matrix}. The return
value inherits from subclasses of \code{Matrix} if tests for
structure are satisfied.
\item Functions \code{asObject} and \code{prependClass} for
setting and prepending to the \code{class} attribute of the
argument.
\item A function \code{diagDet} for computing the determinant of a
triangular matrix given the diagonal entries.
}
}
}
\section{Changes in version 0.2-4 (2000-07-18)}{
\subsection{Installation}{
\itemize{
\item A \file{configure} script detecting options for linking BLAS
and LAPACK. It is generated from \file{configure.in} which makes
use of an Autoconf macro \code{OCTAVE_BLAS_LIBS} defined in
\file{aclocal.m4}.
\item \file{src/Makevars} is now generated from
\file{src/Makevars.in}.
\item A \file{cleanup} script removing generated files.
}
}
\subsection{Documentation}{
\itemize{
\item A Texinfo manual \file{R-Matrix.texi} containing
implementation details and describing how LAPACK++ was modified
for \pkg{Matrix}.
}
}
\subsection{Methods}{
\itemize{
\item An S3 method \code{rcond.Matrix} interfacing LAPACK routines
\code{d*con}.
}
}
\subsection{Bug Fixes}{
\itemize{
\item Exceptions thrown by LAPACK++ are caught and handled as \R{}
errors.
\item \code{UpperTriangular.test} and \code{LowerTriangular.test}
returned a maximum rather than a maximum modulus for real
arguments.
}
}
}
\section{Changes in version 0.2-1 (2000-07-15)}{
\subsection{Description}{
\itemize{
\item \pkg{Matrix} version 0.2-1 is the first one to be
distributed by CRAN.
\item The package is titled \dQuote{A Matrix Library for \R{}}.
\item Douglas Bates is the maintainer and principal author.
Saikat DebRoy is a co-author.
\item \pkg{Matrix} \eqn{\ge}{>=} 0.2-1 depends on \R{}
\eqn{\ge}{>=} 1.1.0.
}
}
\subsection{Installation}{
\itemize{
\item A modified LAPACK++ (Linear Algebra PACKage in C++, version
1.1a) is compiled alongside the \pkg{Matrix} sources. LAPACK++ is
a \proglang{C++} interface to LAPACK originally developed by
Roldan Pozo.
}
}
\subsection{Classes}{
\itemize{
\item S3 class \code{Matrix} with subclasses \code{Hermitian},
\code{UpperTriangular} (recursively, \code{UnitUpperTriangular}),
and \code{LowerTriangular} (recursively,
\code{UnitLowerTriangular}). Objects are traditional numeric
matrices with a \code{class} attribute indicating their
structural properties. Objects are interfaced in \proglang{C++}
using the parallel class hierarchy defined by LAPACK++.
}
}
\subsection{Generic Functions}{
\itemize{
\item S3 generic functions \code{det}, \code{expand},
\code{facmul}, \code{lu}, \code{norm}, \code{rcond}, \code{schur},
and \code{unpack}.
}
}
\subsection{Methods}{
\itemize{
\item An S3 method \code{norm.Matrix} interfacing LAPACK routines
\code{dlan*}.
\item An S3 method \code{solve.Matrix} interfacing LAPACK routines
\code{d*trf} and \code{d*trs}.
\item An S3 method \code{as.matrix.Matrix} just dropping the class
attribute.
\item An S3 method \code{print.Matrix} just printing the
\code{as.matrix} result.
}
}
\subsection{New Features}{
\itemize{
\item A function \code{Matrix} constructing objects of class
\code{Matrix} from numeric vectors and matrices, parallel to
\pkg{base} function \code{matrix}.
\item A function \code{Matrix.class} returning a character vector
containing the subclasses of \code{Matrix} that would be valid for
the argument.
\item Functions \code{Hermitian.test},
\code{UpperTriangular.test}, \code{LowerTriangular.test},
\code{Orthogonal.test}, and \code{Orthonormal.test} returning a
maximum modulus distance useful for testing the respective
property.
\item Functions \code{is.Hermitian}, \code{is.UpperTriangular},
\code{is.LowerTriangular}, and \code{is.Orthonormal} testing if
the \code{*.test} value does not exceed a tolerance.
\item Function \code{SVD} interfacing LAPACK routine
\code{dgesvd}. \code{SVD(x, nu, nv)} returns
\code{list(d, u, vt)} containing the singular values (sorted
non-increasingly), first \code{nu} left singular vectors (stored
column-wise), and first \code{nv} right singular vectors (stored
row-wise).
\item Function \code{hilbert} constructing the \eqn{n}-by-\eqn{n}
Hilbert matrix.
}
}
}
%% ---------------- Start of CRAN history ------------------------------
|