conspire/math/tensor/configuration/mod.rs
1/// The configuration a tensor index belongs to.
2///
3/// Indices may only be contracted when their configurations agree, which is
4/// checked when the tensor operations are compiled rather than when they run.
5pub trait Configuration {}
6
7macro_rules! configurations {
8 ($($(#[$meta:meta])* $name:ident),+ $(,)?) => {
9 $(
10 $(#[$meta])*
11 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
12 pub struct $name;
13 impl Configuration for $name {}
14 )+
15 };
16}
17
18configurations!(
19 /// The reference configuration.
20 Reference,
21 /// The current configuration.
22 Current,
23 /// An intermediate configuration.
24 Intermediate,
25 /// A second intermediate configuration.
26 Auxiliary,
27 /// The space a composite element projects onto.
28 Projection,
29 /// The shared index of a factorization.
30 Factor,
31 /// The second index of a flattened higher-rank tensor.
32 Flattened,
33);