Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24857/qlo
Modified Files:
.cvsignore
Added Files:
optimization.cpp optimization.hpp
Log Message:
exported OptimizationMethod
Index: .cvsignore
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/.cvsignore,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** .cvsignore 5 Jul 2006 19:30:10 -0000 1.13
--- .cvsignore 14 Jul 2006 17:35:30 -0000 1.14
***************
*** 21,24 ****
--- 21,25 ----
vo_mathf.*pp
vo_marketmodels.*pp
+ vo_optimization.*pp
vo_options.*pp
vo_payoffs.*pp
--- NEW FILE: optimization.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_optimization_hpp
#define qla_optimization_hpp
#include <oh/objhandler.hpp>
#include <ql/Optimization/method.hpp>
namespace QuantLibAddin {
class EndCriteria : public ObjHandler::LibraryObject<
QuantLib::EndCriteria>
{
public:
EndCriteria(QuantLib::Size maxIteration,
double epsilon);
};
class OptimizationMethod : public ObjHandler::LibraryObject<
QuantLib::OptimizationMethod> {};
class ConjugateGradient : public OptimizationMethod
{
public:
ConjugateGradient();
};
class LevenbergMarquardt : public OptimizationMethod
{
public:
LevenbergMarquardt();
};
class Simplex : public OptimizationMethod
{
public:
Simplex(double lambda,
double tol);
};
class SteepestDescent : public OptimizationMethod
{
public:
SteepestDescent();
};
}
#endif
--- NEW FILE: optimization.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/optimization.hpp>
#include <ql/Optimization/conjugategradient.hpp>
#include <ql/Optimization/levenbergmarquardt.hpp>
#include <ql/Optimization/simplex.hpp>
#include <ql/Optimization/steepestdescent.hpp>
namespace QuantLibAddin {
EndCriteria::EndCriteria(QuantLib::Size maxIteration,
double epsilon)
{
libraryObject_ = boost::shared_ptr<QuantLib::EndCriteria>(
new QuantLib::EndCriteria(maxIteration,
epsilon));
}
ConjugateGradient::ConjugateGradient()
{
libraryObject_ = boost::shared_ptr<QuantLib::OptimizationMethod>(
new QuantLib::ConjugateGradient());
}
LevenbergMarquardt::LevenbergMarquardt()
{
libraryObject_ = boost::shared_ptr<QuantLib::OptimizationMethod>(
new QuantLib::LevenbergMarquardt());
}
Simplex::Simplex(double lambda, double tol)
{
libraryObject_ = boost::shared_ptr<QuantLib::OptimizationMethod>(
new QuantLib::Simplex(lambda, tol));
}
SteepestDescent::SteepestDescent()
{
libraryObject_ = boost::shared_ptr<QuantLib::OptimizationMethod>(
new QuantLib::SteepestDescent());
}
}
|