Skip to content

cholmod error 'index out of range' at file ../core/cholmo d_triplet.c, line 451 #12

@mguzmann

Description

@mguzmann

I am getting this error when working with very large rasters.

h.dist <- gdistance::transition(DEM, transitionFunction = function(x){1}, directions = 8, symm = TRUE)
h.dist <- gdistance::geoCorrection(h.dist, scl = FALSE)
adj <- raster::adjacent(DEM, cells = 1:ncell(DEM), pairs = TRUE, directions = 8)
h.dist[adj] <- 1/h.dist[adj]

The error comes from the last line:

h.dist[adj] <- 1/h.dist[adj]

If I do something like:

h.dist[tail(adj)] <- 1/h.dist[tail(adj)]

or

h.dist[adj[1:10,]] <- 1/h.dist[adj[1:10,]]

It works fine. The adj matrix has 1164557166 rows, so I don't know whether there is a hard limit on the indexing that can be handled by sparse matrices?

I guess I can do a for loop and process it in chunks, would that work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions