Switch, candidate topology, rebuild reference and state clauses.
More...
#include <src/include/internal/smooth_cv.hpp>
|
| | Workspace (const RationalSwitch &sw, int maxRing) |
| void | rebuild (const Cloud &cloud, std::vector< int > selected, double skin) |
| bool | built () const |
| bool | stale (const Cloud &cloud) const |
| const Topology & | topology () const |
| const RationalSwitch & | switching () const |
| int | maxRing () const |
| int | stateCount () const |
| void | checkKind (Kind kind, int arg) const |
| double | value (const Cloud &cloud, Kind kind, int arg, double *grad) |
| void | addClause (int state, Kind kind, int arg, double threshold, double width, bool above) |
| void | states (const Cloud &cloud, double *chi, double *grad) |
Switch, candidate topology, rebuild reference and state clauses.
rebuild() lists the selected atoms within dMax + skin with linkcell and fixes the candidate topology. value() 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() reports when that fails. Any type change marks the selection stale so the next rebuild filters again.
Definition at line 228 of file smooth_cv.hpp.
◆ Workspace()
| smooth::Workspace::Workspace |
( |
const RationalSwitch & | sw, |
|
|
int | maxRing ) |
◆ addClause()
| void smooth::Workspace::addClause |
( |
int | state, |
|
|
Kind | kind, |
|
|
int | arg, |
|
|
double | threshold, |
|
|
double | width, |
|
|
bool | above ) |
Appends a factor to state state (state == stateCount() 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.
◆ built()
| bool smooth::Workspace::built |
( |
| ) |
const |
|
inlinenodiscard |
◆ checkKind()
| void smooth::Workspace::checkKind |
( |
Kind | kind, |
|
|
int | arg ) const |
Throws std::invalid_argument when kind and arg do not name a variable of this workspace.
◆ maxRing()
| int smooth::Workspace::maxRing |
( |
| ) |
const |
|
inlinenodiscard |
◆ rebuild()
| void smooth::Workspace::rebuild |
( |
const Cloud & | cloud, |
|
|
std::vector< int > | selected, |
|
|
double | skin ) |
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() true.
◆ stale()
| bool smooth::Workspace::stale |
( |
const Cloud & | cloud | ) |
const |
|
nodiscard |
◆ stateCount()
| int smooth::Workspace::stateCount |
( |
| ) |
const |
|
inlinenodiscard |
Definition at line 245 of file smooth_cv.hpp.
245{ return static_cast<int>(states_.size()); }
◆ states()
| void smooth::Workspace::states |
( |
const Cloud & | cloud, |
|
|
double * | chi, |
|
|
double * | grad ) |
chi of every state; with grad non-null, stateCount() rows of 3 * cloud.nop entries. Throws std::range_error, writing nothing, when a chi or a gradient entry is not finite.
◆ switching()
◆ topology()
| const Topology & smooth::Workspace::topology |
( |
| ) |
const |
|
inlinenodiscard |
◆ value()
| double smooth::Workspace::value |
( |
const Cloud & | cloud, |
|
|
Kind | kind, |
|
|
int | arg, |
|
|
double * | grad ) |
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.
The documentation for this class was generated from the following file: