# Does eigen decomposition exist in the library?

**URL:** https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382
**Category:** ND4J
**Created:** [May 14, 2021, 2:37pm UTC](https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382 "2021-05-14T14:37:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wcneill](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/wcneill/32/559_2.png) [@wcneill](https://community.konduit.ai/u/wcneill)
#### Post date: [May 14, 2021, 2:37pm UTC](https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382/1 "2021-05-14T14:37:01Z")

</div>

I’m probably missing something, but I can’t seem to find a full eigen decomposition in your library, although it exists here on GitHub: [https://github.com/deeplearning4j/nd4j/blob/14410087388980c6c25111859a1272418e20ec54/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java](https://github.com/deeplearning4j/nd4j/blob/14410087388980c6c25111859a1272418e20ec54/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java)

This appears to be an official implementation, but I’m not sure because it’s not in the latest version of the API. Can someone clear this up for me?

EDIT: I see that eigenvalues can be calculated, but I’m looking for a full decomposition or at least a separate method that will calculate eigenvectors and not just eigenvalues.

---

<div class="post-metadata">

### Author: ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)
#### Post date: [May 14, 2021, 2:43pm UTC](https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382/2 "2021-05-14T14:43:23Z")

</div>

> <https://github.com/eclipse/deeplearning4j/blob/master/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java>

As you can see it does still exist on master, and you can find it in the JavaDoc: [Eigen (nd4j-api 1.0.0-beta7 API)](https://javadoc.io/static/org.nd4j/nd4j-api/1.0.0-beta7/org/nd4j/linalg/eigen/Eigen.html)

So, yes, it does exist.

---

<div class="post-metadata">

### Author: ![wcneill](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/wcneill/32/559_2.png) [@wcneill](https://community.konduit.ai/u/wcneill)
#### Post date: [May 14, 2021, 2:48pm UTC](https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382/3 "2021-05-14T14:48:42Z")

</div>

Thank you, but all of those methods appear to only return the eigenvalues. Doesn’t eigendecomposition typically include the accompanying vectors?

I’m sorry if I’m just blind or dumb, I may be bad at reading JavaDoc. I’m getting into Java from Python which typically has more verbose documentation. Again I apologize.

---

<div class="post-metadata">

### Author: ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)
#### Post date: [May 14, 2021, 3:23pm UTC](https://community.konduit.ai/t/does-eigen-decomposition-exist-in-the-library/1382/4 "2021-05-14T15:23:20Z")

</div>

In principle the methods I’ve linked give you access to the BLAS methods for eigenvector and eigenvalue computation.

The JavaDoc says that the input matrix will be modified to hold the eigenvectors. So you get two outputs effectively. The return value, which holds eigenvalues and the modification of the input matrix which now holds the eigenvectors.
