fm.populate_fm_2add_sparse: Function for populating 2-additive sparse capacity

View source: R/Rfmtool.r

fm.populate_fm_2add_sparseR Documentation

Function for populating 2-additive sparse capacity

Description

Populate 2-additive sparse capacity with nonzero values using the singletons and two arrays of indices (of size numpairs).

Usage

  fm.populate_fm_2add_sparse(singletons, numpairs, pairs, indicesp1, indicesp2, envsp)

Arguments

singletons

Singletons 0-based.

numpairs

Size numpairs.

pairs

Array 0-based.

indicesp1

Array of indices of Size numpairs.need to be 1-based.

indicesp2

Array of indices of Size numpairs.need to be 1-based.

envsp

Structure required for sparse representation which stores the relevant values (k-tuples). It is obtained from fm.PrepareSparseFM(n).

Value

output

The output is Populate 2-additive sparse capacity with nonzero values using the singletons and two arrays of indices (of size numpairs)

Author(s)

Gleb Beliakov, Andrei Kelarev, Quan Vu, Daniela L. Calderon, Deakin University

Examples

    n <- 3
    envsp <- fm.PrepareSparseFM(n, vector(), vector()) 

    envsp <- fm.populate_fm_2add_sparse(c(0.1,0.2,0.3), 3, 
       c(0.4,0.5,0.6), c(1,1,2), c(2,3,3), envsp)
    envsp
    envsp <- fm.FreeSparseFM(envsp) 
  

Rfmtool documentation built on Feb. 16, 2023, 9:21 p.m.