constrainSimCpp: Constrain similarity matrix with a mask

View source: R/RcppExports.R

constrainSimCppR Documentation

Constrain similarity matrix with a mask

Description

Constrain similarity matrix with a mask

Usage

constrainSimCpp(sim, MASK, samples4gradient = 100)

Arguments

sim

(matrix) A numeric matrix. Input similarity matrix.

MASK

(matrix) A numeric matrix. Masked indices have non-zero values.

samples4gradient

(numeric) This paarameter modulates penalization of masked indices.

Value

s_new (matrix) A constrained similarity matrix.

Author(s)

Shubham Gupta, shubh.gupta@mail.utoronto.ca ORCID: 0000-0003-3500-8152 License: (c) Author (2019) + MIT Date: 2019-03-08

Examples

sim <- matrix(c(-2, 10, -2, -2, -2, -2, 10, -2, 10, -2, -2, -2, -2, -2, -2, 10, 10, -2,-2, -2),
 4, 5, byrow = FALSE)
MASK <- matrix(c(0.000, 0.000, 0.707, 1.414, 0.000, 0.000, 0.000, 0.707, 0.707, 0.000,
0.000, 0.000, 1.414, 0.707, 0, 0, 2.121, 1.414, 0, 0), 4, 5, byrow = FALSE)
constrainSimCpp(sim, MASK, 10)
matrix(c(-2, 10, -3.414, -4.828, -2, -2, 10, -3.414, 8.586, -2, -2, -2, -4.828,
-3.414, -2, 10, 5.758, -4.828, -2, -2), 4, 5, byrow = FALSE)

shubham1637/DIAlign documentation built on March 27, 2023, 7:12 a.m.