| auto stan::math::sylvester_solver |
( |
const MatA & |
A, |
|
|
const MatB & |
B, |
|
|
const MatC & |
C |
|
) |
| |
|
inline |
Solve the Sylvester equation A X + X B = C for X, forward mode.
The value X solves the equation on the values of A, B and C. Differentiating the equation gives the tangent as the solution of another Sylvester equation with the same coefficients, A X' + X' B = C' - A' X - X B'. Both solves run on the inner scalar type, so no Schur decomposition is taken on fvar values.
- Template Parameters
-
| MatA | type of A (real or complex, fvar or arithmetic scalars) |
| MatB | type of B (real or complex, fvar or arithmetic scalars) |
| MatC | type of C (real or complex, fvar or arithmetic scalars) |
- Parameters
-
| [in] | A | n x n matrix |
| [in] | B | m x m matrix |
| [in] | C | n x m matrix |
- Returns
- complex n x m solution X with std::complex<fvar> entries
- Exceptions
-
| std::invalid_argument | if A or B is not square, or if the dimensions of C do not match |
Definition at line 40 of file sylvester_solver.hpp.