QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
userconfig.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2004, 2011 Ferdinando Ametrano
5 Copyright (C) 2004, 2005 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21#ifndef quantlib_config_hpp
22#define quantlib_config_hpp
23
24/***************************************************************
25 User configuration section:
26 modify the following definitions to suit your preferences.
27
28 Do not modify this file if you are using a Linux/Unix system:
29 it will not be read by the compiler. The definitions below
30 will be provided by running ./configure instead.
31****************************************************************/
32
33/* If defined, function information is added to the error messages
34 thrown by the library.
35*/
36#ifndef QL_ERROR_FUNCTIONS
37//# define QL_ERROR_FUNCTIONS
38#endif
39
40/* If defined, file and line information is added to the error
41 messages thrown by the library.
42*/
43#ifndef QL_ERROR_LINES
44//# define QL_ERROR_LINES
45#endif
46
47/* If defined, tracing messages might be emitted by the library
48 depending on run-time settings. Enabling this option can degrade
49 performance.
50*/
51#ifndef QL_ENABLE_TRACING
52//# define QL_ENABLE_TRACING
53#endif
54
55/* If defined, extra run-time checks are added to a few
56 functions. This can prevent their inlining and degrade
57 performance.
58*/
59#ifndef QL_EXTRA_SAFETY_CHECKS
60//# define QL_EXTRA_SAFETY_CHECKS
61#endif
62
63/* If defined, indexed coupons (see the documentation) are used in
64 floating legs. If undefined, par coupons are used.
65*/
66#ifndef QL_USE_INDEXED_COUPON
67//# define QL_USE_INDEXED_COUPON
68#endif
69
70/* If defined, singletons will return different instances for
71 different threads; in particular, this means that the evaluation
72 date, the stored index fixings and any other settings will be
73 per-thread.
74*/
75#ifndef QL_ENABLE_SESSIONS
76//# define QL_ENABLE_SESSIONS
77#endif
78
79/* If defined, a thread-safe (but less performant) version of the
80 observer pattern is used. You should define it if you want to use
81 QuantLib via the SWIG layer within the JVM or .NET ecosystem or
82 any other environment with an async garbage collector.
83*/
84#ifndef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
85//# define QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
86#endif
87
88/* If defined, date objects willsupport an intraday datetime
89 resolution down to microseconds. Strictly monotone daycounters
90 (`Actual360`, `Actual365Fixed` and `ActualActual`) will take the
91 additional information into account and allow for accurate intraday
92 pricing. If undefined, the smallest resolution of date objects is
93 a single day. Intraday datetime resolution is experimental.
94*/
95#ifndef QL_HIGH_RESOLUTION_DATE
96//# define QL_HIGH_RESOLUTION_DATE
97#endif
98
99/* If defined, lazy objects will raise an exception when they detect a
100 notification cycle which would result in an infinite recursion
101 loop. If undefined, they will break the recursion without throwing.
102 Enabling this option is recommended but might cause existing code
103 to throw.
104*/
105#ifndef QL_THROW_IN_CYCLES
106//# define QL_THROW_IN_CYCLES
107#endif
108
109/* If defined, lazy objects will forward the first notification
110 received, and discard the others until recalculated; the rationale
111 is that observers were already notified, and don't need further
112 notifications until they recalculate, at which point this object
113 would be recalculated too. After recalculation, this object would
114 again forward the first notification received. Although not always
115 correct, this behavior is a lot faster and thus is the current
116 default.
117*/
118#ifndef QL_FASTER_LAZY_OBJECTS
119# define QL_FASTER_LAZY_OBJECTS
120#endif
121
122/* If defined, `std::any` and related classes and functions will be
123 used instead of `boost::any`. If undefined, the Boost facilities
124 will be used.
125*/
126#ifndef QL_USE_STD_ANY
127# define QL_USE_STD_ANY
128#endif
129
130/* If defined, `std::optional` and related classes and functions will
131 be used instead of `boost::optional`. If undefined, the Boost
132 facilities will be used.
133*/
134#ifndef QL_USE_STD_OPTIONAL
135# define QL_USE_STD_OPTIONAL
136#endif
137
138/* If defined, `std::shared_ptr` and related classes and functions
139 will used instead of `boost::shared_ptr`. If undefined, the Boost
140 facilities will be used. Note that `std::shared_ptr` does not check
141 access and can cause segmentation faults.
142*/
143#ifndef QL_USE_STD_SHARED_PTR
144//# define QL_USE_STD_SHARED_PTR
145#endif
146
147/* If defined, `Null` will be implemented as a template function.
148 This allows the code to work with user-defined `Real` types but was
149 reported to cause internal compiler errors with Visual C++ 2022 in
150 some cases. If undefined, `Null` will be implemented as a class
151 template, as in previous releases.
152*/
153#ifndef QL_NULL_AS_FUNCTIONS
154//# define QL_NULL_AS_FUNCTIONS
155#endif
156
157/* If defined, a parallel unit test runner will be used to execute the
158 C++ test suite. This will reduce the runtime on multi core CPUs.
159*/
160#ifndef QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
161//# define QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
162#endif
163
164#endif