Mercurial > hg > octave-nkf
comparison src/pr-output.cc @ 10142:829e69ec3110
make OCTAVE_QUIT a function
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 20 Jan 2010 10:38:00 +0100 |
parents | 2cd940306a06 |
children | cd96d29c5efa |
comparison
equal
deleted
inserted
replaced
10141:e409546ac0a8 | 10142:829e69ec3110 |
---|---|
1574 { | 1574 { |
1575 for (octave_idx_type i = 0; i < nr; i++) | 1575 for (octave_idx_type i = 0; i < nr; i++) |
1576 { | 1576 { |
1577 for (octave_idx_type j = 0; j < nc; j++) | 1577 for (octave_idx_type j = 0; j < nc; j++) |
1578 { | 1578 { |
1579 OCTAVE_QUIT; | 1579 octave_quit (); |
1580 | 1580 |
1581 pr_plus_format (os, m(i,j)); | 1581 pr_plus_format (os, m(i,j)); |
1582 } | 1582 } |
1583 | 1583 |
1584 if (i < nr - 1) | 1584 if (i < nr - 1) |
1632 { | 1632 { |
1633 octave_idx_type lim = col + inc < nc ? col + inc : nc; | 1633 octave_idx_type lim = col + inc < nc ? col + inc : nc; |
1634 | 1634 |
1635 for (octave_idx_type j = col; j < lim; j++) | 1635 for (octave_idx_type j = col; j < lim; j++) |
1636 { | 1636 { |
1637 OCTAVE_QUIT; | 1637 octave_quit (); |
1638 | 1638 |
1639 if (i == 0 && j == 0) | 1639 if (i == 0 && j == 0) |
1640 os << "[ "; | 1640 os << "[ "; |
1641 else | 1641 else |
1642 { | 1642 { |
1678 { | 1678 { |
1679 os << std::setw (extra_indent) << ""; | 1679 os << std::setw (extra_indent) << ""; |
1680 | 1680 |
1681 for (octave_idx_type j = col; j < lim; j++) | 1681 for (octave_idx_type j = col; j < lim; j++) |
1682 { | 1682 { |
1683 OCTAVE_QUIT; | 1683 octave_quit (); |
1684 | 1684 |
1685 os << " "; | 1685 os << " "; |
1686 | 1686 |
1687 pr_float (os, m(i,j), fw, scale); | 1687 pr_float (os, m(i,j), fw, scale); |
1688 } | 1688 } |
1708 { | 1708 { |
1709 for (octave_idx_type i = 0; i < nr; i++) | 1709 for (octave_idx_type i = 0; i < nr; i++) |
1710 { | 1710 { |
1711 for (octave_idx_type j = 0; j < nc; j++) | 1711 for (octave_idx_type j = 0; j < nc; j++) |
1712 { | 1712 { |
1713 OCTAVE_QUIT; | 1713 octave_quit (); |
1714 | 1714 |
1715 pr_plus_format (os, m(i,j)); | 1715 pr_plus_format (os, m(i,j)); |
1716 } | 1716 } |
1717 | 1717 |
1718 if (i < nr - 1) | 1718 if (i < nr - 1) |
1766 { | 1766 { |
1767 octave_idx_type lim = col + inc < nc ? col + inc : nc; | 1767 octave_idx_type lim = col + inc < nc ? col + inc : nc; |
1768 | 1768 |
1769 for (octave_idx_type j = col; j < lim; j++) | 1769 for (octave_idx_type j = col; j < lim; j++) |
1770 { | 1770 { |
1771 OCTAVE_QUIT; | 1771 octave_quit (); |
1772 | 1772 |
1773 if (j == 0) | 1773 if (j == 0) |
1774 os << "[ "; | 1774 os << "[ "; |
1775 else | 1775 else |
1776 { | 1776 { |
1817 { | 1817 { |
1818 os << std::setw (extra_indent) << ""; | 1818 os << std::setw (extra_indent) << ""; |
1819 | 1819 |
1820 for (octave_idx_type j = col; j < lim; j++) | 1820 for (octave_idx_type j = col; j < lim; j++) |
1821 { | 1821 { |
1822 OCTAVE_QUIT; | 1822 octave_quit (); |
1823 | 1823 |
1824 os << " "; | 1824 os << " "; |
1825 | 1825 |
1826 if (i == j) | 1826 if (i == j) |
1827 pr_float (os, m(i,j), fw, scale); | 1827 pr_float (os, m(i,j), fw, scale); |
1859 octave_idx_type nr = dims(0); \ | 1859 octave_idx_type nr = dims(0); \ |
1860 octave_idx_type nc = dims(1); \ | 1860 octave_idx_type nc = dims(1); \ |
1861 \ | 1861 \ |
1862 for (octave_idx_type i = 0; i < m; i++) \ | 1862 for (octave_idx_type i = 0; i < m; i++) \ |
1863 { \ | 1863 { \ |
1864 OCTAVE_QUIT; \ | 1864 octave_quit (); \ |
1865 \ | 1865 \ |
1866 std::string nm = "ans"; \ | 1866 std::string nm = "ans"; \ |
1867 \ | 1867 \ |
1868 if (m > 1) \ | 1868 if (m > 1) \ |
1869 { \ | 1869 { \ |
1973 { | 1973 { |
1974 for (octave_idx_type i = 0; i < nr; i++) | 1974 for (octave_idx_type i = 0; i < nr; i++) |
1975 { | 1975 { |
1976 for (octave_idx_type j = 0; j < nc; j++) | 1976 for (octave_idx_type j = 0; j < nc; j++) |
1977 { | 1977 { |
1978 OCTAVE_QUIT; | 1978 octave_quit (); |
1979 | 1979 |
1980 pr_plus_format (os, cm(i,j)); | 1980 pr_plus_format (os, cm(i,j)); |
1981 } | 1981 } |
1982 | 1982 |
1983 if (i < nr - 1) | 1983 if (i < nr - 1) |
2033 { | 2033 { |
2034 octave_idx_type lim = col + inc < nc ? col + inc : nc; | 2034 octave_idx_type lim = col + inc < nc ? col + inc : nc; |
2035 | 2035 |
2036 for (octave_idx_type j = col; j < lim; j++) | 2036 for (octave_idx_type j = col; j < lim; j++) |
2037 { | 2037 { |
2038 OCTAVE_QUIT; | 2038 octave_quit (); |
2039 | 2039 |
2040 if (i == 0 && j == 0) | 2040 if (i == 0 && j == 0) |
2041 os << "[ "; | 2041 os << "[ "; |
2042 else | 2042 else |
2043 { | 2043 { |
2079 { | 2079 { |
2080 os << std::setw (extra_indent) << ""; | 2080 os << std::setw (extra_indent) << ""; |
2081 | 2081 |
2082 for (octave_idx_type j = col; j < lim; j++) | 2082 for (octave_idx_type j = col; j < lim; j++) |
2083 { | 2083 { |
2084 OCTAVE_QUIT; | 2084 octave_quit (); |
2085 | 2085 |
2086 os << " "; | 2086 os << " "; |
2087 | 2087 |
2088 pr_complex (os, cm(i,j), r_fw, i_fw, scale); | 2088 pr_complex (os, cm(i,j), r_fw, i_fw, scale); |
2089 } | 2089 } |
2109 { | 2109 { |
2110 for (octave_idx_type i = 0; i < nr; i++) | 2110 for (octave_idx_type i = 0; i < nr; i++) |
2111 { | 2111 { |
2112 for (octave_idx_type j = 0; j < nc; j++) | 2112 for (octave_idx_type j = 0; j < nc; j++) |
2113 { | 2113 { |
2114 OCTAVE_QUIT; | 2114 octave_quit (); |
2115 | 2115 |
2116 pr_plus_format (os, cm(i,j)); | 2116 pr_plus_format (os, cm(i,j)); |
2117 } | 2117 } |
2118 | 2118 |
2119 if (i < nr - 1) | 2119 if (i < nr - 1) |
2169 { | 2169 { |
2170 octave_idx_type lim = col + inc < nc ? col + inc : nc; | 2170 octave_idx_type lim = col + inc < nc ? col + inc : nc; |
2171 | 2171 |
2172 for (octave_idx_type j = col; j < lim; j++) | 2172 for (octave_idx_type j = col; j < lim; j++) |
2173 { | 2173 { |
2174 OCTAVE_QUIT; | 2174 octave_quit (); |
2175 | 2175 |
2176 if (j == 0) | 2176 if (j == 0) |
2177 os << "[ "; | 2177 os << "[ "; |
2178 else | 2178 else |
2179 { | 2179 { |
2220 { | 2220 { |
2221 os << std::setw (extra_indent) << ""; | 2221 os << std::setw (extra_indent) << ""; |
2222 | 2222 |
2223 for (octave_idx_type j = col; j < lim; j++) | 2223 for (octave_idx_type j = col; j < lim; j++) |
2224 { | 2224 { |
2225 OCTAVE_QUIT; | 2225 octave_quit (); |
2226 | 2226 |
2227 os << " "; | 2227 os << " "; |
2228 | 2228 |
2229 if (i == j) | 2229 if (i == j) |
2230 pr_complex (os, cm(i,j), r_fw, i_fw, scale); | 2230 pr_complex (os, cm(i,j), r_fw, i_fw, scale); |
2253 { | 2253 { |
2254 for (octave_idx_type i = 0; i < nr; i++) | 2254 for (octave_idx_type i = 0; i < nr; i++) |
2255 { | 2255 { |
2256 for (octave_idx_type j = 0; j < nc; j++) | 2256 for (octave_idx_type j = 0; j < nc; j++) |
2257 { | 2257 { |
2258 OCTAVE_QUIT; | 2258 octave_quit (); |
2259 | 2259 |
2260 pr_plus_format (os, m(i,j)); | 2260 pr_plus_format (os, m(i,j)); |
2261 } | 2261 } |
2262 | 2262 |
2263 if (i < nr - 1) | 2263 if (i < nr - 1) |
2313 { | 2313 { |
2314 octave_idx_type lim = col + inc < nc ? col + inc : nc; | 2314 octave_idx_type lim = col + inc < nc ? col + inc : nc; |
2315 | 2315 |
2316 for (octave_idx_type j = col; j < lim; j++) | 2316 for (octave_idx_type j = col; j < lim; j++) |
2317 { | 2317 { |
2318 OCTAVE_QUIT; | 2318 octave_quit (); |
2319 | 2319 |
2320 if (j == 0) | 2320 if (j == 0) |
2321 os << "[ "; | 2321 os << "[ "; |
2322 else | 2322 else |
2323 { | 2323 { |
2355 { | 2355 { |
2356 os << std::setw (extra_indent) << ""; | 2356 os << std::setw (extra_indent) << ""; |
2357 | 2357 |
2358 for (octave_idx_type j = col; j < lim; j++) | 2358 for (octave_idx_type j = col; j < lim; j++) |
2359 { | 2359 { |
2360 OCTAVE_QUIT; | 2360 octave_quit (); |
2361 | 2361 |
2362 os << " "; | 2362 os << " "; |
2363 | 2363 |
2364 os << std::setw (fw) << m(i,j); | 2364 os << std::setw (fw) << m(i,j); |
2365 } | 2365 } |
2464 | 2464 |
2465 if (plus_format && ! pr_as_read_syntax) | 2465 if (plus_format && ! pr_as_read_syntax) |
2466 { | 2466 { |
2467 for (octave_idx_type i = 0; i < num_elem; i++) | 2467 for (octave_idx_type i = 0; i < num_elem; i++) |
2468 { | 2468 { |
2469 OCTAVE_QUIT; | 2469 octave_quit (); |
2470 | 2470 |
2471 double val = base + i * increment; | 2471 double val = base + i * increment; |
2472 | 2472 |
2473 pr_plus_format (os, val); | 2473 pr_plus_format (os, val); |
2474 } | 2474 } |
2537 | 2537 |
2538 os << std::setw (extra_indent) << ""; | 2538 os << std::setw (extra_indent) << ""; |
2539 | 2539 |
2540 for (octave_idx_type i = col; i < lim; i++) | 2540 for (octave_idx_type i = col; i < lim; i++) |
2541 { | 2541 { |
2542 OCTAVE_QUIT; | 2542 octave_quit (); |
2543 | 2543 |
2544 double val = base + i * increment; | 2544 double val = base + i * increment; |
2545 | 2545 |
2546 if (i == num_elem - 1) | 2546 if (i == num_elem - 1) |
2547 { | 2547 { |
2606 | 2606 |
2607 if (nstr != 0) | 2607 if (nstr != 0) |
2608 { | 2608 { |
2609 for (octave_idx_type i = 0; i < nstr; i++) | 2609 for (octave_idx_type i = 0; i < nstr; i++) |
2610 { | 2610 { |
2611 OCTAVE_QUIT; | 2611 octave_quit (); |
2612 | 2612 |
2613 std::string row = chm.row_as_string (i); | 2613 std::string row = chm.row_as_string (i); |
2614 | 2614 |
2615 if (pr_as_read_syntax) | 2615 if (pr_as_read_syntax) |
2616 { | 2616 { |
2997 | 2997 |
2998 for (octave_idx_type ii = 0; ii < nr; ii++) | 2998 for (octave_idx_type ii = 0; ii < nr; ii++) |
2999 { | 2999 { |
3000 for (octave_idx_type jj = 0; jj < nc; jj++) | 3000 for (octave_idx_type jj = 0; jj < nc; jj++) |
3001 { | 3001 { |
3002 OCTAVE_QUIT; | 3002 octave_quit (); |
3003 | 3003 |
3004 pr_plus_format (os, page(ii,jj)); | 3004 pr_plus_format (os, page(ii,jj)); |
3005 } | 3005 } |
3006 | 3006 |
3007 if ((ii < nr - 1) || (i < m -1)) | 3007 if ((ii < nr - 1) || (i < m -1)) |
3107 | 3107 |
3108 for (octave_idx_type ii = 0; ii < nr; ii++) | 3108 for (octave_idx_type ii = 0; ii < nr; ii++) |
3109 { | 3109 { |
3110 for (octave_idx_type jj = 0; jj < nc; jj++) | 3110 for (octave_idx_type jj = 0; jj < nc; jj++) |
3111 { | 3111 { |
3112 OCTAVE_QUIT; | 3112 octave_quit (); |
3113 os << " "; | 3113 os << " "; |
3114 os << typename octave_print_conv<T>::print_conv_type (page(ii,jj)); | 3114 os << typename octave_print_conv<T>::print_conv_type (page(ii,jj)); |
3115 } | 3115 } |
3116 os << "\n"; | 3116 os << "\n"; |
3117 } | 3117 } |
3135 { | 3135 { |
3136 os << std::setw (extra_indent) << ""; | 3136 os << std::setw (extra_indent) << ""; |
3137 | 3137 |
3138 for (octave_idx_type jj = col; jj < lim; jj++) | 3138 for (octave_idx_type jj = col; jj < lim; jj++) |
3139 { | 3139 { |
3140 OCTAVE_QUIT; | 3140 octave_quit (); |
3141 os << " "; | 3141 os << " "; |
3142 pr_int (os, page(ii,jj), fw); | 3142 pr_int (os, page(ii,jj), fw); |
3143 } | 3143 } |
3144 if ((ii < n_rows - 1) || (i < m -1)) | 3144 if ((ii < n_rows - 1) || (i < m -1)) |
3145 os << "\n"; | 3145 os << "\n"; |