Table of Contents

Class CompiledStepColorTree

Namespace
Hi.MachiningProcs
Assembly
HiNc.dll

Internal Use Only. A StepColorTree compiled for evaluation: immutable, its nodes in flat arrays, read by whichever thread classifies a step. Classify(ReadOnlySpan<double>, out double) takes the values of the step properties the tree refers to, one per entry of Keys in that order and NaN for no value, and gives the id of the leaf the step falls into. Made by Compile().

public sealed class CompiledStepColorTree
Inheritance
CompiledStepColorTree
Inherited Members
Extension Methods

Properties

IdHues

The hue, 0 to 1, of each leaf by its id.

public IReadOnlyDictionary<int, double> IdHues { get; }

Property Value

IReadOnlyDictionary<int, double>

Key

The tree's key.

public string Key { get; }

Property Value

string

Keys

The keys of the step properties the tree refers to — every condition's keys and every leaf's value key, each once, in tree order. Classify(ReadOnlySpan<double>, out double) reads its values in this order.

public IReadOnlyList<string> Keys { get; }

Property Value

IReadOnlyList<string>

Leaves

The leaves in tree order.

public IReadOnlyList<CompiledStepColorTree.Leaf> Leaves { get; }

Property Value

IReadOnlyList<CompiledStepColorTree.Leaf>

Name

The tree's name; the key when the tree names none.

public string Name { get; }

Property Value

string

Methods

Classify(ReadOnlySpan<double>, out double)

Finds the leaf a step falls into.

public int? Classify(ReadOnlySpan<double> values, out double leafValue)

Parameters

values ReadOnlySpan<double>

The step's value under each key of Keys, in that order; NaN for no value. A text property is a number when the step has a text and NaN when it has none.

leafValue double

The step's value under the leaf's ValueKey; NaN when the leaf shows none or the step falls into no leaf.

Returns

int?

The id of the leaf, or null when no leaf takes the step.

Exceptions

ArgumentException

values is shorter than Keys.

HasSameLogicAs(CompiledStepColorTree)

Whether other classifies every step as this tree does: the same keys, nodes, ids, conditions and value keys. Names and hues may differ — the two trees then differ in appearance only, and a step classified by one needs no classifying again by the other.

public bool HasSameLogicAs(CompiledStepColorTree other)

Parameters

other CompiledStepColorTree

Returns

bool

HueOf(double?, int)

The hue, 0 to 1, a leaf is drawn with: hue_deg taken modulo 360 when it is a finite number, else the automatic hue of the leaf's id (GetDiscreteHue(int), which keeps off the reds and the deep blues). The one formula, Compile(StepColorTree, IReadOnlyList<StepColorTreeProblem>)'s, for a host that colors a tree it has not compiled.

public static double HueOf(double? hue_deg, int id)

Parameters

hue_deg double?

The leaf's hue in degrees; null, NaN or an infinity is automatic.

id int

The leaf's id.

Returns

double