pub struct DiffGraph {
pub nodes: Vec<DiffNode>,
pub root: NodeId,
pub degrees: Vec<u32>,
}Expand description
An expression graph homogeneous in differences of point coordinates.
Children come before their parents. The graph is a faithful image of the
source: 0 - x becomes Neg(x), and nothing is folded or reordered.
Fields§
§nodes: Vec<DiffNode>The nodes, in dependency order.
root: NodeIdThe node holding the value of the whole expression.
degrees: Vec<u32>Degree of each node: 1 for a leaf, the sum for a product, the common degree for a sum or difference, and the degree of its operand for a negation.
Implementations§
Source§impl DiffGraph
impl DiffGraph
Sourcepub fn axis_degrees(&self) -> Option<[u32; 3]>
pub fn axis_degrees(&self) -> Option<[u32; 3]>
The degree of the form in the differences of each axis, if the form
is multihomogeneous: every sum and difference combines nodes of the
same degree in x, in y and in z, so every term of the result has the
returned degrees. Returns None otherwise, as for a sum of squares
over the three axes.
The test is on the graph as written: a form whose expansion is
multihomogeneous but that sums nodes of different degree vectors on
the way is reported as None, which only keeps it on the global
form of the filter bound.