I am working on a program which works with Volesti package in R. I have a large matrix (About 40k x 120k) and I want to use a function from Volesti which only accepts either class matrix or classes extended from it. I found in the documentation that dgCMatrix should be an extension of class matrix but I get this error:
Error in validObject(.Object) :
invalid class "Hpolytope" object: 1: invalid object for slot "A" in class "Hpolytope": got class "dgCMatrix", should be or extend class "matrix"
invalid class "Hpolytope" object: 2: invalid object for slot "b" in class "Hpolytope": got class "dgCMatrix", should be or extend class "numeric"
The matrix is currently read from csv and my code looks like this:
df <- read.csv("matrix.csv")
colnames(df) <- c("row", "col", "value")
spmatrix <- sparseMatrix(i = df$row + 1, j = df$col + 1, x = df$value)
dff <- read.csv("vector.csv")
colnames(dff) <- c("row", "col", "value")
vector <- sparseMatrix(i = dff$row + 1, j = dff$col + 1, x = dff$value)
P <- Hpolytope(A = spmatrix, b = vector)
Is there a way that would allow me to somehow make matrix A and vector b from the class dgCMatrix so I can use it for Volesti? Mind there is no way to convert it to normal dense matrix, since it would not fit into RAM and its way too large.