Data set function. More...
#include <arcane/core/CaseTable.h>
Public Types | |
| enum | eError { ErrNo , ErrBadRange , ErrCanNotConvertParamToRightType , ErrCanNotConvertValueToRightType , ErrNotGreaterThanPrevious , ErrNotLesserThanNext } |
| Types of errors returned by the class. More... | |
| enum | eCurveType { CurveUnknown = 0 , CurveConstant = 1 , CurveLinear = 2 } |
| Type of the table curve. More... | |
| Public Types inherited from Arcane::ICaseFunction | |
| enum | eParamType { ParamUnknown = 0 , ParamReal = 1 , ParamInteger = 2 } |
| Type of a function parameter. More... | |
| enum | eValueType { ValueUnknown = 0 , ValueReal = 1 , ValueInteger = 2 , ValueBool = 3 , ValueString = 4 , ValueReal3 = 5 } |
| Type of a function value. More... | |
Public Member Functions | |
| CaseTable (const CaseFunctionBuildInfo &info, eCurveType curve_type) | |
| Constructs a lookup table from the data set. | |
| virtual Integer | nbElement () const |
| Number of elements in the function. | |
| virtual void | valueToString (Integer id, String &str) const |
| The i-th value in the string str. | |
| virtual void | paramToString (Integer id, String ¶m) const |
| The i-th parameter in the string str. | |
| virtual eError | setParam (Integer id, const String &value) |
| Modifies the parameter of element id. | |
| virtual eError | setValue (Integer id, const String &value) |
| Modifies the value of element id. | |
| virtual eError | appendElement (const String ¶m, const String &value) |
| Adds an element to the table. | |
| virtual void | insertElement (Integer id) |
| Inserts a couple (parameter,value) into the function. | |
| virtual void | removeElement (Integer id) |
| Removes a couple (parameter,value) from the function. | |
| template<typename ParamType, typename ValueType> | |
| void | _findValue (ParamType param, ValueType &avalue) const |
| Calculates the curve value for the parameter param. The value is stored in value. | |
| Public Member Functions inherited from Arcane::CaseFunction | |
| CaseFunction (const CaseFunctionBuildInfo &info) | |
| Constructs a dataset function. | |
| String | name () const override |
| function name | |
| void | setName (const String &new_name) override |
| Sets the function name to new_name. | |
| eParamType | paramType () const override |
| Function parameter type. | |
| eValueType | valueType () const override |
| Function value type. | |
| void | setValueType (eValueType type) override |
| Sets the function value type. | |
| void | setTransformValueFunction (const String &str) override |
| Sets a value transformation function. For now, this is just a multiplicative coefficient. The string str must be convertible to the value type. | |
| String | transformValueFunction () const override |
| Returns the value transformation function. | |
| void | setTransformParamFunction (const String &str) override |
| Sets a parameter transformation function. For now, this is just a multiplicative coefficient. It is only applied to real parameters. The string str must be convertible to a real number. | |
| String | transformParamFunction () const override |
| Parameter transformation function. | |
| void | setDeltatCoef (Real v) override |
| Sets the value of the deltat multiplier coefficient. | |
| Real | deltatCoef () const override |
| Value of the deltat multiplier coefficient. | |
| Ref< ICaseFunction > | toReference () |
| ITraceMng * | traceMng () const |
| Public Member Functions inherited from Arcane::ICaseFunction | |
| virtual | ~ICaseFunction ()=default |
| Releases resources. | |
| Public Member Functions inherited from Arcane::ReferenceCounterImpl | |
| void | addReference () |
| void | removeReference () |
| void | _internalAddReference () |
| bool | _internalRemoveReference () |
Curve Type | |
| CaseTableParams * | m_param_list |
| UniqueArray< SmallVariant > | m_value_list |
| List of values. | |
| eCurveType | m_curve_type |
| Curve type. | |
| bool | m_use_fast_search = true |
| virtual eCurveType | curveType () const |
| Returns the curve type of the function. | |
| virtual void | setParamType (eParamType type) |
| Sets the function parameter type. | |
| virtual bool | checkIfValid () const |
| Checks the validity of the function. | |
| virtual void | value (Real param, Real &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Real param, Integer &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Real param, bool &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Real param, String &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Real param, Real3 &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Integer param, Real &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Integer param, Integer &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Integer param, bool &v) const |
| virtual void | value (Integer param, String &v) const |
| Value v of the option for parameter param. | |
| virtual void | value (Integer param, Real3 &v) const |
| Value v of the option for parameter param. | |
| template<typename U, typename V> | |
| void | _findValue (U param, V &value) const |
| template<typename U, typename V> | |
| void | _findValueAndApplyTransform (U param, V &value) const |
| bool | _isValidIndex (Integer index) const |
| eError | _setValue (Integer index, const String &value_str) |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::CaseFunction | |
| template<typename ParamType> | |
| void | _applyParamTransform2 (ParamType ¶m) const |
| Real | _applyValueComulTransform (Real v, Real comul) const |
| Integer | _applyValueComulTransform (Integer v, Integer comul) const |
| String | _applyValueComulTransform (const String &v, const String &comul) const |
| bool | _applyValueComulTransform (bool v, bool comul) const |
| Real3 | _applyValueComulTransform (Real3 v, Real3 comul) const |
| void | _applyValueTransform (Real &value) const |
| void | _applyValueTransform (Integer &value) const |
| void | _applyValueTransform (String &value) const |
| void | _applyValueTransform (Real3 &value) const |
| void | _applyValueTransform (bool &value) const |
| template<typename ValueType> | |
| void | _applyValueTransform2 (ValueType &value) const |
| void | _applyParamTransform (Real &value) const |
| void | _applyParamTransform (Integer &value) const |
Data set function.
Definition at line 39 of file CaseTable.h.
Type of the table curve.
| Enumerator | |
|---|---|
| CurveUnknown | Unknown curve type. |
| CurveConstant | Piecewise constant curve. |
| CurveLinear | Piecewise linear curve. |
Definition at line 64 of file CaseTable.h.
Types of errors returned by the class.
Definition at line 47 of file CaseTable.h.
| Arcane::CaseTable::CaseTable | ( | const CaseFunctionBuildInfo & | info, |
| eCurveType | curve_type ) |
Constructs a lookup table from the data set.
| curve_type | type of the lookup table curve |
Definition at line 45 of file CaseTable.cc.
References Arcane::CaseFunction::CaseFunction(), m_curve_type, and Arcane::CaseFunctionBuildInfo::m_param_type.
|
virtual |
Definition at line 59 of file CaseTable.cc.
| void Arcane::CaseTable::_findValue | ( | ParamType | param, |
| ValueType & | avalue ) const |
Calculates the curve value for the parameter param. The value is stored in value.
| false | on success |
| true | if error |
Definition at line 357 of file CaseTable.cc.
References ARCANE_FATAL, CurveConstant, CurveLinear, Arcane::math::isEqual(), Arcane::math::isZero(), m_curve_type, m_value_list, Arcane::CaseFunction::name(), and nbElement().
|
private |
Definition at line 311 of file CaseTable.cc.
|
private |
Definition at line 68 of file CaseTable.cc.
|
private |
Definition at line 186 of file CaseTable.cc.
|
virtual |
Adds an element to the table.
Adds the element (param,value) to the table.
Definition at line 240 of file CaseTable.cc.
References m_value_list, and value().
|
virtual |
Checks the validity of the function.
| true | if the function is valid, |
| false | otherwise. |
Reimplemented from Arcane::CaseFunction.
Definition at line 302 of file CaseTable.cc.
|
inlinevirtual |
Returns the curve type of the function.
Definition at line 142 of file CaseTable.h.
References m_curve_type.
|
virtual |
Inserts a couple (parameter,value) into the function.
Inserts a couple (parameter,value) identical to the one found at position id. Subsequent parameters are shifted by one position. It is then possible to modify this couple using the methods setParam() or setValue().
If id is greater than the number of elements in the function, an element is added to the end with the same value as the last element of the function.
Definition at line 253 of file CaseTable.cc.
References m_value_list, and nbElement().
|
virtual |
Number of elements in the function.
Definition at line 293 of file CaseTable.cc.
Referenced by _findValue(), and insertElement().
The i-th parameter in the string str.
Definition at line 94 of file CaseTable.cc.
|
virtual |
Removes a couple (parameter,value) from the function.
If id is greater than the number of elements in the function, no operation is performed.
Definition at line 280 of file CaseTable.cc.
References m_value_list.
|
virtual |
Modifies the parameter of element id.
Uses value as the new value for the parameter. value must be convertible to the parameter type.
Definition at line 166 of file CaseTable.cc.
|
virtual |
Sets the function parameter type.
Reimplemented from Arcane::CaseFunction.
Definition at line 225 of file CaseTable.cc.
References Arcane::CaseFunction::paramType(), and Arcane::CaseFunction::setParamType().
|
virtual |
Modifies the value of element id.
Uses value as the new value. value must be convertible to the value type.
Definition at line 175 of file CaseTable.cc.
|
virtual |
Implements Arcane::ICaseFunction.
Definition at line 145 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 139 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 133 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 157 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 151 of file CaseTable.cc.
|
virtual |
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 115 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 109 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 103 of file CaseTable.cc.
Referenced by appendElement().
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 127 of file CaseTable.cc.
Value v of the option for parameter param.
Implements Arcane::ICaseFunction.
Definition at line 121 of file CaseTable.cc.
The i-th value in the string str.
Definition at line 82 of file CaseTable.cc.
References m_value_list.
|
private |
Curve type.
Definition at line 165 of file CaseTable.h.
Referenced by _findValue(), CaseTable(), and curveType().
|
private |
Definition at line 163 of file CaseTable.h.
|
private |
Definition at line 166 of file CaseTable.h.
|
private |
List of values.
Definition at line 164 of file CaseTable.h.
Referenced by _findValue(), appendElement(), insertElement(), removeElement(), and valueToString().