Skip to main content

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

1use super::super::{AssertFd, eq_within_fd_tol_impl};
2use crate::math::assert::{Assert, AssertionError};
3use crate::math::{TensorRank0, TensorRank0List, TensorRank0List2D};
4
5impl AssertFd<TensorRank0> for TensorRank0 {
6    fn eq_within_fd_tol(tols: &Assert, a: Self, b: TensorRank0) -> Result<(), AssertionError> {
7        eq_within_fd_tol_impl(tols, &a, &b)
8    }
9}
10
11impl<const N: usize> AssertFd<TensorRank0List<N>> for TensorRank0List<N> {
12    fn eq_within_fd_tol(
13        tols: &Assert,
14        a: Self,
15        b: TensorRank0List<N>,
16    ) -> Result<(), AssertionError> {
17        eq_within_fd_tol_impl(tols, &a, &b)
18    }
19}
20
21impl<const N: usize> AssertFd<TensorRank0List2D<N>> for TensorRank0List2D<N> {
22    fn eq_within_fd_tol(
23        tols: &Assert,
24        a: Self,
25        b: TensorRank0List2D<N>,
26    ) -> Result<(), AssertionError> {
27        eq_within_fd_tol_impl(tols, &a, &b)
28    }
29}