quantlib/QuantLibAddin

QuantLibAddin

karlsen 2011. 6. 2. 17:23
http://quantlib.org/quantlibaddin/

*Description
implements an interface supporting a subset of quantlib functionality.
constructor, member, utility functions are defined in XML metadata from which a python application generates source code for supported platforms.

1. Design


The core QuantLibAddin library can be loaded directly into standalone C++ programs.
: 이렇게 사용할 이유가 없다. QuantLib를 사용하는 것에 비하여 속도상 단점이 있다.
For other platforms, QuantLibAddin is wrapped in an additional layer providing platform-specific functionality.

1.1 Classes

1.2 Addins
QuantLibAddin is linked into a platform-specific library which:
-retrieves inputs in native format from host application
-converts inputs to QuantLib format
-invokes the QuantLibAddin function and captures its return value
-converts the return value to native format and returns it to the host application

1.3 Clients
The client application loads QuantLibAddin, instantiating a single global instance of ObjectHandler.
QuantLibAddin functions allow objects to be constructed, interrogated, modified, and passed as input parameters to functions of other objects.

2. Implementation

namespace QuantLibAddin {
 
    class BlackScholesProcess : public ObjHandler::Object {
 
    public:
        BlackScholesProcess(
            const std::string &handleBlackVol,
            const double &underlying,
            const std::string &dayCounterID,
            const long &settlementDateLong,
            const double &riskFreeRate,
            const double &dividendYield);
        virtual boost::shared_ptr<void> getReference() const {
            return boost::static_pointer_cast<void>(blackScholesProcess_);
        }
    private:
        boost::shared_ptr<QuantLib::BlackScholesProcess>
            blackScholesProcess_;
    };
}