# SVDSolve with two matrices (generalized SVD)

**URL:** <https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348>\
**Category:** General Discussion\
**Created:** [June 25, 2024, 1:18pm UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348 "2024-06-25T13:18:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![etj](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@etj](https://community.freefem.org/u/etj)\
**Post date:** [June 25, 2024, 1:18pm UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/1 "2024-06-25T13:18:51Z")

</div>

Hello,

I am wondering if one can use `SVDSolve(...)` with two matrices? Something similar to `EPSSolve(J,M,...)` for generalized eigenvalue problems.

From SLEPc’s documentation it seems that it’s possible (e.g. [here](https://slepc.upv.es/documentation/current/src/svd/tutorials/ex45.c.html)), but is it implemented in FF? If yes, what is the correct syntax? Is there any example available?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 25, 2024, 1:55pm UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/2 "2024-06-25T13:55:33Z")

</div>

It is currently not interfaced, but should not require too much work to get it working.

---

<div class="post-metadata">

**Author:** ![etj](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@etj](https://community.freefem.org/u/etj)\
**Post date:** [June 25, 2024, 2:56pm UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/3 "2024-06-25T14:56:11Z")

</div>

Thank you for the prompt reply. That would be wonderful! Would you be able to estimate, by any chance, when you can find time to do the interfacing?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 25, 2024, 3:10pm UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/4 "2024-06-25T15:10:25Z")

</div>

Not in the foreseeable future, but I’d be happy to review a GitHub pull request.

---

<div class="post-metadata">

**Author:** ![etj](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@etj](https://community.freefem.org/u/etj)\
**Post date:** [June 26, 2024, 7:17am UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/5 "2024-06-26T07:17:32Z")

</div>

I see. I don’t think I am qualified to do it myself, but hopefully someone can contribute?

Should I open a new topic in the “Feature request” category?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [June 26, 2024, 9:18am UTC](https://community.freefem.org/t/svdsolve-with-two-matrices-generalized-svd/3348/6 "2024-06-26T09:18:22Z")

</div>

I think it’s fine if you leave it there. You are the only one who has requested this thus far, so the only probable candidate for this contribution would be… you 🙂  
For sure, if there is not a single exemple that could be used to check the code/interface, it’s very unlikely that I will ever do it. So at the very least you should share a `.edp` doing all the necessary work, with just the call to `SVDSolve()` being commented out (otherwise the parser will complain that the call is not right).
