<!-- https://docs.dseams.info/api/class_smooth_Workspace.md -->

# class smooth::Workspace {#class-smooth-workspace}

## Overview {#overview}

Switch, candidate topology, rebuild reference and state clauses. [More…](#details-classsmooth-1-1-workspace)

## Detailed Documentation {#detailed-documentation}

Switch, candidate topology, rebuild reference and state clauses.

[rebuild()](#doxid-classsmooth-1-1-workspace-1aba8da0f212fcde5aef425534795acdba) lists the selected atoms within dMax + skin with linkcell and fixes the candidate topology. [value()](#doxid-classsmooth-1-1-workspace-1a7d43094bfc26de24375f17022dd25f94) equals the value after a fresh rebuild (for the gyration kinds, of a compact selection) while no selected atom has moved more than skin / 2 from its position at the rebuild, the cell is unchanged, and every atom type is the type recorded at the rebuild. [stale()](#doxid-classsmooth_1_1_workspace_1a9e6f308e5d75d029eae18599af122c5d) reports when that fails. Any type change marks the selection stale so the next rebuild filters again.

### Methods {#methods}

Lists the graph and builds the topology. selected holds frame indices, ascending and unique. Throws std::invalid_argument when the cell has no volume or dMax + skin is not below half its narrowest width. Throws std::length_error, naming the limit, when the ring or shortcut search exceeds its documented budget. Records every atom type so a later type change makes [stale()](#doxid-classsmooth_1_1_workspace_1a9e6f308e5d75d029eae18599af122c5d) true.

Throws std::invalid_argument when kind and arg do not name a variable of this workspace.

Value of one variable. With grad non-null, 3 * cloud.nop entries of d value / d x are written, zero for unselected atoms. Throws std::range_error, writing nothing, when the value or a gradient entry is not finite.

Appends a factor to state `state` (state == [stateCount()](#doxid-classsmooth_1_1_workspace_1aaebd30b43627dae94973a2f212054547) opens a new state). The factor is sigma((v - threshold) / width) when above is true and 1 - sigma(…) otherwise, sigma the logistic function. With kind State and width 0 the factor is chi_arg or 1 - chi_arg.

chi of every state; with grad non-null, [stateCount()](#doxid-classsmooth_1_1_workspace_1aaebd30b43627dae94973a2f212054547) rows of 3 * cloud.nop entries. Throws std::range_error, writing nothing, when a chi or a gradient entry is not finite.
