pub struct System<'e, E: Equations> {
pub equations: &'e E,
pub mobility: Vec<Mobility>,
pub scale: Scalar,
}Expand description
A system: its equations, how each block may move — every one a solve
may move, Mobility::Held or Mobility::Follows — and its size.
Fields§
§equations: &'e E§mobility: Vec<Mobility>§scale: ScalarWhat a constraint holds to RELATIVE_TOLERANCE of,
how far one step may go, and what a turn is measured against when a
value stays where it was.
Implementations§
Source§impl<E: Equations> System<'_, E>
impl<E: Equations> System<'_, E>
Sourcepub fn structure(&self, at: &[E::Value]) -> Structure
pub fn structure(&self, at: &[E::Value]) -> Structure
The structure of the system where the blocks are at at: its
groups, the pendants taken off them, in layers (see the module
docs). A term that reads no block, or cannot be made at at, is in
none: nothing can be done about it.
Whether a block’s rows constrain what it hangs off is a question of
rank, decided over a box of steps around at as wide as the
solver’s tolerance, as the enclosure decides its rows (see
System::enclose): where the blocks are, rounding leaves a hair of
a row that depends on the others, which no box holds apart from
zero.
Source§impl<E: Equations> System<'_, E>
impl<E: Equations> System<'_, E>
Sourcepub fn held(&self, at: &[E::Value]) -> GeopResult<Held>
pub fn held(&self, at: &[E::Value]) -> GeopResult<Held>
Which constraints hold at at.
Sourcepub fn solve(&self, start: &[E::Value]) -> GeopResult<Solution<E::Value>>
pub fn solve(&self, start: &[E::Value]) -> GeopResult<Solution<E::Value>>
Where the blocks have to be, from start, for every constraint to
hold, as near where the preferences pull them and, among those, as
near start as the constraints allow — and an enclosure of a true
solution near there.
Layer by layer (see Structure): the cores first, then each
pendant, alone, from where what it hangs off carried it
(Variable::carried) — solved only where its constraints do not
hold there, or where its own freedom has to stay as near where it
was as they let it. A component a pendant of which cannot follow
after all is solved again as one.
The blocks are moved even where the constraints cannot all hold, to
where they come closest; System::held says which do not.
Sourcepub fn proven(
&self,
solution: Solution<E::Value>,
) -> GeopResult<Solution<E::Value>>
pub fn proven( &self, solution: Solution<E::Value>, ) -> GeopResult<Solution<E::Value>>
solution, a solve of it, with the enclosure of every group it
solved (see System::solve).
Sourcepub fn solve_unproven(
&self,
start: &[E::Value],
) -> GeopResult<Solution<E::Value>>
pub fn solve_unproven( &self, start: &[E::Value], ) -> GeopResult<Solution<E::Value>>
System::solve, without the enclosure: its Solution::enclosure
encloses nothing. For a solve whose answer is shown and solved
again at once — an event of a drag — where proving every group it
moved would cost several times the solve; the answer kept is proven.
Sourcepub fn solve_unproven_in(
&self,
start: &[E::Value],
structure: Structure,
) -> GeopResult<Solution<E::Value>>
pub fn solve_unproven_in( &self, start: &[E::Value], structure: Structure, ) -> GeopResult<Solution<E::Value>>
System::solve_unproven in the groups of structure: the
structure a solve of the same system found before, a hair away — an
event of a drag, the last’s — rather than found again, which makes
every term twice. A pendant that cannot follow there after all is
solved with its component, as ever (see System::solve).
Sourcepub fn enclose(&self, at: &[E::Value]) -> GeopResult<Enclosure<E::Value>>
pub fn enclose(&self, at: &[E::Value]) -> GeopResult<Enclosure<E::Value>>
An enclosure of a true solution near at — a solution to the
solver’s tolerance — group by group (see Enclosure).
Sourcepub fn enclose_rest(
&self,
at: &[E::Value],
enclosure: Enclosure<E::Value>,
) -> GeopResult<Enclosure<E::Value>>
pub fn enclose_rest( &self, at: &[E::Value], enclosure: Enclosure<E::Value>, ) -> GeopResult<Enclosure<E::Value>>
enclosure — of the blocks at at, as Solution::enclosure is —
with every group it does not cover enclosed too: what a solve did
not move, where the caller needs every group (see System::enclose).
Sourcepub fn freedom(&self, at: &[E::Value]) -> GeopResult<Freedom>
pub fn freedom(&self, at: &[E::Value]) -> GeopResult<Freedom>
How free the blocks are where they are at at: the directions in
which every constraint that must vanish stays put to first order —
the null space of their Jacobian — and of those, how many move each
block. Decided over the box an enclosure of the solution near at
proves, where one is: a redundant constraint, which looks
independent at a point a hair off the solution, does not take a
freedom away. Where none is proven, at at.
Sourcepub fn conflicting(&self, start: &[E::Value]) -> GeopResult<Vec<usize>>
pub fn conflicting(&self, start: &[E::Value]) -> GeopResult<Vec<usize>>
A smallest set of the constraints that cannot all hold together —
none where they all hold after a solve from start, by index.
Group by group: one whose constraints do not hold after a solve is
enclosed where it ended, and the conflict it proves names the
constraints that cannot hold together with those they depend on (see
EncloseError::Conflict). Where nothing is proven — a singular
configuration — each constraint of the group is left out in turn,
and kept out where the rest still cannot all hold: as many solves as
there are constraints, so for a dialog to show, never for every drag.