Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10900/qlo
Added Files:
getcovariance.cpp getcovariance.hpp
Log Message:
exported CovarianceDecomposition, CovFromCorr, and CholeskyDecomposition
--- NEW FILE: getcovariance.hpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef qla_getcovariance_hpp
#define qla_getcovariance_hpp
#include <oh/objhandler.hpp>
#include <ql/MonteCarlo/getcovariance.hpp>
namespace QuantLibAddin {
inline QuantLib::Matrix getCovariance(std::vector<double> vols,
const QuantLib::Matrix& corr,
double tol)
{
return QuantLib::getCovariance(vols.begin(), vols.end(), corr, tol);
}
class CovarianceDecomposition : public ObjHandler::LibraryObject<
QuantLib::CovarianceDecomposition>
{
public:
CovarianceDecomposition::CovarianceDecomposition(
const QuantLib::Matrix& cov,
double tol);
};
}
#endif
--- NEW FILE: getcovariance.cpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#if defined(HAVE_CONFIG_H)
#include <qlo/config.hpp>
#endif
#include <qlo/getcovariance.hpp>
namespace QuantLibAddin {
CovarianceDecomposition::CovarianceDecomposition(
const QuantLib::Matrix& cov,
double tol)
{
libraryObject_ = boost::shared_ptr<
QuantLib::CovarianceDecomposition>(
new QuantLib::CovarianceDecomposition(cov, tol));
}
}
|