Skip to content

Commit

Permalink
Automated fixes by clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 24, 2022
1 parent 58e92ab commit b0c78ed
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions ql/experimental/barrieroption/doublebarrieroption.cpp
Expand Up @@ -17,10 +17,10 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include <ql/experimental/barrieroption/doublebarrieroption.hpp>
#include <ql/exercise.hpp>
#include <ql/experimental/barrieroption/analyticdoublebarrierengine.hpp>
#include <ql/experimental/barrieroption/doublebarrieroption.hpp>
#include <ql/instruments/impliedvolatility.hpp>
#include <ql/exercise.hpp>
#include <memory>

namespace QuantLib {
Expand Down Expand Up @@ -68,8 +68,8 @@ namespace QuantLib {
std::unique_ptr<PricingEngine> engine;
switch (exercise_->type()) {
case Exercise::European:
engine.reset(new AnalyticDoubleBarrierEngine(newProcess));
break;
engine = std::make_unique<AnalyticDoubleBarrierEngine>(newProcess);
break;
case Exercise::American:
case Exercise::Bermudan:
QL_FAIL("engine not available for non-European barrier option");
Expand Down
4 changes: 2 additions & 2 deletions ql/experimental/risk/creditriskplus.cpp
Expand Up @@ -119,9 +119,9 @@ namespace QuantLib {
upperIndex_ = 0;

// map of nuC_ to expected loss
std::map<unsigned long, Real, std::less<unsigned long> > epsNuC_;
std::map<unsigned long, Real, std::less<> > epsNuC_;

std::map<unsigned long, Real, std::less<unsigned long> >::iterator iter;
std::map<unsigned long, Real, std::less<> >::iterator iter;

for (Size k = 0; k < m_; ++k) {
auto exUnit = (unsigned long)(std::floor(0.5 + exposure_[k] / unit_)); // round
Expand Down
6 changes: 3 additions & 3 deletions ql/instruments/barrieroption.cpp
Expand Up @@ -19,10 +19,10 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include <ql/exercise.hpp>
#include <ql/instruments/barrieroption.hpp>
#include <ql/instruments/impliedvolatility.hpp>
#include <ql/pricingengines/barrier/analyticbarrierengine.hpp>
#include <ql/exercise.hpp>
#include <memory>

namespace QuantLib {
Expand Down Expand Up @@ -67,8 +67,8 @@ namespace QuantLib {
std::unique_ptr<PricingEngine> engine;
switch (exercise_->type()) {
case Exercise::European:
engine.reset(new AnalyticBarrierEngine(newProcess));
break;
engine = std::make_unique<AnalyticBarrierEngine>(newProcess);
break;
case Exercise::American:
case Exercise::Bermudan:
QL_FAIL("engine not available for non-European barrier option");
Expand Down
12 changes: 6 additions & 6 deletions ql/instruments/dividendvanillaoption.cpp
Expand Up @@ -17,13 +17,13 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include <ql/cashflows/cashflowvectors.hpp>
#include <ql/exercise.hpp>
#include <ql/instruments/dividendvanillaoption.hpp>
#include <ql/instruments/impliedvolatility.hpp>
#include <ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp>
#include <ql/pricingengines/vanilla/fdblackscholesvanillaengine.hpp>
#include <ql/utilities/dataformatters.hpp>
#include <ql/cashflows/cashflowvectors.hpp>
#include <ql/exercise.hpp>
#include <memory>

namespace QuantLib {
Expand Down Expand Up @@ -56,11 +56,11 @@ namespace QuantLib {
std::unique_ptr<PricingEngine> engine;
switch (exercise_->type()) {
case Exercise::European:
engine.reset(new AnalyticDividendEuropeanEngine(newProcess));
break;
engine = std::make_unique<AnalyticDividendEuropeanEngine>(newProcess);
break;
case Exercise::American:
engine.reset(new FdBlackScholesVanillaEngine(newProcess));
break;
engine = std::make_unique<FdBlackScholesVanillaEngine>(newProcess);
break;
case Exercise::Bermudan:
QL_FAIL("engine not available for Bermudan option with dividends");
break;
Expand Down
12 changes: 6 additions & 6 deletions ql/instruments/vanillaoption.cpp
Expand Up @@ -19,11 +19,11 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include <ql/instruments/vanillaoption.hpp>
#include <ql/exercise.hpp>
#include <ql/instruments/impliedvolatility.hpp>
#include <ql/instruments/vanillaoption.hpp>
#include <ql/pricingengines/vanilla/analyticeuropeanengine.hpp>
#include <ql/pricingengines/vanilla/fdblackscholesvanillaengine.hpp>
#include <ql/exercise.hpp>
#include <memory>

namespace QuantLib {
Expand Down Expand Up @@ -53,12 +53,12 @@ namespace QuantLib {
std::unique_ptr<PricingEngine> engine;
switch (exercise_->type()) {
case Exercise::European:
engine.reset(new AnalyticEuropeanEngine(newProcess));
break;
engine = std::make_unique<AnalyticEuropeanEngine>(newProcess);
break;
case Exercise::American:
case Exercise::Bermudan:
engine.reset(new FdBlackScholesVanillaEngine(newProcess));
break;
engine = std::make_unique<FdBlackScholesVanillaEngine>(newProcess);
break;
default:
QL_FAIL("unknown exercise type");
}
Expand Down

0 comments on commit b0c78ed

Please sign in to comment.