Evaluates the quadratic form x'Ax using optimized cross products. An upper triangular matrix with U'U = A can also be given to dramatically increase speed.
1 | qform(x, A, U)
|
x |
a vector |
A |
a matrix. Only one of A and U needs to be provided. |
U |
an upper triangular matrix. Note that plugging in chol(A) is slower. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.