|
NEML2 2.1.0
|
#include <VariableStore.h>

Public Types | |
| using | VariableStorage = std::map<VariableName, std::unique_ptr<VariableBase>> |
| using | DerivSparsity = std::vector<std::pair<VariableBase *, const VariableBase *>> |
| using | SecDerivSparsity |
Public Member Functions | |
| VariableStore (Model *object) | |
| VariableStore (const VariableStore &)=delete | |
| VariableStore (VariableStore &&)=delete | |
| VariableStore & | operator= (const VariableStore &)=delete |
| VariableStore & | operator= (VariableStore &&)=delete |
| virtual | ~VariableStore ()=default |
| LabeledAxis & | declare_axis (const std::string &name) |
| const TensorOptions & | variable_options () const |
| Current tensor options for variables. | |
| virtual void | zero_undefined_input () |
| Fill undefined input variables with zeros. | |
| LabeledAxis & | input_axis () |
| const LabeledAxis & | input_axis () const |
| LabeledAxis & | output_axis () |
| const LabeledAxis & | output_axis () const |
| VariableStorage & | input_variables () |
| const VariableStorage & | input_variables () const |
| VariableStorage & | output_variables () |
| const VariableStorage & | output_variables () const |
| VariableBase & | input_variable (const VariableName &) |
| const VariableBase & | input_variable (const VariableName &) const |
| VariableBase & | output_variable (const VariableName &) |
| const VariableBase & | output_variable (const VariableName &) const |
| virtual void | clear_input () |
| virtual void | clear_output () |
| virtual void | clear_derivatives () |
| void | cache_derivative_sparsity () |
| void | cache_second_derivative_sparsity () |
| Cache sparsity of second derivatives. | |
| const std::optional< DerivSparsity > & | derivative_sparsity () const |
| Derivative sparsity. | |
| const std::optional< SecDerivSparsity > & | second_derivative_sparsity () const |
| Second derivative sparsity. | |
| void | assign_input (const ValueMap &vals) |
| void | assign_input (const std::vector< VariableName > &, const SparseTensorList &) |
| Assign input variable values for the given variable names. | |
| void | assign_output (const ValueMap &vals) |
| Assign output variable values. | |
| void | assign_output (const std::vector< VariableName > &, const SparseTensorList &) |
| Assign output variable values for the given variable names. | |
| void | assign_output_derivatives (const DerivMap &derivs) |
| Assign variable derivatives. | |
| void | assign_output_derivatives (const std::vector< VariableName > &, const std::vector< VariableName > &, const SparseTensorList &) |
| Assign variable derivatives for the given variable names. | |
| ValueMap | collect_input () const |
| SparseTensorList | collect_input (const std::vector< VariableName > &) const |
| Collect input variable values for the given variable names. | |
| ValueMap | collect_output () const |
| Collect output variable values. | |
| SparseTensorList | collect_output (const std::vector< VariableName > &) const |
| Collect output variable values for the given variable names. | |
| DerivMap | collect_output_derivatives () const |
| Collect variable derivatives. | |
| SparseTensorList | collect_output_derivatives (const std::vector< VariableName > &, const std::vector< VariableName > &) const |
| Collect variable derivatives for the given variable names. | |
| SecDerivMap | collect_output_second_derivatives () const |
| Collect variable second derivatives. | |
Protected Member Functions | |
| virtual void | send_variables_to (const TensorOptions &options) |
| Send padding variables to options. | |
| template<typename T> | |
| const Variable< T > & | declare_input_variable (const char *name, bool allow_duplicate=false) |
| Declare an input variable. | |
| template<typename T> | |
| const Variable< T > & | declare_input_variable (const VariableName &name, bool allow_duplicate=false) |
| Declare an input variable. | |
| template<typename T> | |
| Variable< T > & | declare_output_variable (const char *name) |
| Declare an output variable. | |
| template<typename T> | |
| Variable< T > & | declare_output_variable (const VariableName &name) |
| Declare an output variable. | |
| const VariableBase * | clone_input_variable (const VariableBase &var, const VariableName &new_name={}) |
| Clone a variable and put it on the input axis. | |
| VariableBase * | clone_output_variable (const VariableBase &var, const VariableName &new_name={}) |
| Clone a variable and put it on the output axis. | |
| void | assign_input_stack (jit::Stack &stack) |
| Assign stack to input variables. | |
| void | assign_output_stack (jit::Stack &stack, bool out, bool dout, bool d2out) |
| Assign stack to output variables and derivatives. | |
| jit::Stack | collect_input_stack () const |
| Collect stack from input variables. | |
| jit::Stack | collect_output_stack (bool out, bool dout, bool d2out) const |
| Collect stack from output variables and derivatives. | |
Friends | |
| template<typename T> | |
| const T & | resolve_tensor_name (const TensorName< T > &, Model *, const std::string &) |
| using DerivSparsity = std::vector<std::pair<VariableBase *, const VariableBase *>> |
| using SecDerivSparsity |
| using VariableStorage = std::map<VariableName, std::unique_ptr<VariableBase>> |
| VariableStore | ( | Model * | object | ) |
|
delete |
|
delete |
|
virtualdefault |
| void assign_input | ( | const std::vector< VariableName > & | , |
| const SparseTensorList & | ) |
Assign input variable values for the given variable names.
| void assign_input | ( | const ValueMap & | vals | ) |
Assign input variable values
|
protected |
Assign stack to input variables.
| void assign_output | ( | const std::vector< VariableName > & | , |
| const SparseTensorList & | ) |
Assign output variable values for the given variable names.
| void assign_output | ( | const ValueMap & | vals | ) |
Assign output variable values.
| void assign_output_derivatives | ( | const DerivMap & | derivs | ) |
Assign variable derivatives.
| void assign_output_derivatives | ( | const std::vector< VariableName > & | , |
| const std::vector< VariableName > & | , | ||
| const SparseTensorList & | ) |
Assign variable derivatives for the given variable names.
|
protected |
Assign stack to output variables and derivatives.
| void cache_derivative_sparsity | ( | ) |
Cache sparsity of first derivatives
| void cache_second_derivative_sparsity | ( | ) |
Cache sparsity of second derivatives.
|
virtual |
|
virtual |
Release allocated tensor
Reimplemented in Model.
|
virtual |
Reimplemented in Model.
|
protected |
Clone a variable and put it on the input axis.
|
protected |
Clone a variable and put it on the output axis.
| ValueMap collect_input | ( | ) | const |
Collect input variable values
| SparseTensorList collect_input | ( | const std::vector< VariableName > & | ) | const |
Collect input variable values for the given variable names.
|
protected |
Collect stack from input variables.
| ValueMap collect_output | ( | ) | const |
Collect output variable values.
| SparseTensorList collect_output | ( | const std::vector< VariableName > & | ) | const |
Collect output variable values for the given variable names.
| DerivMap collect_output_derivatives | ( | ) | const |
Collect variable derivatives.
| SparseTensorList collect_output_derivatives | ( | const std::vector< VariableName > & | , |
| const std::vector< VariableName > & | ) const |
Collect variable derivatives for the given variable names.
| SecDerivMap collect_output_second_derivatives | ( | ) | const |
Collect variable second derivatives.
|
protected |
Collect stack from output variables and derivatives.
| LabeledAxis & declare_axis | ( | const std::string & | name | ) |
|
protected |
|
protected |
|
protected |
|
protected |
| const std::optional< DerivSparsity > & derivative_sparsity | ( | ) | const |
Derivative sparsity.
| LabeledAxis & input_axis | ( | ) |
Input axis describing the assembly layout of input variables
| const LabeledAxis & input_axis | ( | ) | const |
| VariableBase & input_variable | ( | const VariableName & | ) |
Lookup a variable by name
| const VariableBase & input_variable | ( | const VariableName & | ) | const |
|
inline |
Variables
|
inline |
|
delete |
|
delete |
| LabeledAxis & output_axis | ( | ) |
Output axis describing the assembly layout of output variables
| const LabeledAxis & output_axis | ( | ) | const |
| VariableBase & output_variable | ( | const VariableName & | ) |
| const VariableBase & output_variable | ( | const VariableName & | ) | const |
|
inline |
|
inline |
| const std::optional< SecDerivSparsity > & second_derivative_sparsity | ( | ) | const |
Second derivative sparsity.
|
protectedvirtual |
Send padding variables to options.
| options | The target options |
|
inline |
Current tensor options for variables.
|
virtual |
Fill undefined input variables with zeros.
Reimplemented in Model.
|
friend |