pub struct Shapes { /* private fields */ }Expand description
The plan: every formula cell placed on a shape, the order, the cycles.
Implementations§
Source§impl Shapes
impl Shapes
Sourcepub fn of(
model: &Workbook,
sheets: usize,
library: &Library,
names: &Names,
extents: &[Option<((u32, u32), (u32, u32))>],
) -> Shapes
pub fn of( model: &Workbook, sheets: usize, library: &Library, names: &Names, extents: &[Option<((u32, u32), (u32, u32))>], ) -> Shapes
Every formula cell of the sheets 0..sheets placed, the shapes
parsed, and the order found. The plan is made in a box: every formula
is parsed beneath this frame, the deepest a load reaches, which
VLA.1’s limits pin on a stack of 1 MiB, and the plan held here by
value would stand on it, 480 bytes since it kept its level ends
(KERNEL.30).
Sourcepub fn replace(
&mut self,
model: &Workbook,
id: (usize, u32, u32),
library: &Library,
)
pub fn replace( &mut self, model: &Workbook, id: (usize, u32, u32), library: &Library, )
Place one cell after a write: its old place forgotten, and a new one
found when it holds a formula. The order waits for Shapes::plan.
Sourcepub fn plan(
&mut self,
model: &Workbook,
names: &Names,
extents: &[Option<((u32, u32), (u32, u32))>],
)
pub fn plan( &mut self, model: &Workbook, names: &Names, extents: &[Option<((u32, u32), (u32, u32))>], )
The order found again from the places: every formula cell’s edges
read off its shape’s parse at its offset (a defined name’s text read
as graph::dependencies reads it), then Tarjan’s components, as
graph::plan finds them for a plan of texts.
Each shape’s references are read off its parse once (KERNEL.33,
asked by Alonzo’s playtest pass of Sand, whose load spent 341 ms of
491 finding 2.37 million edges a cell at a time): each reference once,
one to a sheet holding no formula left out, one every $ holds found
once for the whole shape; each cell then moves only the rest. A cell’s
vertex is found as reach finds a position, by an array over a sheet
whose formulas stand close together, and the edges are one flat array.
Every cell’s edges are the ones a walk of its parse at its offset
finds, sorted and each once, so the order, its runs and its cycles
are the same.
Sourcepub fn order(&self) -> &[(usize, u32, u32)]
pub fn order(&self) -> &[(usize, u32, u32)]
The formula cells in the order of evaluation, each after everything it reads; the cells of a cycle are not in it.
Sourcepub fn cycles(&self) -> &[Vec<(usize, u32, u32)>]
pub fn cycles(&self) -> &[Vec<(usize, u32, u32)>]
Every cycle, each its cells sorted, the cycles by their first cell.
Sourcepub fn census(&self, model: &Workbook, library: &Library) -> String
pub fn census(&self, model: &Workbook, library: &Library) -> String
The plan printed as rows, the census (KERNEL.30): a (plan ...) row
of totals, a (readers ...) row for each sheet whose changed cells
are checked against readers, then a (shape ...) row for each shape
a cell holds, each read named by the path an engine’s machine takes
for it (super::census). Every sheet is read as a frame’s own, as a
workbook’s are: this is the census of a plan Shapes::of made over
a grid with no .last twin, each sheet kept as an array where a
machine of the same grid keeps it (KERNEL.31, Shapes::keeps_array).
A machine’s, its twins read as it keeps them, is Machine::census.
Computed when asked from the plan as it stands, which keeps nothing
for it but where each level ends and which sheets a read takes as an
array.
Sourcepub fn evaluate(
&self,
env: &dyn Env,
library: &Library,
id: (usize, u32, u32),
) -> Computed
pub fn evaluate( &self, env: &dyn Env, library: &Library, id: (usize, u32, u32), ) -> Computed
One formula cell evaluated against the grid as env shows it, the
cell being computed being env.here().
Sourcepub fn first_refusal(
&self,
model: &Workbook,
only: Option<&[(usize, u32, u32)]>,
) -> Option<((usize, u32, u32), Refusal)>
pub fn first_refusal( &self, model: &Workbook, only: Option<&[(usize, u32, u32)]>, ) -> Option<((usize, u32, u32), Refusal)>
The first thing that stops the grid from being stepped, in the order
super::Calc::first_refusal asks it: a cycle (calc-cycle), the
first cell calling a function the library does not hold
(calc-function-not-computed), the first cell whose text this
version does not read (calc-construct-not-read); with the cell the
refusal stands on, for its line. only limits the second and third
to the cells a write placed.