Change ns and xs to be a vec instead of array
This commit is contained in:
@@ -14,8 +14,8 @@ pub struct RecursiveFitter {
|
||||
ts: Vec<f64>,
|
||||
ms: Vec<f64>, // TODO Replace with a vec
|
||||
vs: Array1<f64>, // TODO Replace with a vec
|
||||
ns: ArrayD<f64>, // TODO Replace with a vec
|
||||
xs: ArrayD<f64>, // TODO Replace with a vec
|
||||
ns: Vec<f64>, // TODO Replace with a vec
|
||||
xs: Vec<f64>, // TODO Replace with a vec
|
||||
is_fitted: bool,
|
||||
h: Array1<f64>,
|
||||
i: Array2<f64>,
|
||||
@@ -40,8 +40,8 @@ impl RecursiveFitter {
|
||||
ts: Vec::new(),
|
||||
ms: Vec::new(),
|
||||
vs: Array1::zeros(0),
|
||||
ns: Array::zeros(0).into_dyn(),
|
||||
xs: Array::zeros(0).into_dyn(),
|
||||
ns: Vec::new(),
|
||||
xs: Vec::new(),
|
||||
is_fitted: true,
|
||||
h,
|
||||
i: Array::eye(m),
|
||||
@@ -99,13 +99,11 @@ impl Fitter for RecursiveFitter {
|
||||
}
|
||||
|
||||
// Usual variables.
|
||||
let zeros = Array::zeros(n_new).into_dyn();
|
||||
|
||||
self.ts.extend(self.ts_new.iter());
|
||||
self.ms.extend(iter::repeat(0.0).take(n_new));
|
||||
self.vs = stack![Axis(0), self.vs, self.kernel.k_diag(&self.ts_new)];
|
||||
self.ns = stack![Axis(0), self.ns, zeros];
|
||||
self.xs = stack![Axis(0), self.xs, zeros];
|
||||
self.ns.extend(iter::repeat(0.0).take(n_new));
|
||||
self.xs.extend(iter::repeat(0.0).take(n_new));
|
||||
|
||||
// Initialize the predictive, filtering and smoothing distributions.
|
||||
for t in &self.ts_new {
|
||||
|
||||
Reference in New Issue
Block a user