Fast computation of a quadratic form \(t(x) * M * x\).
quadform(x, M, invertM = FALSE, transposex = FALSE)
A matrix with dimensions k * k giving the quadratic form
A matrix with dimensions n*k.
A matrix with dimenions n*n. If it is to be inverted then the matrix should be symmetric and positive difinite (no check is done for this)
A logical. If set to TRUE then M will be inverted before computations (defaults to FALSE)
A logical. Should the matrix be transposed before computations (defaults to FALSE).
Claus Ekstrom <claus@rprimer.dk>