Skip to content

Commit 6a1706f

Browse files
Revert "Fixes Size -> double conversion warnings with VC++ and higher warning level"
This reverts commit a723850.
1 parent d7de07f commit 6a1706f

17 files changed

Lines changed: 22 additions & 22 deletions

File tree

ql/experimental/catbonds/montecarlocatbondengine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ namespace QuantLib {
109109
}
110110
pathCount++;
111111
}
112-
lossProbability/=Real(pathCount);
113-
exhaustionProbability/=Real(pathCount);
114-
expectedLoss/=Real(pathCount);
112+
lossProbability/=pathCount;
113+
exhaustionProbability/=pathCount;
114+
expectedLoss/=pathCount;
115115
return totalNPV/(pathCount*discountCurve_->discount(npvDate));
116116
}
117117

ql/experimental/credit/homogeneouspooldef.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace QuantLib {
142142
detachAmount_);
143143
//notional_);
144144
std::vector<Real> mkft(1, min_ + delta_ /2.);
145-
for (Real i = 0; i < nSteps_; i++) {
145+
for (Size i = 0; i < nSteps_; i++) {
146146
std::vector<Real> conditionalProbs;
147147
for(Size iName=0; iName<notionals_.size(); iName++)
148148
conditionalProbs.push_back(

ql/experimental/credit/inhomogeneouspooldef.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace QuantLib {
151151
detachAmount_);
152152
//notional_);
153153
std::vector<Real> mkft(1, min_ + delta_ /2.);
154-
for (Real i = 0; i < nSteps_; i++) {
154+
for (Size i = 0; i < nSteps_; i++) {
155155
std::vector<Real> conditionalProbs;
156156
for(Size iName=0; iName<notionals_.size(); iName++)
157157
conditionalProbs.push_back(

ql/experimental/exoticoptions/mchimalayaengine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace QuantLib {
5555
remainingAssets[removeAsset] = false;
5656
averagePrice += bestPrice;
5757
}
58-
averagePrice /= Real(std::min(fixings, numAssets));
58+
averagePrice /= std::min(fixings, numAssets);
5959

6060
Real payoff = (*payoff_)(averagePrice);
6161
return payoff * discount_;

ql/experimental/exoticoptions/mcpagodaengine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace QuantLib {
3838
(multiPath[j][i]/multiPath[j][i-1] - 1.0);
3939
}
4040
}
41-
averagePerformance /= Real(numAssets);
41+
averagePerformance /= numAssets;
4242

4343
return discount_ * fraction_
4444
* std::max<Real>(0.0, std::min(roof_, averagePerformance));

ql/experimental/mcbasket/longstaffschwartzmultipathpricer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ namespace QuantLib {
256256
sumOptimized += lsExercise[j] ? exercise[j] : prices[j];
257257
}
258258

259-
sumOptimized /= Real(n);
260-
sumNoExercise /= Real(n);
261-
sumAlwaysExercise /= Real(n);
259+
sumOptimized /= n;
260+
sumNoExercise /= n;
261+
sumAlwaysExercise /= n;
262262

263263
QL_TRACE( "Time index: " << i
264264
<< ", LowerBound: " << lowerBounds_[i + 1]

ql/models/equity/hestonslvmcmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ namespace QuantLib {
173173
for (Size j=s; j < e; ++j) {
174174
sum+=pairs[j].second;
175175
}
176-
sum/=Real(inc);
176+
sum/=inc;
177177

178178
vStrikes[n]->at(i) = 0.5*(pairs[e-1].first + pairs[s].first);
179179
(*L)[i][n] = std::sqrt(squared(localVol_->localVol(t, vStrikes[n]->at(i), true))/sum);

ql/models/marketmodels/evolvers/volprocesses/squarerootandersen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ QuantLib
145145
for (Size k=0; k < numberSubSteps_; ++k)
146146
stepVariance += w1_*vPath_[k+lastStepStart]+w2_*vPath_[k+lastStepStart+1];
147147

148-
stepVariance /= Real(numberSubSteps_);
148+
stepVariance /= numberSubSteps_;
149149

150150
return std::sqrt(stepVariance);
151151
}

ql/models/marketmodels/pathwisegreeks/swaptionpseudojacobian.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ namespace QuantLib
291291

292292
}
293293

294-
guess/=Real(numberCaplets);
294+
guess/=numberCaplets;
295295

296296

297297
for (Size step =0; step < inputModel->evolution().numberOfSteps(); ++step)

ql/models/volatility/garch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ namespace QuantLib {
338338
}
339339
}
340340
if (nn > 0)
341-
gamma /= Real(nn);
341+
gamma /= nn;
342342
if (gamma < gammaLower) gamma = gammaLower;
343343
beta = std::min(gamma, std::max(gamma * (1 - A) - B, 0.0));
344344
omega = mean_r2 * (1 - gamma);

0 commit comments

Comments
 (0)