|
Minsky: 3.17.0
|
#include <variableValue.h>


Public Member Functions | |
| bool | lhs () const |
| variable has an input port More... | |
| bool | temp () const |
| variable is a temporary More... | |
| bool | isFlowVar () const |
| returns true if variable's data is allocated on the flowVariables vector More... | |
| bool | isZero () const |
| VariableType::Type | type () const |
| value at the ith location of the vector/tensor. Default, (i=0) is right for scalar quantities More... | |
| double | valueAt (size_t i) const |
| double | value () const |
| set the value at the ith location More... | |
| double | setValue (size_t i, double x) |
| double | setValue (double x) |
| int | idx () const |
| void | reset_idx () |
| double | operator[] (std::size_t i) const override |
| double & | operator[] (std::size_t i) override |
| const Index & | index (Index &&i) override |
| template<class T > | |
| void | hypercube_ (T x) |
| bool | idxInRange () const |
| const Hypercube & | hypercube () const override |
| const Hypercube & | hypercube (const Hypercube &hc) override |
| const Hypercube & | hypercube (Hypercube &&hc) override |
| VariableValue (VariableType::Type type=VariableType::undefined, const std::string &name="", const GroupPtr &group=GroupPtr()) | |
| VariableValue (VariableType::Type type, const VariableValue &vv) | |
| VariableValue (const VariableValue &)=delete | |
| void | operator= (const VariableValue &)=delete |
| VariableValue & | operator= (TensorVal const &) |
| VariableValue & | operator= (const ITensor &x) override |
| VariableValue & | allocValue () |
| allocate space in the variable vector. More... | |
| std::string | valueId () const |
| void | exportAsCSV (const std::string &filename, const std::string &comment="", bool tabular=false) const |
| export this to a CSV file. If comment is non-empty, it is written as the first line of the file. If tabular is false, there is one data point per line, if true, the the longest dimension is written as a series on the line. More... | |
| Summary | summary () const |
| const std::string & | init () const |
| const std::string & | init (const std::string &x) |
| void | sliderSet (double x) |
| sets variable value (or init value) More... | |
| void | incrSlider (double step) |
| increment slider by step More... | |
| void | adjustSliderBounds () |
| adjust slider bounds to encompass the current value More... | |
Public Member Functions inherited from minsky::VariableValueData | |
| void | setUnits (const std::string &x) |
Public Member Functions inherited from minsky::Slider | |
| double | maxSliderSteps () const |
| ensure there are at most 10000 steps between sliderMin and Max. see ticket 1255. More... | |
Protected Attributes | |
| std::string | m_init |
| the initial value of this variable More... | |
Private Member Functions | |
| CLASSDESC_ACCESS (VariableValue) | |
| double & | valRef () |
| index into value vector More... | |
| const double & | valRef () const |
| ITensor::Timestamp | timestamp () const override |
Private Attributes | |
| Type | m_type |
| int | m_idx =-1 |
Friends | |
| class | VariableManager |
| struct | SchemaHelper |
Additional Inherited Members | |
Public Types inherited from minsky::VariableType | |
| enum | Type { undefined, constant, parameter, flow, integral, stock, tempFlow, numVarTypes } |
Static Public Member Functions inherited from minsky::VariableType | |
| static std::string | typeName (int t) |
Public Attributes inherited from minsky::VariableValueData | |
| TensorVal | tensorInit |
| when init is a tensor of values, this overrides the init string More... | |
| TensorPtr | rhs |
| when the RHS is attached to a tensor expression, this is a reference to it More... | |
| Units | units |
| dimension units of this value More... | |
| bool | unitsCached =false |
| std::string | detailedText |
| long and short descriptions - common to all variables of a given name More... | |
| std::string | tooltip |
| bool | godleyOverridden =false |
| std::string | name |
| classdesc::Exclude< std::weak_ptr< Group > > | m_scope |
| CSVDialog | csvDialog |
| for importing CSV files More... | |
Public Attributes inherited from minsky::Slider | |
| bool | sliderStepRel =false |
| double | sliderMin =std::numeric_limits<double>::max() |
| double | sliderMax =-sliderMin |
| double | sliderStep =0 |
| bool | enableSlider =true |
Definition at line 70 of file variableValue.h.
|
inline |
Definition at line 156 of file variableValue.h.
References minsky::group, and minsky::scope().

|
inline |
Definition at line 163 of file variableValue.h.
References init().

|
delete |
| void minsky::VariableValue::adjustSliderBounds | ( | ) |
adjust slider bounds to encompass the current value
Definition at line 237 of file variableValue.cc.
References minsky::anonymous_namespace{userFunction.cc}::isfinite(), and minsky::anonymous_namespace{userFunction.cc}::isnan().

| VariableValue & minsky::VariableValue::allocValue | ( | ) |
allocate space in the variable vector.
Definition at line 121 of file variableValue.cc.
Referenced by minsky::VariableValues::reset(), and minsky::VariableValues::resetValue().

|
private |
| void minsky::VariableValue::exportAsCSV | ( | const std::string & | filename, |
| const std::string & | comment = "", |
||
| bool | tabular = false |
||
| ) | const |
export this to a CSV file. If comment is non-empty, it is written as the first line of the file. If tabular is false, there is one data point per line, if true, the the longest dimension is written as a series on the line.
Definition at line 417 of file variableValue.cc.
References minsky::CSVQuote(), minsky::anonymous_namespace{userFunction.cc}::isfinite(), and minsky::str().
Referenced by minsky::Sheet::exportAsCSV(), and minsky::Ravel::exportAsCSV().


|
override |
Definition at line 213 of file variableValue.cc.
References minsky::cminsky(), minsky::Minsky::definingVar(), and minsky::valueId().
Referenced by minsky::Ravel::exportAsCSV(), minsky::loadValueFromCSVFileT(), and minsky::Minsky::populateMissingDimensionsFromVariable().


|
inlineoverride |
Definition at line 150 of file variableValue.h.
|
inlineoverride |
Definition at line 152 of file variableValue.h.
|
inline |
Definition at line 138 of file variableValue.h.
|
inline |
Definition at line 121 of file variableValue.h.
Referenced by minsky::EvalOpPtr::EvalOpPtr(), and minsky::VariableValues::resetValue().

| bool minsky::VariableValue::idxInRange | ( | ) | const |
Definition at line 89 of file variableValue.cc.
Referenced by minsky::VariableValues::reset(), and minsky::VariableValues::resetValue().

| void minsky::VariableValue::incrSlider | ( | double | step | ) |
increment slider by step
Definition at line 232 of file variableValue.cc.
|
inlineoverride |
Definition at line 127 of file variableValue.h.
Referenced by minsky::loadValueFromCSVFileT().

|
inline |
Definition at line 185 of file variableValue.h.
Referenced by minsky::VariableBase::init(), minsky::VariableValues::initValue(), MathDAG::latexInit(), MathDAG::matlabInit(), minsky::GodleyIcon::update(), and VariableValue().

| const std::string & minsky::VariableValue::init | ( | const std::string & | x | ) |
Definition at line 201 of file variableValue.cc.
References minsky::cminsky(), minsky::Minsky::definingVar(), minsky::VariableValues::initValue(), minsky::valueId(), and minsky::Minsky::variableValues.

|
inline |
returns true if variable's data is allocated on the flowVariables vector
Definition at line 96 of file variableValue.h.
Referenced by minsky::EvalOpPtr::EvalOpPtr(), and minsky::VariableValues::resetValue().

|
inline |
Definition at line 99 of file variableValue.h.
|
inline |
variable has an input port
Definition at line 90 of file variableValue.h.
|
delete |
| VariableValue& minsky::VariableValue::operator= | ( | TensorVal const & | ) |
|
override |
Definition at line 111 of file variableValue.cc.
References civita::ITensor::hypercube(), civita::ITensor::index(), and civita::ITensor::size().

|
inlineoverride |
Definition at line 124 of file variableValue.h.
|
override |
|
inline |
Definition at line 122 of file variableValue.h.
Referenced by minsky::VariableValues::reset().

|
inline |
Definition at line 115 of file variableValue.h.
|
inline |
Definition at line 120 of file variableValue.h.
References setValue().
Referenced by setValue().


| void minsky::VariableValue::sliderSet | ( | double | x | ) |
sets variable value (or init value)
Definition at line 222 of file variableValue.cc.
References minsky::anonymous_namespace{userFunction.cc}::isfinite().

| Summary minsky::VariableValue::summary | ( | ) | const |
Definition at line 514 of file variableValue.cc.
References minsky::cminsky(), MathDAG::SystemOfEquations::getNodeFromIntVar(), MathDAG::SystemOfEquations::getNodeFromValueId(), minsky::Minsky::model, minsky::scope(), minsky::valueId(), and minsky::var.

|
inline |
variable is a temporary
Definition at line 93 of file variableValue.h.
|
inlineoverrideprivate |
Definition at line 83 of file variableValue.h.
|
inline |
value at the ith location of the vector/tensor. Default, (i=0) is right for scalar quantities
Definition at line 103 of file variableValue.h.
|
private |
index into value vector
Definition at line 177 of file variableValue.cc.
|
private |
Definition at line 153 of file variableValue.cc.
|
inline |
set the value at the ith location
Definition at line 113 of file variableValue.h.
|
inline |
Definition at line 108 of file variableValue.h.
|
inline |
Definition at line 178 of file variableValue.h.
References minsky::canonicalName(), and minsky::valueIdFromScope().
Referenced by minsky::VariableValues::resetValue().


|
friend |
Definition at line 80 of file variableValue.h.
|
friend |
Definition at line 79 of file variableValue.h.
|
private |
Definition at line 75 of file variableValue.h.
|
protected |
the initial value of this variable
Definition at line 87 of file variableValue.h.
|
private |
Definition at line 74 of file variableValue.h.