| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Private Attributes | Static Private Attributes | List of all members
IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType > Class Template Reference

Base class for building scalar functions from scripts. This is currently an interrmediate class between the DTO and scalar function, and will probably be gradually replaced. More...

Inheritance diagram for IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >:
[legend]
Collaboration diagram for IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >:
[legend]

## Public Member Functions
| ScalarFunctionScriptControllerBase ()
| Default constructor, sets IsNull to true. More...
| ScalarFunctionScriptControllerBase (int spaceDimension)
| Constructor, prepares the current DTO for storing a scalar function of the specified dimension. More...
virtual string | ConvertParameterNamesToString (params string[] parameterNames)
| Converts an array of parameter 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 in delimited form to an array of individual parameter names, and returns this array. More...
virtual string | ConvertFunctionDefinitionsToString (params string[] functionDefinitions)
| Converts an array of function definition strings to a delimited single string that contains these defintions, and returns this string. More...
virtual string[] | ConvertFunctionDefinitionsToArray (string functionDefinitionsString)
| Converts a single string containing function definitions in delimited form to an array of individual function definition strings, 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...
string | GetGradientDefinitionSingleString ()
| Returns a string that contains delimited definitions of all gradient components. More...
void | SetGradientDefinitionSingleString (string definitionsString)
| Sets definitions of components of function gradients by specifying a string that contains these definitions in delimited form (without any enclosing brackets). More...
virtual void | SetGradientComponentDefiniton (int whichComponent, string gradientComponentDefinition)
| Sets a definition of the specified gradient components. More...
virtual void | InvalidateDimension ()
| 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 | InvalidateValueDefinition ()
| Invalidates definition of function value. More...
virtual void | InvalidateGradientDefinition ()
| Invalidates definition of function gradient. More...
bool | GetIsLoaderConsistent ()
| Returns a flag telling whether the loader is currently consistent with function definition contained in the DTO. More...
virtual ScalarFunctionLoader | GetFunctionLoader ()
| Returns the loader that can create a scalar function according to the definition from the current DTO. More...
virtual void | SetFunctionLoader (ScalarFunctionLoader loader)
| Sets the loader that can create a scalar function according to the definition from the current DTO. More...
LoadableScalarFunctionBase | GetFunction ()
| Returns a scalar function that is created from the funciton definitio on the current function DTO. More...
void | DataToFunctionLoader ()
| Copies data of the form to function loader. 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...

## Static Public Member Functions
static void | CreateParameterNamesArray (string namesString, string separator, ref string[] namesArray, bool trimSpaces=true)
| Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary). More...
static void | CreateParameterNamesArray (string namesString, string[] separators, ref string[] namesArray, bool trimSpaces=true, bool allowMultipleSeparators=false)
| Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary). More...
static void | CreateFunctionDefinitionsArray (string namesString, string separator, ref string[] namesArray, bool trimSpaces=true)
| Parses a string that contains delimited function definitions, extract an array of individual function definitions from it, and stores individual string definitions to the specified array (which is reallocated if necessary). More...
static void | CreateFunctionDefinitionsArray (string namesString, string[] separators, ref string[] namesArray, bool trimSpaces=true, bool allowMultipleSeparators=false)
| Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary). More...
static string | CreateParameterNamesString (string[] namesArray, string separator, bool insertNewLines=false, bool insertSpaces=true)
| Constructs a delimited string cotaining parameter names, from the specified array of parameter names. More...
static string | CreateFunctionDefinitionsString (string[] definitionsArray, string separator, bool insertNewLines=false, bool insertSpaces=true)
| Construct a delimited string cotaining function definitons, from the specified array of individual string function definitions. More...
static string[] | GenerateParameterOrVariableNames (int dimension, string baseName="x", int startIndex=0, int numPlaces=2)
| Generates and returns an array of a specified number of variable or parameter names, composed of a base name and numerical string corresponding to the consecutive number of the variable. More...
static string | GenerateFuctonParameterName (int whichParameter, string baseName="x", int startIndex=0, int numPlaces=2)
| Generates and returns a pre-defined name of the specified variable or function parameter , composed of the specified base name and numerical string corresponding to the consecutive number of the variable. More...
static string | ToString (ScalarFunctionScriptControllerBase< ScalarFunctionType > sc)
| Returns a string representation of the specified ScalarFunctionScriptController object. More...
static void | SaveJson (ScalarFunctionScriptController functionController, string filePath, InputOutputDataDefiniton dataDefinition)
| Saves (serializes) the specified script-based scalar 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 (ScalarFunctionScriptController functionController, string filePath, bool append=false, InputOutputDataDefiniton dataDefinition=null)
| Saves (serializes) the specified script-based scalar 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 ScalarFunctionScriptController controllerRestored)
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
static void | LoadJson (string filePath, ref ScalarFunctionScriptController controllerRestored, ref ScalarFunctionScriptDto dto)
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
static void | LoadJson (string filePath, ref ScalarFunctionScriptController controllerRestored, ref InputOutputDataDefiniton dataDef)
| Restores (deserializes) a script-based scalar function controller from the specified file in JSON format. More...
static void | SaveCsv (IVector vec, string filePath)
| Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. Constant UtilCsv.DefaultCsvSeparator is used as separator. More...
static void | SaveCsv (IVector vec, string filePath, string separator)
| Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. More...
static void | SaveCsv (IVector vec, string filePath, bool append)
| Saves the specified vector to a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as separator in CSV. More...
static void | SaveCsv (IVector vec, string filePath, string separator, bool append)
| Saves the specified vector to a CSV file. More...
static void | LoadCsv (string filePath, ref IVector vecRestored)
| Reads a vector from a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as separator in CSV file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row. More...
static void | LoadCsv (string filePath, string separator, ref IVector vecRestored)
| Reads a vector written in CSV format from a file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row. More...
static void | LoadCsv (string filePath, int rowNum, ref IVector vecRestored)
| Reads a vector from the specified row of a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as CSV separator. If the specified row does not exisist in the file then exception is thrown. More...
static void | LoadCsv (string filePath, int rowNum, string separator, ref IVector vecRestored)
| Reads a vector from the specified row of a CSV file. If the specified row does not exisist in the file then exception is thrown. More...

## Protected Member Functions
void | CopyDataToFunctionLoader ()
| Copies function deffinition data from the current function DTO to the internal function loader. More...
void | CopyDataToFunctionLoader (ScalarFunctionLoader loader)
| Copies function deffinition data from the current function DTO to the specified function loader. More...

## Protected Attributes
string | _name
string | _parametersString
string | _gradientsSingleString

## Static Protected Attributes
static double | _defaultLowerBound = 0.0
static double | _defaultUpperBound = 1.0

## Properties
virtual int | Dimension`[get, set]`
| Dimension of the parameter space. More...
virtual string | Name`[get, set]`
| Scalar function name. More...
virtual string | Description`[get, set]`
| Scalar function description. More...
virtual bool | IsValueDefined`[get]`
| Specifies whether value is defined for the funciton represented by the current DTO. More...
virtual bool | IsGradientDefined`[get]`
| Specifies whether gradient is defined for the funciton represented by the current DTO. More...
virtual string | ValueDefinitonString`[get, set]`
| Definition of function value. More...
virtual string[] | ParameterNames`[get, set]`
| Names of function parameters. More...
virtual string[] | GradientDefinitionStrings`[get, set]`
| Gradient definition strings (separately for each gradient component). More...
static string | DefaultParameterNamesSeparator`[get, protected set]`
| Default parameter names separator, separates parametr names when stated in a single string. More...
static string | DefaultFunctionsSeparator`[get, private set]`
| Default functions separator, separates string definitions of functions when stated in a single string. More...
string | ParameterNamesSeparator`[get, protected set]`
| Separator string that is used to separate parameter names when stated in a single string. More...
string | FunctionsSeparator`[get, private set]`
| Separator string that is used to separate function definitions when stated in a single state. More...
bool | IsLoaderConsistent`[get, set]`
| A flag indicateing whether the loader is currently consistent with the function definition contained in the current DTO. More...
virtual ScalarFunctionLoader | FunctionLoader`[get, set]`
| Object that is responsible for creation of scalar function objects that correspond to the definitions found on the current scalar function DTO. More...
LoadableScalarFunctionBase | Function`[get]`
| Scalar function (of type IScalarFunction) created on basis of definition in this DTO. More...

## Private Attributes
int | _dimension
string | _description
string | _valueString
string[] | _parameterNames
string[] | _gradientDefinitionStrings
string | _parameterNamesSeparator = DefaultParameterNamesSeparator
string | _functionsSeparator = DefaultFunctionsSeparator
bool | _isLoaderConsistent = false
ScalarFunctionLoader | _functionLoader = null

## Static Private Attributes
static string | _defaultParameterNamesSeparator = ","
static string | _defaultFunctionsSeparator = ";"

## Detailed Description

Base class for building scalar functions from scripts. This is currently an interrmediate class between the DTO and scalar 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 scalar functions from scripts (i.e., from symbolic user definitions dhat are compiled by the JIT compiler).

Template Parameters

  ScalarFunctionType | Type parameter specifying the specific scalar function type for which concrete DTO is designed.

$A Igor Feb16;

Type Constraints

  ScalarFunctionType | : | class |
  ScalarFunctionType | : | IScalarFunction |

## Constructor & Destructor Documentation

IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ScalarFunctionScriptControllerBase | ( |  | ) |
| inline

Default constructor, sets IsNull to true.

IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ScalarFunctionScriptControllerBase | ( | int | spaceDimension | ) |
| inline

Constructor, prepares the current DTO for storing a scalar function of the specified dimension.

Parameters

  spaceDimension | Number of parameters of the represented (script-constructed) scalar function.

## Member Function Documentation

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ConvertParameterNamesToString | ( | params string[] | parameterNames | ) |
| inline virtual

Converts an array of parameter names to a delimited single string that contains these names, and returns this string.

Parameters

  parameterNames | array of parameter names.

virtual string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ConvertParameterNamesToArray | ( | string | parameterNamesString | ) |
| inline virtual

Converts a single string containing parameter names in delimited form to an array of individual parameter names, and returns this array.

Parameters

  parameterNamesString |

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ConvertFunctionDefinitionsToString | ( | params string[] | functionDefinitions | ) |
| inline virtual

Converts an array of function definition strings to a delimited single string that contains these defintions, and returns this string.

Parameters

  functionDefinitions | array of function definitions.

virtual string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ConvertFunctionDefinitionsToArray | ( | string | functionDefinitionsString | ) |
| inline virtual

Converts a single string containing function definitions in delimited form to an array of individual function definition strings, and returns this array.

Parameters

  functionDefinitionsString |

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetParametersString | ( |  | ) |
| inline virtual

Returns function parameter names in form of delimited string that contains all function parameter names.

Referenced by IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SetParametersString | ( | string | parametersString | ) |
| inline virtual

Sets function parameter names through a string containing delimided parameters names.

Parameters

  parametersString | String containing parameterr names.

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetGradientDefinitionSingleString | ( |  | ) |
| inline

Returns a string that contains delimited definitions of all gradient components.

Referenced by IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SetGradientDefinitionSingleString | ( | string | definitionsString | ) |
| inline

Sets definitions of components of function gradients by specifying a string that contains these definitions in delimited form (without any enclosing brackets).

Parameters

  definitionsString | String that contains delimited definitions of elements of function gradient.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SetGradientComponentDefiniton | ( | int | whichComponent,
|  | string | gradientComponentDefinition
| ) |  |
| inline virtual

Sets a definition of the specified gradient components.

Parameters

  whichComponent | Specifies which gradient component's definition is set.
  gradientComponentDefinition | String containing definition of the specified gradient component.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.InvalidateDimension | ( |  | ) |
| inline virtual

Invalidates dimension of function domain. All dependent data is invalidated.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.InvalidateParameterNames | ( |  | ) |
| inline virtual

Invalidates names of parameters. This also means that function value definition and function gradient definitions are invalidated, if present.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.InvalidateValueDefinition | ( |  | ) |
| inline virtual

Invalidates definition of function value.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.InvalidateGradientDefinition | ( |  | ) |
| inline virtual

Invalidates definition of function gradient.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateParameterNamesArray | ( | string | namesString,
|  | string | separator,
|  | ref string[] | namesArray,
|  | bool | trimSpaces = `true`
| ) |  |
| inline static

Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary).

Parameters

  namesString | String that contains delimited parameterr names.
  separator | String separators that is used to delimit parameter names.
  namesArray | Reference to the array where extracted parameterr names are stored.
  trimSpaces | If true then spaces and newlines are trimmed from parameter names. default is true.

Referenced by IG.Num.VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType >.ConvertParameterNamesToArray().

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateParameterNamesArray | ( | string | namesString,
|  | string[] | separators,
|  | ref string[] | namesArray,
|  | bool | trimSpaces = `true`,
|  | bool | allowMultipleSeparators = `false`
| ) |  |
| inline static

Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary).

Parameters

  namesString | String that contains delimited parameterr names.
  separators | A list of string separators that are used to delimit parameter names. Normally there will be onnly one separator (dependent on the allowMultipleSeparators ) parameter.
  namesArray | Reference to the array where extracted parameterr names are stored.
  trimSpaces | If true then spaces and newlines are trimmed from parameter names. default is true.
  allowMultipleSeparators | If true then multiple separators are allowed. Default is false.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateFunctionDefinitionsArray | ( | string | namesString,
|  | string | separator,
|  | ref string[] | namesArray,
|  | bool | trimSpaces = `true`
| ) |  |
| inline static

Parses a string that contains delimited function definitions, extract an array of individual function definitions from it, and stores individual string definitions to the specified array (which is reallocated if necessary).

Parameters

  namesString | String that contains delimited function definitions.
  separator | String separators that is used to delimit function definitions.
  namesArray | Reference to the array where extracted function definition strings are stored.
  trimSpaces | If true then spaces and newlines are trimmed from function definition strings. Default is true.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateFunctionDefinitionsArray | ( | string | namesString,
|  | string[] | separators,
|  | ref string[] | namesArray,
|  | bool | trimSpaces = `true`,
|  | bool | allowMultipleSeparators = `false`
| ) |  |
| inline static

Parses a string that contains delimited parameter names, extract an array of individual parameter names from it, and stores names to the specified array (which is reallocated if necessary).

Task is currently delegated to CreateFunctionDefinitionsArray(string, string[], ref string[], bool, bool).

Parameters

  namesString | String that contains delimited parameterr names.
  separators | A list of string separators that are used to delimit parameter names. Normally there will be onnly one separator (dependent on the allowMultipleSeparators ) parameter.
  namesArray | Reference to the array where extracted parameterr names are stored.
  trimSpaces | If true then spaces and newlines are trimmed from parameter names. default is true.
  allowMultipleSeparators | If true then multiple separators are allowed. Default is false.

static string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateParameterNamesString | ( | string[] | namesArray,
|  | string | separator,
|  | bool | insertNewLines = `false`,
|  | bool | insertSpaces = `true`
| ) |  |
| inline static

Constructs a delimited string cotaining parameter names, from the specified array of parameter names.

Parameters

  namesArray | Array of parameter names.
  separator | Separator used to delimit parameter names.
  insertNewLines | If true then newlines are also inserted between between individual parameter names (after separators).
  insertSpaces | If true then spaces are also inserted between individual parameter names (after separators).

Returns
  A single delimited string that contains the specified parameter names, without any enclosing backets.

Referenced by IG.Num.VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType >.ConvertParameterNamesToString().

static string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CreateFunctionDefinitionsString | ( | string[] | definitionsArray,
|  | string | separator,
|  | bool | insertNewLines = `false`,
|  | bool | insertSpaces = `true`
| ) |  |
| inline static

Construct a delimited string cotaining function definitons, from the specified array of individual string function definitions.

Work is delegated to CreateParameterNamesString(string [], string, bool, bool).

Parameters

  definitionsArray | Array of parameter names.
  separator | Separator used to delimit function definitions.
  insertNewLines | If true then newlines are also inserted between between individual function definitions (after separators).
  insertSpaces | If true then spaces are also inserted between individual function definitions (after separators).

Returns
  A single delimited string that contains the specified function definitions, without any enclosing backets.

static string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GenerateParameterOrVariableNames | ( | int | dimension,
|  | string | baseName = `"x"`,
|  | int | startIndex = `0`,
|  | int | numPlaces = `2`
| ) |  |
| inline static

Generates and returns an array of a specified number of variable or parameter names, composed of a base name and numerical string corresponding to the consecutive number of the variable.

Parameters

  dimension | Number of variables.
  baseName | Base for the parameter name.
  startIndex | At which numbers parameterr count starts (default 0).
  numPlaces | Number of places reserved for parameter's consecutive number (i.e. 2 in the sequence "x01", "x02", "x03", "x04" ...).

Referenced by IG.Num.VectorFunctionScriptControllerBase< VectorFunctionType, ScalarFunctionControllerType, ScalarFunctionType >.SynchronizeData().

static string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GenerateFuctonParameterName | ( | int | whichParameter,
|  | string | baseName = `"x"`,
|  | int | startIndex = `0`,
|  | int | numPlaces = `2`
| ) |  |
| inline static

Generates and returns a pre-defined name of the specified variable or function parameter , composed of the specified base name and numerical string corresponding to the consecutive number of the variable.

Parameters

  whichParameter | Index of the parameter or consecutive number of tje variable for which name is generated.
  baseName | Base for the name.
  startIndex | At which numbers parameterr count starts (default 0).
  numPlaces | Number of places reserved for parameter's consecutive number (i.e. 2 in the sequence "x01", "x02", "x03", "x04" ...).

bool IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetIsLoaderConsistent | ( |  | ) |
| inline

Returns a flag telling whether the loader is currently consistent with function definition contained in the DTO.

void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CopyDataToFunctionLoader | ( |  | ) |
| inline protected

Copies function deffinition data from the current function DTO to the internal function loader.

void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.CopyDataToFunctionLoader | ( | ScalarFunctionLoader | loader | ) |
| inline protected

Copies function deffinition data from the current function DTO to the specified function loader.

Parameters

  loader | Function loader where data is xopied to.

References IG.Lib.ScalarFunctionLoader.GradientDefinitionStrings, IG.Lib.ScalarFunctionLoader.IndependentVariableNames, and IG.Lib.ScalarFunctionLoader.ValueDefinitionString.

virtual ScalarFunctionLoader IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetFunctionLoader | ( |  | ) |
| inline virtual

Returns the loader that can create a scalar function according to the definition from the current DTO.

virtual void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SetFunctionLoader | ( | ScalarFunctionLoader | loader | ) |
| inline virtual

Sets the loader that can create a scalar function according to the definition from the current DTO.

Parameters

  loader | Function loader to be set.

LoadableScalarFunctionBase IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetFunction | ( |  | ) |
| inline

Returns a scalar function that is created from the funciton definitio on the current function DTO.

References IG.Lib.Function.

Referenced by IG.Script.AppExtBase.FormDemoFunctionTestDevelop().

void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.DataToFunctionLoader | ( |  | ) |
| inline

Copies data of the form to function loader.

virtual InputOutputDataDefiniton IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetDataDefinitionObject | ( | bool | setBoundsAndDefaults = `false`,
|  | IBoundingBox | inputBounds = `null`,
|  | IBoundingBox | outputBounds = `null`
| ) |  |
| inline virtual

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.

override string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString | ( |  | ) |
| inline

Returns human readable string representation of the current object.

Returns

static string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString | ( | ScalarFunctionScriptControllerBase< ScalarFunctionType > | sc | ) |
| inline static

Returns a string representation of the specified ScalarFunctionScriptController object.

Parameters

  sc | Vector whose string representation is returned.

References IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Description, IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Dimension, IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetGradientDefinitionSingleString(), IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GetParametersString(), IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.IsGradientDefined, IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Name, and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ValueDefinitonString.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveJson | ( | ScalarFunctionScriptController | functionController,
|  | string | filePath,
|  | InputOutputDataDefiniton | dataDefinition
| ) |  |
| inline static

Saves (serializes) the specified script-based scalar 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.ScalarFunctionScriptControl.btnSave_Click().

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveJson | ( | ScalarFunctionScriptController | functionController,
|  | string | filePath,
|  | bool | append = `false`,
|  | InputOutputDataDefiniton | dataDefinition = `null`
| ) |  |
| inline static

Saves (serializes) the specified script-based scalar 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.ScalarFunctionScriptDtoBase< FunctionControllerType >.ZDataDefinition.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadJson | ( | string | filePath,
|  | ref ScalarFunctionScriptController | controllerRestored
| ) |  |
| inline static

Restores (deserializes) a script-based scalar function controller from the specified file in JSON format.

Parameters

  filePath | File from which object is restored.
  controllerRestored | Object that is restored by deserialization.

Referenced by IG.Forms.ScalarFunctionScriptControl.btnLoad_Click(), and IG.Forms.InputOutputDataDefinitionControl.btnLoadFromFunction_Click().

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadJson | ( | string | filePath,
|  | ref ScalarFunctionScriptController | controllerRestored,
|  | ref ScalarFunctionScriptDto | dto
| ) |  |
| inline static

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.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadJson | ( | string | filePath,
|  | ref ScalarFunctionScriptController | controllerRestored,
|  | ref InputOutputDataDefiniton | dataDef
| ) |  |
| inline static

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.
  dataDef | Variable into which the input/output data definition is restored when it is also written in the file (which is possible due to the ability of ScalarFunctionScriptDto to incorporate a data definition object, in addition to pure function data).

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveCsv | ( | IVector | vec,
|  | string | filePath
| ) |  |
| inline static

Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten. Constant UtilCsv.DefaultCsvSeparator is used as separator.

Parameters

  vec | Vector to be stored to a file.
  filePath | Path of the file to which vector is stored.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | string | separator
| ) |  |
| inline static

Saves the specified vector to a CSV file. It the specified file already exists then it is overwritten.

Parameters

  vec | Vector to be stored to a file.
  filePath | Path of the file to which vector is stored.
  separator | Separator used in the CSV file.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | bool | append
| ) |  |
| inline static

Saves the specified vector to a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as separator in CSV.

Parameters

  vec | Vector to be stored to a file.
  filePath | Path of the file to which vector is stored.
  append | Specifies whether the data is appended at the end of the file in the case that the ifle already exists.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.SaveCsv | ( | IVector | vec,
|  | string | filePath,
|  | string | separator,
|  | bool | append
| ) |  |
| inline static

Saves the specified vector to a CSV file.

Parameters

  vec | Vector to be stored to a file.
  filePath | Path of the file to which vector is stored.
  separator | Separator used in the CSV file.
  append | Specifies whether the data is appended at the end of the file in the case that the ifle already exists.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadCsv | ( | string | filePath,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as separator in CSV file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row.

Parameters

  filePath | Path to the file that contains a vector in CSV format.
  vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadCsv | ( | string | filePath,
|  | string | separator,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector written in CSV format from a file. If there are no components then a null vector is returned by this method (no exceptions thrown). If there are more than one rows in the CSV file then vector is read from the first row.

Parameters

  filePath | Path to the file that contains a vector in CSV format.
  separator | Separator that is used to separate values in a row in the CSV file.
  vecRestored | Vector object where the read-in vector is stored.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadCsv | ( | string | filePath,
|  | int | rowNum,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from the specified row of a CSV file. Constant UtilCsv.DefaultCsvSeparator is used as CSV separator. If the specified row does not exisist in the file then exception is thrown.

Parameters

  filePath | Path to the file that contains a vector in CSV format.
  rowNum | Number of the row from which the vector is read.
  vecRestored | Vector object where the read-in vector is stored.

References IG.Lib.UtilCsv.DefaultCsvSeparator.

static void IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.LoadCsv | ( | string | filePath,
|  | int | rowNum,
|  | string | separator,
|  | ref IVector | vecRestored
| ) |  |
| inline static

Reads a vector from the specified row of a CSV file. If the specified row does not exisist in the file then exception is thrown.

Parameters

  filePath | Path to the file that contains a vector in CSV format.
  rowNum | Number of the row from which the vector is read.
  separator | Separator that is used to separate values in a row in the CSV file.
  vecRestored | Vector object where the read-in vector is stored.

## Member Data Documentation

int IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._dimension
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._name
| protected

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._description
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._valueString
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._parametersString
| protected

string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._parameterNames
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._gradientsSingleString
| protected

string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._gradientDefinitionStrings
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._defaultParameterNamesSeparator = ","
| static private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._defaultFunctionsSeparator = ";"
| static private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._parameterNamesSeparator = DefaultParameterNamesSeparator
| private

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._functionsSeparator = DefaultFunctionsSeparator
| private

bool IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._isLoaderConsistent = false
| private

ScalarFunctionLoader IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._functionLoader = null
| private

double IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._defaultLowerBound = 0.0
| static protected

double IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >._defaultUpperBound = 1.0
| static protected

## Property Documentation

virtual int IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Dimension
| get set

Dimension of the parameter space.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Name
| get set

Scalar function name.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), IG.Script.AppExtBase.FormDemoFunctionTestDevelop(), and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Description
| get set

Scalar function description.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual bool IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.IsValueDefined
| get

Specifies whether value is defined for the funciton represented by the current DTO.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain().

virtual bool IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.IsGradientDefined
| get

Specifies whether gradient is defined for the funciton represented by the current DTO.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ValueDefinitonString
| get set

Definition of function value.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), IG.Script.AppExtBase.FormDemoFunctionTestDevelop(), and IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ToString().

virtual string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ParameterNames
| get set

Names of function parameters.

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), and IG.Script.AppExtBase.FormDemoFunctionTestDevelop().

virtual string [] IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.GradientDefinitionStrings
| get set

Gradient definition strings (separately for each gradient component).

Referenced by IG.Num.ScalarFunctionScriptDtoBase< FunctionControllerType >.CopyFromPlain(), and IG.Script.AppExtBase.FormDemoFunctionTestDevelop().

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.DefaultParameterNamesSeparator
| static get protected set

Default parameter names separator, separates parametr names when stated in a single string.

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.DefaultFunctionsSeparator
| static get private set protected

Default functions separator, separates string definitions of functions when stated in a single string.

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.ParameterNamesSeparator
| get protected set

Separator string that is used to separate parameter names when stated in a single string.

Usually used for function parameters, but also for other kinds of parameters.

string IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.FunctionsSeparator
| get private set

Separator string that is used to separate function definitions when stated in a single state.

bool IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.IsLoaderConsistent
| get set protected

A flag indicateing whether the loader is currently consistent with the function definition contained in the current DTO.

virtual ScalarFunctionLoader IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.FunctionLoader
| get set protected

Object that is responsible for creation of scalar function objects that correspond to the definitions found on the current scalar function DTO.

LoadableScalarFunctionBase IG.Num.ScalarFunctionScriptControllerBase< ScalarFunctionType >.Function
| get protected

Scalar function (of type IScalarFunction) created on basis of definition in this DTO.

The documentation for this class was generated from the following file:

- igbase/data/serialization/dtos/ScalarFunctionScriptController.cs