conspire/math/assert/eq/owned/
rank_2.rs1use super::super::{AssertEq, eq_impl, eq_within_tols_impl};
2use crate::math::assert::{Assert, AssertionError};
3use crate::math::{TensorRank2, TensorRank2SparseVec, TensorRank2SparseVec2DSymmetric};
4
5impl<const D: usize, I, J> AssertEq<TensorRank2<D, I, J>> for TensorRank2<D, I, J> {
6 fn eq(a: Self, b: TensorRank2<D, I, J>) -> Result<(), AssertionError> {
7 eq_impl(&a, &b)
8 }
9 fn eq_within_tols(
10 tols: &Assert,
11 a: Self,
12 b: TensorRank2<D, I, J>,
13 ) -> Result<(), AssertionError> {
14 eq_within_tols_impl(tols, &a, &b)
15 }
16}
17
18impl<const D: usize, I, J> AssertEq<TensorRank2SparseVec<D, I, J>>
19 for TensorRank2SparseVec<D, I, J>
20{
21 fn eq(a: Self, b: TensorRank2SparseVec<D, I, J>) -> Result<(), AssertionError> {
22 eq_impl(&a, &b)
23 }
24 fn eq_within_tols(
25 tols: &Assert,
26 a: Self,
27 b: TensorRank2SparseVec<D, I, J>,
28 ) -> Result<(), AssertionError> {
29 eq_within_tols_impl(tols, &a, &b)
30 }
31}
32
33impl<const D: usize, I, J> AssertEq<TensorRank2SparseVec2DSymmetric<D, I, J>>
34 for TensorRank2SparseVec2DSymmetric<D, I, J>
35{
36 fn eq(a: Self, b: TensorRank2SparseVec2DSymmetric<D, I, J>) -> Result<(), AssertionError> {
37 eq_impl(&a, &b)
38 }
39 fn eq_within_tols(
40 tols: &Assert,
41 a: Self,
42 b: TensorRank2SparseVec2DSymmetric<D, I, J>,
43 ) -> Result<(), AssertionError> {
44 eq_within_tols_impl(tols, &a, &b)
45 }
46}