Fix warnings.

This commit is contained in:
2020-04-17 20:39:01 +02:00
parent 81ed582e59
commit 5aaada0c05
11 changed files with 76 additions and 112 deletions

View File

@@ -21,11 +21,11 @@ impl Kernel for Constant {
1
}
fn state_mean(&self, t: f64) -> Array1<f64> {
fn state_mean(&self, _t: f64) -> Array1<f64> {
Array1::zeros(1)
}
fn state_cov(&self, t: f64) -> Array2<f64> {
fn state_cov(&self, _t: f64) -> Array2<f64> {
array![[1.0]] * self.var
}
@@ -37,11 +37,11 @@ impl Kernel for Constant {
array![[0.0]]
}
fn transition(&self, t0: f64, t1: f64) -> Array2<f64> {
fn transition(&self, _t0: f64, _t1: f64) -> Array2<f64> {
array![[1.0]]
}
fn noise_cov(&self, t0: f64, t1: f64) -> Array2<f64> {
fn noise_cov(&self, _t0: f64, _t1: f64) -> Array2<f64> {
array![[0.0]]
}
}

View File

@@ -22,11 +22,11 @@ impl Kernel for Exponential {
1
}
fn state_mean(&self, t: f64) -> Array1<f64> {
fn state_mean(&self, _t: f64) -> Array1<f64> {
Array1::zeros(1)
}
fn state_cov(&self, t: f64) -> Array2<f64> {
fn state_cov(&self, _t: f64) -> Array2<f64> {
array![[1.0]] * self.var
}

View File

@@ -28,11 +28,11 @@ impl Kernel for Matern32 {
2
}
fn state_mean(&self, t: f64) -> Array1<f64> {
fn state_mean(&self, _t: f64) -> Array1<f64> {
Array1::zeros(2)
}
fn state_cov(&self, t: f64) -> Array2<f64> {
fn state_cov(&self, _t: f64) -> Array2<f64> {
let a = self.lambda;
array![[1.0, 0.0], [0.0, a * a]] * self.var

View File

@@ -4,7 +4,7 @@ use super::Kernel;
pub struct Matern52 {
var: f64,
l_scale: f64,
_l_scale: f64,
lambda: f64,
}
@@ -12,7 +12,7 @@ impl Matern52 {
pub fn new(var: f64, l_scale: f64) -> Self {
Matern52 {
var,
l_scale,
_l_scale: l_scale,
lambda: 5.0f64.sqrt() / l_scale,
}
}
@@ -27,11 +27,11 @@ impl Kernel for Matern52 {
3
}
fn state_mean(&self, t: f64) -> Array1<f64> {
fn state_mean(&self, _t: f64) -> Array1<f64> {
Array1::zeros(3)
}
fn state_cov(&self, t: f64) -> Array2<f64> {
fn state_cov(&self, _t: f64) -> Array2<f64> {
let a = self.lambda;
array![