MCPcopy Create free account
hub / github.com/daniel-e/rustml / similar

Method similar

src/matrix.rs:94–98  ·  view source on GitHub ↗
(&self, e: &Self, epsilon: T)

Source from the content-addressed store, hash-verified

92impl <T: Clone + Signed + Float> Similar<T> for Matrix<T> {
93
94 fn similar(&self, e: &Self, epsilon: T) -> bool {
95
96 assert!(self.rows() == e.rows() && self.cols() == e.cols(), "Dimensions of matrices do not match.");
97 self.values().zip(e.values()).all(|(&x, &y)| num::abs(x - y) <= epsilon)
98 }
99}
100
101impl <T: Clone + Signed + Float> Similar<T> for Vec<T> {

Callers

nothing calls this directly

Calls 2

valuesMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected