Skip to main content

conspire/math/assert/fd_eq/owned/
rank_2.rs

1use super::super::{AssertFd, eq_within_fd_tol_impl};
2use crate::math::assert::{Assert, AssertionError};
3use crate::math::{
4    TensorRank2, TensorRank2SparseVec2D, TensorRank2SparseVec2DSymmetric, TensorRank2Vec,
5    TensorRank2Vec2D,
6};
7
8impl<const D: usize, I, J> AssertFd<TensorRank2<D, I, J>> for TensorRank2<D, I, J> {
9    fn eq_within_fd_tol(
10        tols: &Assert,
11        a: Self,
12        b: TensorRank2<D, I, J>,
13    ) -> Result<(), AssertionError> {
14        eq_within_fd_tol_impl(tols, &a, &b)
15    }
16}
17
18impl<const D: usize, I, J> AssertFd<TensorRank2Vec<D, I, J>> for TensorRank2Vec<D, I, J> {
19    fn eq_within_fd_tol(
20        tols: &Assert,
21        a: Self,
22        b: TensorRank2Vec<D, I, J>,
23    ) -> Result<(), AssertionError> {
24        eq_within_fd_tol_impl(tols, &a, &b)
25    }
26}
27
28impl<const D: usize, I, J> AssertFd<TensorRank2Vec2D<D, I, J>> for TensorRank2Vec2D<D, I, J> {
29    fn eq_within_fd_tol(
30        tols: &Assert,
31        a: Self,
32        b: TensorRank2Vec2D<D, I, J>,
33    ) -> Result<(), AssertionError> {
34        eq_within_fd_tol_impl(tols, &a, &b)
35    }
36}
37
38impl<const D: usize, I, J> AssertFd<TensorRank2SparseVec2D<D, I, J>>
39    for TensorRank2SparseVec2D<D, I, J>
40{
41    fn eq_within_fd_tol(
42        tols: &Assert,
43        a: Self,
44        b: TensorRank2SparseVec2D<D, I, J>,
45    ) -> Result<(), AssertionError> {
46        eq_within_fd_tol_impl(tols, &a, &b)
47    }
48}
49
50impl<const D: usize, I, J> AssertFd<TensorRank2SparseVec2DSymmetric<D, I, J>>
51    for TensorRank2SparseVec2DSymmetric<D, I, J>
52{
53    fn eq_within_fd_tol(
54        tols: &Assert,
55        a: Self,
56        b: TensorRank2SparseVec2DSymmetric<D, I, J>,
57    ) -> Result<(), AssertionError> {
58        eq_within_fd_tol_impl(tols, &a, &b)
59    }
60}