Base class for building vector functions from scripts. This is currently an interrmediate class between the DTO and a vector function, and will probably be gradually replaced.
More...
|
| VectorFunctionScriptControllerBase () |
| Default constructor, sets IsNull to true. More...
|
|
| VectorFunctionScriptControllerBase (int numParameters, int numValues) |
| Constructor, prepares the current DTO for storing a scalar function of the specified dimension. More...
|
|
abstract
ScalarFunctionControllerType | CreateScalarrFunctionController () |
| Creates and returns a new scalar function controller. More...
|
|
ScalarFunctionControllerType[] | GetElements () |
| Returns an array of scalar function controllers (of type ScalarFunctionControllerType) that represent elements of the vector function. More...
|
|
void | SynchronizeData (bool syncParameterNames=false, bool syncFunctionNames=true) |
| Synchronizes data on the current vector function controller in such a way that it is consistent. More...
|
|
virtual string | ConvertParameterNamesToString (params string[] parameterNames) |
| Converts an array of parameter names or function names to a delimited single string that contains these names, and returns this string. More...
|
|
virtual string[] | ConvertParameterNamesToArray (string parameterNamesString) |
| Converts a single string containing parameter names or function names in delimited form to an array of individual parameter names or function names, respectively, and returns this array. More...
|
|
virtual string | GetParametersString () |
| Returns function parameter names in form of delimited string that contains all function parameter names. More...
|
|
virtual void | SetParametersString (string parametersString) |
| Sets function parameter names through a string containing delimided parameters names. More...
|
|
virtual string | GetFunctionsString () |
| Returns function function names in form of delimited string that contains all function function names. More...
|
|
virtual void | SetFunctionsString (string functionsString) |
| Sets function names through a string containing delimided functions names. More...
|
|
virtual void | InvalidateNumParameters () |
| Invalidates dimension of function domain. All dependent data is invalidated. More...
|
|
virtual void | InvalidateParameterNames () |
| Invalidates names of parameters. This also means that function value definition and function gradient definitions are invalidated, if present. More...
|
|
virtual void | InvalidateNumValues () |
| Invalidates dimension of function domain. All dependent data is invalidated. More...
|
|
virtual void | InvalidateFunctionNames () |
| Invalidates names of parameters. This also means that function value definition and function gradient definitions are invalidated, if present. More...
|
|
virtual InputOutputDataDefiniton | GetDataDefinitionObject (bool setBoundsAndDefaults=false, IBoundingBox inputBounds=null, IBoundingBox outputBounds=null) |
| Creates and returns a data definition object for input parametera and output values of the current function DTO. More...
|
|
override string | ToString () |
| Returns human readable string representation of the current object. More...
|
|
IVectorFunction | GetFunction () |
| Returns a vector function that is created from the funciton definition on the current vector function script controller. More...
|
|
|
static string | ToString (VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType > sc) |
| Returns a string representation of the specified VectorFunctionScripController object. More...
|
|
static void | SaveJson (VectorFunctionScriptController functionController, string filePath, InputOutputDataDefiniton dataDefinition) |
| Saves (serializes) the specified script-based vector function controller to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag. More...
|
|
static void | SaveJson (VectorFunctionScriptController functionController, string filePath, bool append=false, InputOutputDataDefiniton dataDefinition=null) |
| Saves (serializes) the specified script-based vector function controller to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag. More...
|
|
static void | LoadJson (string filePath, ref VectorFunctionScriptController controllerRestored) |
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
|
|
static void | LoadJson (string filePath, ref VectorFunctionScriptController controllerRestored, ref VectorFunctionScriptDto dto) |
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
|
|
static void | LoadJson (string filePath, ref VectorFunctionScriptController controllerRestored, ref InputOutputDataDefiniton dataDef) |
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
|
|
|
virtual string | Name [get, set] |
| Scalar function name. More...
|
|
virtual string | Description [get, set] |
| Scalar function description. More...
|
|
int | NumParameters [get, set] |
| Number of parameters of the vector function, i.e., dimension of thefunction domain. More...
|
|
int | NumValues [get, set] |
| Number of elements (scalar function components) of the vector function, i.e., dimension of thefunction codomain. More...
|
|
List
< ScalarFunctionControllerType > | Elements [get] |
| List of vector function elements, i.e. scalar functions that calculate individual elements of the return value. More...
|
|
ScalarFunctionControllerType | this[int which] [get, set] |
| Gets or sets scalar function controller identified by the specified index. More...
|
|
string | ParameterNamesSeparator [get, protected set] |
| Separator string that is used to separate parameter names or function names when stated in a single string. More...
|
|
bool | IsNamesSynchronized [get, set] |
|
virtual string[] | ParameterNames [get, set] |
| Names of function parameters. More...
|
|
virtual string[] | FunctionNames [get, set] |
| Names of function functions. More...
|
|
IVectorFunction | Function [get] |
| Scalar function (of type IVectorFunction) created on basis of definition in this controller. More...
|
|
Base class for building vector functions from scripts. This is currently an interrmediate class between the DTO and a vector function, and will probably be gradually replaced.
Beside acting as a kind of data transfer object, this class provides a variety of manipulations that are necessary when defining vector functions from scripts (i.e., from user definitions that are compiiled the JIT compiler).
- Template Parameters
-
VectorFunctionType | Type parameter specifying the specific vector function type for which concrete DTO is designed. |
$A Igor Feb16;
- Type Constraints
-
VectorFunctionType | : | class | |
VectorFunctionType | : | IVectorFunction | |
ScalarFunctionControllerType | : | ScalarFunctionScriptControllerBase<ScalarFunctionType> | |
ScalarFunctionControllerType | : | new() | |
ScalarFunctionType | : | class | |
ScalarFunctionType | : | IScalarFunction | |
virtual InputOutputDataDefiniton IG.Num.VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType >.GetDataDefinitionObject |
( |
bool |
setBoundsAndDefaults = false , |
|
|
IBoundingBox |
inputBounds = null , |
|
|
IBoundingBox |
outputBounds = null |
|
) |
| |
|
inlinevirtual |
Creates and returns a data definition object for input parametera and output values of the current function DTO.
Bounds and default values are eventually added to definitions, dependent on parameters.
Definition contains function name and parameter names, and composes meaningful descriptions.
- Parameters
-
setBoundsAndDefaults | Whether output bounds are added to input and output element definitions. Default is false. |
If true and bouds are not specified then default bounds (currently 0/1) are specified.
If bounds are specified then default values for function parameters are also set to the mean of the corresponding minimal and maximal value.
- Parameters
-
inputBounds | Input bounds that are added to definitions in the case that setBoundsAndDefaults is true. |
If it is null then bounds are replaced by default values.
If it is specified but some bounds are not defined then corresponding bounds are also not specified.
- Parameters
-
outputBounds | Output bounds that are added to definitions in the case that setBoundsAndDefaults is true. |
If it is null then bounds are replaced by default values.
If it is specified but some bounds are not defined then corresponding bounds are also not specified.
References IG.Num.InputOutputDataDefiniton.AddInputElement(), IG.Num.InputOutputDataDefiniton.AddOutputElement(), IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputElementDefinition.DefaultValue, IG.Num.InputElementDefinition.DefaultValueDefined, IG.Num.InputOutputElementDefinition.Description, IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, IG.Num.InputOutputElementDefinition.Name, and IG.Num.InputOutputElementDefinition.Title.
Saves (serializes) the specified script-based vector function controller to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag.
File is overwritten if it already exists.
The data definition is also written to the file apart to function data, and can be later restored to a separate object if necessary.
- Parameters
-
functionController | Object that is saved to a file. |
filePath | Path to the file in which object is saved. |
dataDefinition | Optional object containing the definition of functions's input/output data. If specified, this object is added on the DTO annd is saved to the file together with pure function definitiion. |
Referenced by IG.Forms.VectorFunctionScriptControl.btnSave_Click().
static void IG.Num.VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType >.SaveJson |
( |
VectorFunctionScriptController |
functionController, |
|
|
string |
filePath, |
|
|
bool |
append = false , |
|
|
InputOutputDataDefiniton |
dataDefinition = null |
|
) |
| |
|
inlinestatic |
Saves (serializes) the specified script-based vector function controller to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag.
In addition to function data, the data definition is also stored to the output file when specified.
- Parameters
-
functionController | Object that is saved to a file. |
filePath | Path to the file in which object is saved. |
append | Specifies whether serialized data is appended at the end of the file in the case that the file already exists. |
dataDefinition | Optional object containing the definition of functions's input/output data. If specified, this object is added on the DTO annd is saved to the file together with pure function definitiion. |
References IG.Num.VectorFunctionScriptDtoBase< FunctionControllerType, ScalarFunctionControllerType, ScalarFunctionDtoType >.ZDataDefinition.
Restores (deserializes) a script-based scalar function controller from the specified file in JSON format.
An intermediate object in the process, the DTO, is also stored, because this kind of DTO also contains some additional data that is not copied to controllerRestored , such as function's input/output data definition.
- Parameters
-
filePath | File from which object is restored. |
controllerRestored | Object that is restored by deserialization. |
dto | Variable into which the intermediate data transfer object (DTO) is stored in the process. The DTO can in this case include some additional data that is not copied to controllerRestored but may be used in the context where the method is called - for example the function's input/output data definitions. |