constrainSimCpp: Constrain similarity matrix with a mask

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Constrain similarity matrix with a mask

Usage

1
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

1
2
3
4
5
6
7
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)

DIAlignR documentation built on Nov. 8, 2020, 8:22 p.m.