fastHadamard: Compute fast Hadamard-transform of vector

View source: R/subsetMatrix.R

fastHadamardR Documentation

Compute fast Hadamard-transform of vector

Description

Passes vector through Hadamard orthogonal design matrix. Also known as the Fast Walsh-Hadamard transform.

Usage

fastHadamard(x, pad = FALSE)

Arguments

x

vector of values to be transformed

pad

optional logical asking whether vector not of length 2^k should be padded with zeroes

Details

This is equivalent to multiplying by designMatrix(log2(length(x))) but should run much faster

Value

A vector of the same length as x

Author(s)

Robin Evans

See Also

designMatrix, subsetMatrix.

Examples


fastHadamard(1:8)
fastHadamard(1:5, pad=TRUE)


rje42/rje documentation built on April 3, 2024, 11:08 p.m.