Skip to content

Commit

Permalink
Merge branch 'master' into feature/expose_OvernightIndexedCouponPricer
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfkonrad committed Aug 5, 2024
2 parents 3ac8752 + 2243398 commit 38714d0
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/devenv-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tag: [lunar, mantic, noble]
tag: [lunar, mantic, noble, oracular]
steps:
- uses: actions/checkout@v4
- name: Build CI images
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-full-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
tag: noble
cc: gcc
cxx: g++
- name: "gcc 14.x"
shortname: gcc14
tag: oracular
cc: gcc
cxx: g++
- name: "Clang 7 (Boost 1.72)"
shortname: clang7
tag: cosmic
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-nondefault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
tag: noble
cc: gcc
cxx: g++
- name: "gcc 14.x"
shortname: gcc14
tag: oracular
cc: gcc
cxx: g++
- name: "Clang 7 (Boost 1.72)"
shortname: clang7
tag: cosmic
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
cc: gcc
cxx: g++
tests: true
- name: "gcc 14.x"
shortname: gcc14
tag: oracular
cc: gcc
cxx: g++
tests: true
- name: "Clang 10 (Boost 1.78)"
shortname: clang10
tag: focal
Expand Down
8 changes: 7 additions & 1 deletion cmake/Platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ if (MSVC)
# /w34127
# Enable warning under W3: conditional expression is constant

add_compile_options(/wd4267 /wd4819 /wd26812 /w34127)
# /w34702
# Enable warning under W3: unreachable code

# /w35262
# Enable warning under W3: implicit fall-through occurs here; are you missing a break statement?

add_compile_options(/wd4267 /wd4819 /wd26812 /w34127 /w34702 /w35262)

# Silence all C++17 deprecation warnings, same as in the vcxproj files
add_compile_definitions(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
Expand Down
2 changes: 1 addition & 1 deletion ql/experimental/math/laplaceinterpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ for (auto const& m : map_)
// handling of the "corners", all second derivs are zero in the op
// this directly generalizes Numerical Recipes, 3rd ed, eq 3.8.6
Real sum_corner_h =
std::accumulate(corner_h.begin(), corner_h.end(), Real(0.0), std::plus<Real>());
std::accumulate(corner_h.begin(), corner_h.end(), Real(0.0), std::plus<>());
for (Size j = 0; j < dim.size(); ++j) {
std::vector<Size> coord_j(coord);
coord_j[j] = corner_neighbour_index[j];
Expand Down
3 changes: 2 additions & 1 deletion ql/instruments/makecds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ namespace QuantLib {
end = tradeDate + *tenor_;
}
} else {
end = *termDate_;
// we have two exclusive constructors; if we don't have a tenor, we have a term date
end = *termDate_; // NOLINT(bugprone-unchecked-optional-access)
}

Schedule schedule(protectionStart, end, couponTenor_, WeekendsOnly(), Following,
Expand Down
2 changes: 0 additions & 2 deletions ql/math/integrals/exponentialintegrals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ namespace QuantLib {
}
return (acc + std::complex<Real>(0.0, sign(z.imag())*M_PI))
- std::exp(z)/ (1.0 - z + ei);

QL_FAIL("series conversion issue for Ei(" << z << ")");
}

std::complex<Real> s(0.0), sn=z;
Expand Down
2 changes: 1 addition & 1 deletion ql/pricingengines/blackformula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ namespace QuantLib {

namespace {

static boost::math::normal_distribution<double> normal_dist;
boost::math::normal_distribution<double> normal_dist;

Real phi(const Real x) {
return boost::math::pdf(normal_dist, x);
Expand Down
2 changes: 1 addition & 1 deletion ql/pricingengines/swap/discretizedswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace QuantLib {

// NOLINTNEXTLINE(readability-implicit-bool-conversion)
auto includeTodaysCashFlows = Settings::instance().includeTodaysCashFlows() &&
*Settings::instance().includeTodaysCashFlows();
*Settings::instance().includeTodaysCashFlows(); // NOLINT(bugprone-unchecked-optional-access)

auto nrOfFixedCoupons = args.fixedResetDates.size();
fixedResetTimes_.resize(nrOfFixedCoupons);
Expand Down
4 changes: 3 additions & 1 deletion ql/pricingengines/vanilla/analytichestonengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ namespace QuantLib {
sigma2_(sigma_*sigma_),
rsigma_(rho*sigma_),
t0_(kappa - ((j== 1)? rho*sigma : Real(0))),

engine_(engine)
{
}
Expand Down Expand Up @@ -488,9 +488,11 @@ namespace QuantLib {
*(v0 + kappa*theta*term)
- 2*kappa*theta*std::atan(rho/std::sqrt(1-rho*rho))))
/(sigma*sigma);
[[fallthrough]];
case AngledContour:
vAvg_ = (1-std::exp(-kappa*term))*(v0 - theta)
/(kappa*term) + theta;
[[fallthrough]];
case AngledContourNoCV:
{
const Real r = rho - sigma*freq_ / (v0 + kappa*theta*term);
Expand Down
1 change: 0 additions & 1 deletion ql/time/ecb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ namespace QuantLib {
if (incrementAndCheckForOverlow(nextCodeStr[4]))
incrementAndCheckForOverlow(nextCodeStr[3]);
}
return nextCodeStr;

#if defined(QL_EXTRA_SAFETY_CHECKS)
QL_ENSURE(isECBcode(nextCodeStr),
Expand Down
7 changes: 6 additions & 1 deletion ql/timegrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ namespace QuantLib {
std::adjacent_difference(mandatoryTimes_.begin(),
mandatoryTimes_.end(),
std::back_inserter(diff));
QL_REQUIRE(!diff.empty(), "at least two distinct points required in time grid");

if (diff.front()==0.0)
diff.erase(diff.begin());
dtMax = *(std::min_element(diff.begin(), diff.end()));

auto i = std::min_element(diff.begin(), diff.end());
QL_REQUIRE(i != diff.end(), "not enough distinct points in time grid");
dtMax = *i;
} else {
dtMax = last/steps;
}
Expand Down
1 change: 1 addition & 0 deletions test-suite/defaultprobabilitycurves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ BOOST_AUTO_TEST_CASE(testIterativeBootstrapRetries) {

// Create the CDS spread helpers.
vector<ext::shared_ptr<DefaultProbabilityHelper> > instruments;
instruments.reserve(cdsSpreads.size());
for (auto & cdsSpread : cdsSpreads) {
instruments.push_back(ext::make_shared<SpreadCdsHelper>(
cdsSpread.second, cdsSpread.first, settlementDays, calendar,
Expand Down
6 changes: 3 additions & 3 deletions test-suite/quantlibbenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ namespace {
Benchmark(Benchmark&& move) = default;
Benchmark& operator=(const Benchmark &other) = default;
Benchmark& operator=(Benchmark &&other) = default;
~Benchmark() = default;

double getCost() const { return cost_; }
std::string getName() const { return name_; }
Expand Down Expand Up @@ -262,8 +263,7 @@ namespace {
std::string msg = "Unable to find the Boost test unit for Benchmark '";
msg += b.getName();
msg += "'";
std::runtime_error err(msg);
throw err;
throw std::runtime_error(msg);
}
}
}
Expand Down Expand Up @@ -575,7 +575,7 @@ QL_BENCHMARK_DECLARE(RoundingTests, testClosest, 100000, 0.1);



int main(int argc, char* argv[] )
int main(int argc, char* argv[] ) // NOLINT(bugprone-exception-escape)
{
const std::string clientModeStr = "--client_mode=true";
bool clientMode = false;
Expand Down
4 changes: 2 additions & 2 deletions test-suite/quantlibglobalfixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ QuantLibGlobalFixture::QuantLibGlobalFixture() {
? "reference date events are included,\n"
: "reference date events are excluded,\n")
<< (settings.includeTodaysCashFlows()
? (*settings.includeTodaysCashFlows()
? (*settings.includeTodaysCashFlows() // NOLINT(bugprone-unchecked-optional-access)
? "today's cashflows are included,\n"
: "today's cashflows are excluded,\n")
: "")
Expand Down Expand Up @@ -166,4 +166,4 @@ SpeedLevel speed_level(int argc, char** argv) {
return Faster;
}
return Slow;
}
}

0 comments on commit 38714d0

Please sign in to comment.