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, const I: usize, const J: usize> AssertEq<TensorRank2<D, I, J>>
6 for TensorRank2<D, I, J>
7{
8 fn eq(a: Self, b: TensorRank2<D, I, J>) -> Result<(), AssertionError> {
9 eq_impl(&a, &b)
10 }
11 fn eq_within_tols(
12 tols: &Assert,
13 a: Self,
14 b: TensorRank2<D, I, J>,
15 ) -> Result<(), AssertionError> {
16 eq_within_tols_impl(tols, &a, &b)
17 }
18}
19
20impl<const D: usize, const I: usize, const J: usize> AssertEq<TensorRank2SparseVec<D, I, J>>
21 for TensorRank2SparseVec<D, I, J>
22{
23 fn eq(a: Self, b: TensorRank2SparseVec<D, I, J>) -> Result<(), AssertionError> {
24 eq_impl(&a, &b)
25 }
26 fn eq_within_tols(
27 tols: &Assert,
28 a: Self,
29 b: TensorRank2SparseVec<D, I, J>,
30 ) -> Result<(), AssertionError> {
31 eq_within_tols_impl(tols, &a, &b)
32 }
33}
34
35impl<const D: usize, const I: usize, const J: usize>
36 AssertEq<TensorRank2SparseVec2DSymmetric<D, I, J>>
37 for TensorRank2SparseVec2DSymmetric<D, I, J>
38{
39 fn eq(a: Self, b: TensorRank2SparseVec2DSymmetric<D, I, J>) -> Result<(), AssertionError> {
40 eq_impl(&a, &b)
41 }
42 fn eq_within_tols(
43 tols: &Assert,
44 a: Self,
45 b: TensorRank2SparseVec2DSymmetric<D, I, J>,
46 ) -> Result<(), AssertionError> {
47 eq_within_tols_impl(tols, &a, &b)
48 }
49}