Skip to content

Commit 10cd889

Browse files
Replace PartialEq with a manual implementation
1 parent a1614db commit 10cd889

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

pineappl/src/interpolation.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use super::convert;
44
use super::packed_array::PackedArray;
55
use arrayvec::ArrayVec;
6+
use float_cmp::approx_eq;
67
use serde::{Deserialize, Serialize};
78
use std::mem;
89
use std::ops::Range;
@@ -89,7 +90,7 @@ pub enum InterpMeth {
8990
}
9091

9192
/// TODO
92-
#[derive(Clone, Deserialize, PartialEq, Serialize)]
93+
#[derive(Clone, Deserialize, Serialize)]
9394
pub struct Interp {
9495
min: f64,
9596
max: f64,
@@ -100,6 +101,20 @@ pub struct Interp {
100101
interp_meth: InterpMeth,
101102
}
102103

104+
impl PartialEq for Interp {
105+
fn eq(&self, other: &Self) -> bool {
106+
self.nodes == other.nodes
107+
&& self.order == other.order
108+
&& self.reweight == other.reweight
109+
&& self.map == other.map
110+
&& self.interp_meth == other.interp_meth
111+
&& approx_eq!(f64, self.min, other.min, ulps = 1)
112+
&& approx_eq!(f64, self.max, other.max, ulps = 1)
113+
}
114+
}
115+
116+
impl Eq for Interp {}
117+
103118
impl Interp {
104119
/// TODO
105120
///

0 commit comments

Comments
 (0)