Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ sylvester_solver() [1/2]

template<typename MatA , typename MatB , typename MatC , require_all_matrix_t< MatA, MatB, MatC > * = nullptr, require_any_bt_fvar< MatA, MatB, MatC > * = nullptr>
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
MatAtype of A (real or complex, fvar or arithmetic scalars)
MatBtype of B (real or complex, fvar or arithmetic scalars)
MatCtype of C (real or complex, fvar or arithmetic scalars)
Parameters
[in]An x n matrix
[in]Bm x m matrix
[in]Cn x m matrix
Returns
complex n x m solution X with std::complex<fvar> entries
Exceptions
std::invalid_argumentif A or B is not square, or if the dimensions of C do not match

Definition at line 40 of file sylvester_solver.hpp.