opensrdk_symbolic_computation/expression/tensor_expression/
tex_code.rs

1use crate::{BracketsLevel, TensorExpression};
2use std::collections::HashMap;
3
4impl TensorExpression {
5    pub fn _tex_code(
6        &self,
7        symbols: &HashMap<&str, &str>,
8        brackets_level: BracketsLevel,
9    ) -> String {
10        match self {
11            TensorExpression::KroneckerDeltas(rank_pairs) => {
12                TensorExpression::tex_code_kronecker_deltas(rank_pairs, brackets_level)
13            }
14            TensorExpression::DotProduct {
15                terms,
16                rank_combinations,
17            } => TensorExpression::tex_code_dot_product(terms, rank_combinations, symbols),
18            TensorExpression::DirectProduct(terms) => {
19                TensorExpression::tex_code_direct_product(terms, symbols, brackets_level)
20            }
21        }
22    }
23
24    pub fn tex_code(&self, symbols: &HashMap<&str, &str>) -> String {
25        self._tex_code(symbols, BracketsLevel::None)
26    }
27}