| Line 442... |
Line 442... |
| 442 |
/* nb_pr := the number of matrix slices to be printed */
|
442 |
/* nb_pr := the number of matrix slices to be printed */
|
| 443 |
nb_pr = ceil_DIV(R_print.max, b);
|
443 |
nb_pr = ceil_DIV(R_print.max, b);
|
| 444 |
/* for the last, (nb_pr)th matrix slice, use only nr_last rows;
|
444 |
/* for the last, (nb_pr)th matrix slice, use only nr_last rows;
|
| 445 |
* using floor(), not ceil(), since 'nc' could be huge: */
|
445 |
* using floor(), not ceil(), since 'nc' could be huge: */
|
| 446 |
ne_last = R_print.max - b * (nb_pr - 1);
|
446 |
ne_last = R_print.max - b * (nb_pr - 1);
|
| 447 |
nc_last = (ne_last < nc) ? 0: nc;
|
447 |
nc_last = (ne_last < nc) ? ne_last : nc;
|
| 448 |
nr_last = (ne_last < nc) ? 0: ne_last / nc;
|
448 |
nr_last = (ne_last < nc) ? 1 : ne_last / nc;
|
| 449 |
if(nr_last == 0) { nb_pr--; nc_last = nc; nr_last = nr;}
|
449 |
if(nr_last == 0) { nb_pr--; nc_last = nc; nr_last = nr;}
|
| 450 |
} else {
|
450 |
} else {
|
| 451 |
nb_pr = (nb > 0) ? nb : 1; // do print *something* when dim = c(a,b,0)
|
451 |
nb_pr = (nb > 0) ? nb : 1; // do print *something* when dim = c(a,b,0)
|
| 452 |
ne_last = b;
|
452 |
ne_last = b;
|
| 453 |
nc_last = nc;
|
453 |
nc_last = nc;
|
| Line 509... |
Line 509... |
| 509 |
if (max_reached) {
|
509 |
if (max_reached) {
|
| 510 |
Rprintf(" [ reached 'max' / getOption(\"max.print\") -- omitted");
|
510 |
Rprintf(" [ reached 'max' / getOption(\"max.print\") -- omitted");
|
| 511 |
if (nb_pr < nb)
|
511 |
if (nb_pr < nb)
|
| 512 |
Rprintf(ngettext(" %d slice", " %d slices", nb - nb_pr), nb - nb_pr);
|
512 |
Rprintf(ngettext(" %d slice", " %d slices", nb - nb_pr), nb - nb_pr);
|
| 513 |
else if (nb_pr == nb) {
|
513 |
else if (nb_pr == nb) {
|
| 514 |
if(nr_last < nr) Rprintf(ngettext(" %d row", " %d rows", nr - nr_last), nr - nr_last);
|
- |
|
| 515 |
if(nc_last < nc) Rprintf(ngettext(" %d column", " %d columns", nc - nc_last), nc - nc_last);
|
- |
|
| 516 |
/* == MM: replace the above with
|
- |
|
| 517 |
if((nr -= nr_last) > 0) Rprintf(ngettext(" %d row", " %d rows", nr), nr);
|
514 |
if((nr -= nr_last) > 0) Rprintf(ngettext(" %d row", " %d rows", nr), nr);
|
| 518 |
if((nc -= nc_last) > 0) Rprintf(ngettext(" %d column", " %d columns", nc), nc);
|
515 |
if((nc -= nc_last) > 0) Rprintf(ngettext(" %d column", " %d columns", nc), nc);
|
| 519 |
*/
|
- |
|
| 520 |
}
|
516 |
}
|
| 521 |
Rprintf(" ] \n");
|
517 |
Rprintf(" ] \n");
|
| 522 |
}
|
518 |
}
|
| 523 |
}
|
519 |
}
|
| 524 |
UNPROTECT(nprotect);
|
520 |
UNPROTECT(nprotect);
|