Return the quadratic form \( B^T A B \).
Symmetry of the resulting matrix is not guaranteed due to numerical precision.
- Template Parameters
-
EigMat1 | type of the first (square) matrix |
EigMat2 | type of the second matrix |
- Parameters
-
A | square matrix |
B | second matrix |
symmetric | indicates whether the output should be made symmetric |
- Returns
- The quadratic form, which is a symmetric matrix.
- Exceptions
-
std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 244 of file quad_form.hpp.