densify: Densify with explicit zeroes

Description Usage Arguments Value Examples

Description

This function takes two sparse matrices and returns the first matrix padded with explicit zeros so that it is at least dense (probably denser) than the second matrix. This function only works with matrices of class Matrix #'

Usage

1
densify(A, B)

Arguments

A

object of class Matrix

B

object of class Matrix

Value

object of class Matrix

Examples

1
2
3
4
5
6
require(Matrix)
Q1 <- sparseMatrix(i = c(1, 2, 2), j = c(1, 1, 2), x = c(0.1, 0.2, 1))
Q2 <- sparseMatrix(i = c(1, 1, 2, 2),j = c(1, 2, 1, 2), x = c(0.1, 0.3, 0.2, 1))
Q1dens <- densify(Q1, Q2)
Q1
Q1dens

sparseinv documentation built on May 2, 2019, 7:04 a.m.