R/Ltrans.R

Defines functions Ltrans

Documented in Ltrans

Ltrans <- function(tnsr) {

  if (tnsr@num_modes != 3)
    stop("LTAR only implemented for 3d so far")

  modes <- tnsr@modes
  n1 <- modes[1]
  n2 <- modes[2]
  n3 <- modes[3]

  dtformz <- aperm(apply(tnsr@data, MARGIN = 1:2, dct), c(2,3,1))

  return(dtformz)
}

Try the LTAR package in your browser

Any scripts or data that you put into this service are public.

LTAR documentation built on Aug. 22, 2023, 1:08 a.m.