Skip to content

Unnecessary cast to dense matrix in fcm() #267

@dselivanov

Description

@dselivanov

Tried to compare create_tcm() and fcm(). Got following:

Error in asMethod(object) :
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105
9.asMethod(object)
8.as(x, "matrix")
7.as.matrix.Matrix(x)
6.as.matrix(x)
5.lower.tri(result, diag = FALSE)

This casts sparse matrix to dense (see source code for base::lower.tri() function):

    # discard the lower diagonal if tri == TRUE
    if (tri)
        result[lower.tri(result, diag = FALSE)] <- 0

Should be trivial to do it with Matrix functions and without casting to dense.

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