SCM

[#6788] show() should not allocate more than the printed subset

Date:
2022-11-16 16:23
Priority:
3
State:
Open
Submitted by:
Mikael Jagan (jaganmn)
Assigned to:
Mikael Jagan (jaganmn)
Hardware:
None
Product:
None
Operating System:
None
Component:
None
Version:
None
Severity:
normal
Resolution:
Accepted As Bug
URL:
Summary:
show() should not allocate more than the printed subset

Detailed description
Currently we see problems like this:

<R>
> library(Matrix)
> m <- .Machine$integer.max
> new("dgTMatrix", i = integer(0), j = integer(0), Dim = c(m, m))
2147483647 x 2147483647 sparse Matrix of class "dgTMatrix"

Error in subCsp_cols(x, j, drop = drop) :
long vectors not supported yet: ../../../R-4.2/src/include/Rinlinedfuns.h:537
</R>

Ideally, we would have a utility like

<R>
function(x, m, n) as(x, "matrix")[seq_len(m), seq_len(n), drop = FALSE]
</R>

but allocating at most an m*n-length matrix, so that show() can become more efficient.

Comments:

No Comments Have Been Posted

Attached Files:

Changes

No Changes Have Been Made to This Item

Thanks to:
Vienna University of Economics and Business Powered By FusionForge