|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
A number of macros is provided for user configuration. Defining or undefining such macros triggers variations in some library functionality.
When using CMake, they can be set to ON or OFF as properties.
Under a Linux/Unix system, they are (un)set by configure; run
for a list of corresponding command-line options.
Under a Windows system, they must be (un)defined by editing the file <ql/userconfig.hpp> and commenting or uncommenting the relevant lines.
Such macros include:
If defined, function information is added to the error messages thrown by the library. Undefined by default.
If defined, file and line information is added to the error messages thrown by the library. Undefined by default.
If defined, tracing messages might be emitted by the library depending on run-time settings. Enabling this option can degrade performance. Undefined by default.
If defined, extra run-time checks are added to a few functions. This can prevent their inlining and degrade performance. Undefined by default.
If defined, indexed coupons (see the documentation) are used in floating legs. If undefined (the default), par coupons are used.
If defined, singletons will return different instances for different threads; in particular, this means that the evaluation date, the stored index fixings and any other settings will be per-thread. Undefined by default.
If defined, a thread-safe (but less performant) version of the observer pattern is used. You should define it if you want to use QuantLib via the SWIG layer within the JVM or .NET ecosystem or any other environment with an async garbage collector. Undefined by default.
If defined, date objects willsupport an intraday datetime resolution down to microseconds. Strictly monotone daycounters (Actual360, Actual365Fixed and ActualActual) will take the additional information into account and allow for accurate intraday pricing. If undefined (the default) the smallest resolution of date objects is a single day. Intraday datetime resolution is experimental.
If defined, lazy objects will raise an exception when they detect a notification cycle which would result in an infinite recursion loop. If undefined (the default), they will break the recursion without throwing. Enabling this option is recommended but might cause existing code to throw.
If defined (the default), lazy objects will forward the first notification received, and discard the others until recalculated; the rationale is that observers were already notified, and don't need further notifications until they recalculate, at which point this object would be recalculated too. After recalculation, this object would again forward the first notification received. Although not always correct, this behavior is a lot faster and thus is the current default.
If defined (the default), std::any and related classes and functions will be used instead of boost::any. If undefined, the Boost facilities will be used.
If defined (the default), std::optional and related classes and functions will be used instead of boost::optional. If undefined, the Boost facilities will be used.
If defined, std::shared_ptr and related classes and functions will used instead of boost::shared_ptr. If undefined (the default) the Boost facilities will be used. Note that std::shared_ptr does not check access and can cause segmentation faults.
If defined, Null will be implemented as a template function. This allows the code to work with user-defined Real types but was reported to cause internal compiler errors with Visual C++ 2022 in some cases. If undefined (the default) Null will be implemented as a class template, as in previous releases.
If defined, a parallel unit test runner will be used to execute the C++ test suite. This will reduce the runtime on multi core CPUs. Undefined by default.