26#include <ql/math/matrixutilities/pseudosqrt.hpp>
30using QuantLib::Matrix;
31using QuantLib::SalvagingAlgorithm;
51 virtual std::pair<Matrix, Matrix>
salvage(
const Matrix& m)
const = 0;
56 std::pair<Matrix, Matrix>
salvage(
const Matrix& m)
const override {
return std::make_pair(m, Matrix()); }
61 std::pair<Matrix, Matrix>
salvage(
const Matrix& m)
const override {
62 auto L = pseudoSqrt(m, SalvagingAlgorithm::Spectral);
63 return std::make_pair(L * transpose(L), L);
virtual ~CovarianceSalvage()
virtual std::pair< Matrix, Matrix > salvage(const Matrix &m) const =0
Implementation that does not change the input matrix.
std::pair< Matrix, Matrix > salvage(const Matrix &m) const override
Implementation that uses the spectral method.
std::pair< Matrix, Matrix > salvage(const Matrix &m) const override