rs_fold-methods {DelayedTensor} | R Documentation

## Row Space Folding of 2D DelayedArray

### Description

The inverse operation to `rs_unfold`.

### Usage

    rs_fold(mat, m = NULL, modes = NULL)

    ## S4 method for signature 'DelayedArray'
    rs_fold(mat, m, modes)

### Arguments

`mat` | DelayedArray object (only 2D)
`m` | the mode corresponding to rs_unfold
`modes` | the original modes of the DelayedArray

### Details

This function is an extension of the `rs_fold` by DelayedArray.

This is a wrapper function to `fold`.

### Value

DelayedArray (higher than 2D)

### References

T. Kolda, B. Bader, "Tensor decomposition and applications". SIAM Applied Mathematics and Applications 2009.

### See Also

`fold`, `rs_unfold`

### Examples

    library("DelayedRandomArray")
    darr <- RandomUnifArray(c(2,3,4))
    matT2 <- rs_unfold(darr, m=2)
    identical(
        as.array(rs_fold(matT2, m=2, modes=c(2,3,4))),
        as.array(darr))

[Package DelayedTensor version 1.0.0 Index]