1use super::math_node::NodeIndex;
2use std::fmt;
3
4#[derive(Default, Debug, Clone, Eq, PartialEq)]
5pub struct OpNode {
6 pub op: Option<Op>,
7 pub parent: Option<NodeIndex>,
8}
9
10impl fmt::Display for OpNode {
11 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12 write!(f, "op: {:?}, parent: {:?}", self.op, self.parent)
13 }
14}
15
16#[derive(Debug, Eq, PartialEq, Clone)]
17pub enum Op {
18 Factorial,
19 Minus,
20 Abs,
21 Conjugate,
22 Arg,
23 Real,
24 Imaginary,
25 Floor,
26 Ceiling,
27 Not,
28 Inverse,
29 Ident,
30 Domain,
31 Codomain,
32 Image,
33 Sin,
34 Cos,
35 Tan,
36 Sec,
37 Csc,
38 Cot,
39 Sinh,
40 Cosh,
41 Tanh,
42 Sech,
43 Csch,
44 Coth,
45 Arcsin,
46 Arccos,
47 Arctan,
48 Arccosh,
49 Arccot,
50 Arccoth,
51 Arccsc,
52 Arccsch,
53 Arcsec,
54 Arcsech,
55 Arcsinh,
56 Arctanh,
57 Exp,
58 Ln,
59 Log,
60 Determinant,
61 Transpose,
62 Divergence,
63 Grad,
64 Curl,
65 Laplacian,
66 Card,
67 Quotient,
68 Divide,
69 Power,
70 Rem,
71 Implies,
72 Equivalent,
73 Approx,
74 Setdiff,
75 Vectorproduct,
76 Scalarproduct,
77 Outerproduct,
78 Plus,
79 Times,
80 Max,
81 Min,
82 Gcd,
83 Lcm,
84 Mean,
85 Sdev,
86 Variance,
87 Median,
88 Mode,
89 And,
90 Or,
91 Xor,
92 Selector,
93 Union,
94 Intersect,
95 Cartesianproduct,
96 Compose,
97 r#Fn,
98 Int,
99 Sum,
100 Product,
101 Diff,
102 Partialdiff,
103 Forall,
104 Exists,
105 Eq,
106 Neq,
107 Gt,
108 Lt,
109 Geq,
110 Leq,
111 Root,
112}