Computes the spectral decomposition of a numeric matrix using the Eigen C++ template library.
In a nimbleFunction, eigen
is identical to nimEigen
. If the matrix is symmetric, a faster and more accurate algorithm will be used to compute the eigendecomposition. Note that non-symmetric matrices can have complex eigenvalues,
which are not supported by NIMBLE. If a complex eigenvalue or a complex element of an eigenvector is detected, a warning will be issued and that element will be returned as NaN
.
Additionally, returnType(eigenNimbleList())
can be used within a link{nimbleFunction}
to specify that the function will return a nimbleList
generated by the nimEigen
function. eigenNimbleList()
can also be used to define a nested nimbleList
element. See the User Manual for usage examples.