Skip to content

Commit f1a93ea

Browse files
pcaspersjenkins
authored andcommitted
QPR-11984 fix
1 parent 36c3ff7 commit f1a93ea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

QuantExt/qle/math/randomvariable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ RandomVariable::RandomVariable(const QuantLib::Array& array, const Real time) {
346346
if (n_ != 0) {
347347
data_ = new double[n_];
348348
// std::memcpy(data_, array.begin(), n_ * sizeof(double));
349-
std::copy(array.begin(),array.end(), data_);
349+
std::copy(array.begin(), array.end(), data_);
350350
} else {
351351
data_ = nullptr;
352352
}
@@ -366,7 +366,7 @@ void RandomVariable::copyToArray(QuantLib::Array& array) const {
366366
std::fill(array.begin(), array.end(), constantData_);
367367
else if (n_ != 0) {
368368
// std::memcpy(array.begin(), data_, n_ * sizeof(double));
369-
std::copy(array.begin(),array.end(), data_);
369+
std::copy(data_, data_ + n_, array.begin());
370370
}
371371
}
372372

0 commit comments

Comments
 (0)