Skip to main content

System

Struct System 

Source
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: Scalar

What 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>

Source

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>

Source

pub fn held(&self, at: &[E::Value]) -> GeopResult<Held>

Which constraints hold at at.

Source

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.

Source

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).

Source

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.

Source

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).

Source

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).

Source

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).

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'e, E> Freeze for System<'e, E>

§

impl<'e, E> RefUnwindSafe for System<'e, E>
where E: RefUnwindSafe,

§

impl<'e, E> Send for System<'e, E>
where E: Sync,

§

impl<'e, E> Sync for System<'e, E>
where E: Sync,

§

impl<'e, E> Unpin for System<'e, E>

§

impl<'e, E> UnsafeUnpin for System<'e, E>

§

impl<'e, E> UnwindSafe for System<'e, E>
where E: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.