Skip to content

Commit 1f43393

Browse files
committed
fix: smart pointer issue on calibration history
1 parent c3d1680 commit 1f43393

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/quant/calibration/heston.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::cell::RefCell;
2+
use std::rc::Rc;
23

34
use impl_new_derive::ImplNew;
45
use levenberg_marquardt::{LeastSquaresProblem, LevenbergMarquardt};
@@ -150,7 +151,7 @@ pub struct HestonCalibrator {
150151
/// If true, record per-iteration calibration history.
151152
pub record_history: bool,
152153
/// History of iterations (residuals, params, loss metrics).
153-
calibration_history: RefCell<Vec<CalibrationHistory<HestonParams>>>,
154+
calibration_history: Rc<RefCell<Vec<CalibrationHistory<HestonParams>>>>,
154155
}
155156

156157
impl CalibrationLossExt for HestonCalibrator {}
@@ -602,5 +603,7 @@ mod tests {
602603
);
603604

604605
calibrator.calibrate();
606+
let history = calibrator.history();
607+
println!("{:?}", history);
605608
}
606609
}

0 commit comments

Comments
 (0)