| IGLib 1.5 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
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
IG.Lib.ScalarFunctionLoader Class Reference

Dynamically generates IScalarFunction classes from user definitions. User can define in string form how function, its derivative, second derivative, integral, or inverse function is calculated. Then this class can be used to compile these definitions in the wrapping script, which is then used to create the corresponding function objects. More...

Inheritance diagram for IG.Lib.ScalarFunctionLoader:
[legend]
Collaboration diagram for IG.Lib.ScalarFunctionLoader:
[legend]

## Public Member Functions
| ScalarFunctionLoader ()
| Constructor. More...
void | InvalidateDefinitions ()
| Clears strings that define the function (i.e. strings that define expressions for function value, derivative, integral, inverse, etc.). Number of parameters is not reset. More...
void | SetNames (string returnedValueName, string functionArgumentName, string[] independentVariableNames)
| Sets names used in generated script code. More...
string[] | GetDefaultIndependentVariableNames (int numParam)
| Returns a table of default names of variables (within functions in the loadable scripts) that hold the independent variables (components of vector of parameters), for the specified number of parameters. More...
void | SaveCode (string filePath)
| Saves the generated script code to the specified file. File is overwritten if it already exists. More...
string | getDefinitionString (string[][] definitions, int ind1, int ind2)
| Returns the specific definition string out of a 2D jagged array of definitions, or null if the specified definition is not contained in the array of definitions. More...
string | GetParametersPlainListString ()
| Returns a string representation of the list of independent variables, separated by commas but not embedded in any braces. More...
string | Compile ()
| Compiles the code that contains dynamically loadable definition of a real function of one variable. More...
LoadableScalarFunctionBase | CreateScalarFunction ()
| Creates and returns an instance of dynamically compiled scalar function object. More...
LoadableScalarFunctionBase | CreateScalarFunction (IAffineTransformation transf)
| Creates and returns an instance of dynamically compiled scalar function object, where the scalar funciton is obtained from user defined expressions and affine trensformation of vector parameters. More...

## Static Public Member Functions
static void | Example ()
| Example of use of the ScalarFunctionLoader class. Creates a function loader and uses it for dynamic definition of functions. More...
static void | Example (string scriptPath)
| Example of use of the ScalarFunctionLoader class. Creates a function loader and uses it for dynamic definition of functions. More...

## Public Attributes
const string | DefaultScriptClassName = "ScalarFunctionScript"
| Default name of the class used in loadable scripts containing user definitions of scalar function class. More...
const string | FuncNameInitDynamic = "InitDynamic"
| Name of the function that initializes variables realated to dynamically loaded scalar function class. More...
const string | VarNameNumParameters = "_numParam"
| Name of variable (internal in class defined in loadable script) that holds the number of parameters. More...
const string | VarNameReturnedValueName = "_returnedValueName"
| Name of variable (internal in class defined in loadable script) that holds the name of local variable (defined within functions in the dynamically loaded script) where returned value is stored. More...
const string | DefaultReturnedValueName = "ret"
| Default name of the variable that holds returned value in script functions. More...
const string | VarNameFunctionArgumentParametersName = "_functionArgumentParametersName"
| Name of variable (internal in class defined in loadable script) that holds the names of function argument (defined within functions in the dynamically loaded script) through which independent variable is passed. More...
const string | DefaultFunctionArgumentParametersName = "parameters"
| Default name of vector of parameters in function arguments in script functions. More...
const string | VarNameFunctionArgumentGradientName = "_functionArgumentGradientName"
const string | DefaultFunctionArgumentGradientName = "gradient"
| Default name of gradient vector in function arguments in script functions. More...
const string | VarNameFunctionArgumentHessianName = "_functionArgumentHessianName"
const string | DefaultFunctionArgumentHessianName = "hessian"
| Default name of hessian vector in function arguments in script functions. More...
const string | DefaultIndependentVariableBaseName = "x"
| Default base name of the independent variables (components of parameter vector) in expression definitions used in scripts to define calculation of function values, derivatives, etc. More...
const string | VarNameIndependentVariableNames = "_independentVariableNames"
const string | VarNameValueDefinitionString = "_valueDefinitionString"
| Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function value. More...
const string | VarNameGradientDefinitionStrings = "_gradientDefinitionStrings"
| Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function derivative. More...
const string | VarNameHessianDefinitionStrings = "_hessianDefinitionStrings"
| Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function second derivative. More...
const string | FuncNameValueDefinition = "ReferenceValue"
| Name of the function (internal in class defined in loadable script) that defines calculation of function value. More...
const string | FuncNameGradientDefinition = "ReferenceGradientPlain"
| Name of the function (internal in class defined in loadable script) that defines calculation of function gradient. More...
const string | FuncNameHessianDefinition = "ReferenceHessianPlain"
| Name of the function (internal in class defined in loadable script) that defines calculation of function hessian. More...
const string | VarNameValueDefined = "_valueDefined"
| Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function value is implemented. More...
const string | VarNameGradientDefined = "_gradientDefined"
| Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function gradient is implemented. More...
const string | VarNameHessianDefined = "_hessianDefined"
| Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function hessian is implemented. More...

## Protected Member Functions
void | AppendIndents (StringBuilder sb, int numIndent)
| Appends to the apecified string builder the specified level of indentation. More...
void | AppendBeginComment (StringBuilder sb)
| Appends beginning of comment. More...
void | AppendEndcomment (StringBuilder sb)
| Appends end of comment. More...
void | AppendIndexComment (StringBuilder sb, string coponentBaseName, int index)
| Appends comment that denotes the componenent index. More...
void | AppendIndexComment (StringBuilder sb, string coponentBaseName, int index1, int index2)
| Appends comment that denotes the componenent index. More...
void | AppendSetVariable (StringBuilder sb, string varName, object value, int numIndents)
| Appends to the apecified string builder the C# statements that sets the specified variable to the specified value. More...
void | AppendSetVariable (StringBuilder sb, string varName, string[] values, string coponentBaseName, int numIndents)
| Appends to the apecified string builder the C# statements that sets the specified variable to the specified value. More...
void | AppendSetVariable (StringBuilder sb, string varName, string[][] values, string componentBaseName, int numIndents)
| Appends to the apecified string builder the C# statements that sets the specified variable to the specified value. More...
virtual string | GetCode ()
| Generates and returns script code for dynamically loadable function definition. More...

## Properties
object | Lock`[get]`
| Current object's central lock object. More...
bool | ValueDefined`[get]`
| Whether calculation of function value is defined. More...
bool | GradientDefined`[get]`
| Whether calculation of function gradient is defined. More...
bool | HessianDefined`[get]`
| Whether calculation of function Hessian is defined. More...
string | ReturnedValueName`[get, set]`
| Name of variable (within functions in the loadable scripts) that temporarily holds the returned value(s). Set to constant DefaultReturnedValueName by default. More...
string | FunctionArgumentParametersName`[get, set]`
| Name of parameters vector in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentParametersName by default. More...
string | FunctionArgumentGradientName`[get, set]`
| Name of gradient vector in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentGradientName by default. More...
string | FunctionArgumentHessianName`[get, set]`
| Name of Hessian matrix in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentHessianName by default. More...
int | NumParameters`[get, set]`
| Number of parameters of the scalar function that will be defined by a generated script More...
string | IndependentVariableBaseName`[get, set]`
| Base name from which names of individual components of independent variables (names of parameters used within fucntion definitions in scripts) are derived in the case that these names are not defined. More...
string[] | IndependentVariableNames`[get, set]`
| Names of variables (within functions in the loadable scripts) that hold the independent variables (components of vector of parameters). More...
string | ValueDefinitionString`[get, set]`
| Expression that defines function value. More...
string[] | GradientDefinitionStrings`[get, set]`
| Expressions that defines function gradient components. More...
string[][] | HessianDefinitionStrings`[get, set]`
| Expressions that define function hessian components. More...
string | Code`[get, protected set]`
| Generated script code. More...
ScriptLoaderBase | Loader`[get, protected set]`
| Script loader used to load and instantiate real function class generated from script. More...
bool | IsCompiled`[get, protected set]`
| Whether the current function definition has been compiled or not. More...
string | ScriptClassName`[get, protected set]`
| Name of the script class that containe definition of the compiled real function class. More...
LoadableScriptScalarFunctionBase | Creator`[get]`
| Returns an object of the dynamically compiled class that can create function objects. More...
LoadableScalarFunctionBase | Function`[get, protected set]`
| Returns an instance of a scalar function created by the current loader. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Private Member Functions
void | AppendFunctonDefinition (StringBuilder sb, string functionName, string definitionString, int numIndents)
| Appends to the apecified string builder the C# definition of a function of parameters returning double. Function is of form 'protected override double (double arg)'. More...
void | AppendFunctonDefinition (StringBuilder sb, string functionName, string[] definitionStrings, string returnedVectorName, int numIndents)
| Appends to the apecified string builder the C# definition of a function of parameters returning a vector throufh IVector argument. Function is of form 'protected override double (IVector param, IVector result)'. More...
void | AppendFunctonDefinition (StringBuilder sb, string functionName, string[][] definitionStrings, string returnedMatrixName, int numIndents)
| Appends to the apecified string builder the C# definition of a function of parameters returning a vector throufh IVector argument. Function is of form 'protected override double (IVector param, IVector result)'. More...

## Private Attributes
object | _mainLock = new object()
string | _returnedValueName = DefaultReturnedValueName
string | _functionArgumentParametersName = DefaultFunctionArgumentParametersName
string | _functionArgumentGradientName = DefaultFunctionArgumentGradientName
string | _functionArgumentHessianName = DefaultFunctionArgumentHessianName
string | _independentVariableBaseName = DefaultIndependentVariableBaseName
string | _valueDefinitionString
string | _code
int | _numParameters
string[] | _independentVariableNames = null
string[] | _gradientDefinitionStrings = null
string[][] | _hessianDefinitionStrings = null
ScriptLoaderBase | _loader
bool | _iscompiled = false
string | _scriptClassName
LoadableScriptScalarFunctionBase | _creator
LoadableScalarFunctionBase | _function

## Detailed Description

Dynamically generates IScalarFunction classes from user definitions. User can define in string form how function, its derivative, second derivative, integral, or inverse function is calculated. Then this class can be used to compile these definitions in the wrapping script, which is then used to create the corresponding function objects.

$A Igor Jun10;

## Constructor & Destructor Documentation

IG.Lib.ScalarFunctionLoader.ScalarFunctionLoader | ( |  | ) |
| inline

Constructor.

## Member Function Documentation

void IG.Lib.ScalarFunctionLoader.InvalidateDefinitions | ( |  | ) |
| inline

Clears strings that define the function (i.e. strings that define expressions for function value, derivative, integral, inverse, etc.). Number of parameters is not reset.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

void IG.Lib.ScalarFunctionLoader.SetNames | ( | string | returnedValueName,
|  | string | functionArgumentName,
|  | string[] | independentVariableNames
| ) |  |
| inline

Sets names used in generated script code.

Parameters

  returnedValueName | Name of the variabble that holds returned value in functions in generated script code.
  FunctionArgumentParametersName | Name of function argument in generated script code.
  independentVariableNames | Names of independent variable in generated script code.

string [] IG.Lib.ScalarFunctionLoader.GetDefaultIndependentVariableNames | ( | int | numParam | ) |
| inline

Returns a table of default names of variables (within functions in the loadable scripts) that hold the independent variables (components of vector of parameters), for the specified number of parameters.

Parameters

  numParam | Number of parameters.

void IG.Lib.ScalarFunctionLoader.SaveCode | ( | string | filePath | ) |
| inline

Saves the generated script code to the specified file. File is overwritten if it already exists.

Parameters

  filePath | Path to the file where script code is saved.

void IG.Lib.ScalarFunctionLoader.AppendIndents | ( | StringBuilder | sb,
|  | int | numIndent
| ) |  |
| inline protected

Appends to the apecified string builder the specified level of indentation.

Parameters

  sb | String builder to which indents are appended.
  numIndente | Number of indents that are appended.

void IG.Lib.ScalarFunctionLoader.AppendBeginComment | ( | StringBuilder | sb | ) |
| inline protected

Appends beginning of comment.

Parameters

  sb | String buider that is used to assemble the compiled script.

void IG.Lib.ScalarFunctionLoader.AppendEndcomment | ( | StringBuilder | sb | ) |
| inline protected

Appends end of comment.

Parameters

  sb | String buider that is used to assemble the compiled script.

void IG.Lib.ScalarFunctionLoader.AppendIndexComment | ( | StringBuilder | sb,
|  | string | coponentBaseName,
|  | int | index
| ) |  |
| inline protected

Appends comment that denotes the componenent index.

Parameters

  sb | String buider that is used to assemble the compiled script.
  coponentBaseName | Component's base name used in the comment denoting indices.
  index2 | Second component index.

void IG.Lib.ScalarFunctionLoader.AppendIndexComment | ( | StringBuilder | sb,
|  | string | coponentBaseName,
|  | int | index1,
|  | int | index2
| ) |  |
| inline protected

Appends comment that denotes the componenent index.

Parameters

  sb | String buider that is used to assemble the compiled script.
  coponentBaseName | Component's base name used in the comment denoting indices.
  index1 | First component index.
  index2 | Second component index.

void IG.Lib.ScalarFunctionLoader.AppendSetVariable | ( | StringBuilder | sb,
|  | string | varName,
|  | object | value,
|  | int | numIndents
| ) |  |
| inline protected

Appends to the apecified string builder the C# statements that sets the specified variable to the specified value.

Parameters

  sb | String builder to which the statement is appended.
  varName | Name of the variable that is set.
  value | Value that is assigned to the variable.
  numIndents | Number of indents that are written before code lines.

void IG.Lib.ScalarFunctionLoader.AppendSetVariable | ( | StringBuilder | sb,
|  | string | varName,
|  | string[] | values,
|  | string | coponentBaseName,
|  | int | numIndents
| ) |  |
| inline protected

Appends to the apecified string builder the C# statements that sets the specified variable to the specified value.

Parameters

  sb | String builder to which the statement is appended.
  varName | Name of the variable that is set.
  value | Value that is assigned to the variable.
  numIndents | Number of indents that are written before code lines.

void IG.Lib.ScalarFunctionLoader.AppendSetVariable | ( | StringBuilder | sb,
|  | string | varName,
|  | stringvalues | [][],
|  | string | componentBaseName,
|  | int | numIndents
| ) |  |
| inline protected

Appends to the apecified string builder the C# statements that sets the specified variable to the specified value.

Parameters

  sb | String builder to which the statement is appended.
  varName | Name of the variable that is set.
  value | Value that is assigned to the variable.
  numIndents | Number of indents that are written before code lines.

void IG.Lib.ScalarFunctionLoader.AppendFunctonDefinition | ( | StringBuilder | sb,
|  | string | functionName,
|  | string | definitionString,
|  | int | numIndents
| ) |  |
| inline private

Appends to the apecified string builder the C# definition of a function of parameters returning double. Function is of form 'protected override double (double arg)'.

Parameters

  sb | String builder to which the code (function definition) is appended.
  functionName | Name of the function.
  definitionString | Expression that specifies how the returned value is calculated.
  numIndents | Number of indents that are prepended before code lines.

void IG.Lib.ScalarFunctionLoader.AppendFunctonDefinition | ( | StringBuilder | sb,
|  | string | functionName,
|  | string[] | definitionStrings,
|  | string | returnedVectorName,
|  | int | numIndents
| ) |  |
| inline private

Appends to the apecified string builder the C# definition of a function of parameters returning a vector throufh IVector argument. Function is of form 'protected override double (IVector param, IVector result)'.

Parameters

  sb | String builder to which the code (function definition) is appended.
  functionName | Name of the function.
  definitionStrings | Expressions that specify how components of the returned vector are calculated.
  returnedVectorName | Name of the formal vector argument that contains returned values.
  numIndents | Number of indents that are prepended before code lines.

string IG.Lib.ScalarFunctionLoader.getDefinitionString | ( | string | definitions[][],
|  | int | ind1,
|  | int | ind2
| ) |  |
| inline

Returns the specific definition string out of a 2D jagged array of definitions, or null if the specified definition is not contained in the array of definitions.

Parameters

  definitions | Definitions arranged in a 2D jagged array.
  ind1 | First index.
  ind2 | Second index.

void IG.Lib.ScalarFunctionLoader.AppendFunctonDefinition | ( | StringBuilder | sb,
|  | string | functionName,
|  | string | definitionStrings[][],
|  | string | returnedMatrixName,
|  | int | numIndents
| ) |  |
| inline private

Appends to the apecified string builder the C# definition of a function of parameters returning a vector throufh IVector argument. Function is of form 'protected override double (IVector param, IVector result)'.

Parameters

  sb | String builder to which the code (function definition) is appended.
  functionName | Name of the function.
  definitionStrings | Expressions that specify how components of the returned vector are calculated.
  returnedVectorName | Name of the formal vector argument that contains returned values.
  numIndents | Number of indents that are prepended before code lines.

string IG.Lib.ScalarFunctionLoader.GetParametersPlainListString | ( |  | ) |
| inline

Returns a string representation of the list of independent variables, separated by commas but not embedded in any braces.

References IG.Lib.UtilStr.GetParametersStringPlain().

Referenced by IG.Lib.ScalarFunctionLoader.Example().

virtual string IG.Lib.ScalarFunctionLoader.GetCode | ( |  | ) |
| inline protected virtual

Generates and returns script code for dynamically loadable function definition.

string IG.Lib.ScalarFunctionLoader.Compile | ( |  | ) |
| inline

Compiles the code that contains dynamically loadable definition of a real function of one variable.

Returns

LoadableScalarFunctionBase IG.Lib.ScalarFunctionLoader.CreateScalarFunction | ( |  | ) |
| inline

Creates and returns an instance of dynamically compiled scalar function object.

Referenced by IG.Num.Func2dFromScalarScript.CreateScalarFunction(), and IG.Lib.ScalarFunctionLoader.Example().

LoadableScalarFunctionBase IG.Lib.ScalarFunctionLoader.CreateScalarFunction | ( | IAffineTransformation | transf | ) |
| inline

Creates and returns an instance of dynamically compiled scalar function object, where the scalar funciton is obtained from user defined expressions and affine trensformation of vector parameters.

$A Igor Sep11;

static void IG.Lib.ScalarFunctionLoader.Example | ( |  | ) |
| inline static

Example of use of the ScalarFunctionLoader class. Creates a function loader and uses it for dynamic definition of functions.

$A Igor Jun10;

Referenced by IG.Script.ScriptAppBase.NumericsFunctionScriptScalarFuncitons().

static void IG.Lib.ScalarFunctionLoader.Example | ( | string | scriptPath | ) |
| inline static

Example of use of the ScalarFunctionLoader class. Creates a function loader and uses it for dynamic definition of functions.

Parameters

  scriptPath | Path where script that defines the function is saved. If null or empty string then script is not saved to a file.

$A Igor Jun10;

References IG.Lib.ScalarFunctionLoader.Code, IG.Lib.ScalarFunctionLoader.CreateScalarFunction(), IG.Lib.ScalarFunctionLoader.FunctionArgumentParametersName, IG.Lib.ScalarFunctionLoader.GetParametersPlainListString(), IG.Num.ScalarFunctionUntransformedBase.Gradient(), IG.Lib.ScalarFunctionLoader.GradientDefined, IG.Lib.LoadableScalarFunctionBase.GradientDefined, IG.Lib.ScalarFunctionLoader.GradientDefinitionStrings, IG.Num.ScalarFunctionUntransformedBase.Hessian(), IG.Lib.ScalarFunctionLoader.HessianDefined, IG.Lib.LoadableScalarFunctionBase.HessianDefined, IG.Lib.ScalarFunctionLoader.HessianDefinitionStrings, IG.Lib.ScalarFunctionLoader.IndependentVariableNames, IG.Lib.ScalarFunctionLoader.InvalidateDefinitions(), IG.Lib.LoadableScalarFunctionBase.NumParameters, IG.Lib.ScalarFunctionLoader.NumParameters, IG.Lib.UtilConsole.Read(), IG.Lib.ScalarFunctionLoader.ReturnedValueName, IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), IG.Lib.StopWatch.Time, IG.Num.IVector.ToString(), IG.Num.ScalarFunctionBase.Value(), IG.Lib.LoadableScalarFunctionBase.ValueDefined, and IG.Lib.ScalarFunctionLoader.ValueDefinitionString.

## Member Data Documentation

object IG.Lib.ScalarFunctionLoader._mainLock = new object()
| private

const string IG.Lib.ScalarFunctionLoader.DefaultScriptClassName = "ScalarFunctionScript"

Default name of the class used in loadable scripts containing user definitions of scalar function class.

const string IG.Lib.ScalarFunctionLoader.FuncNameInitDynamic = "InitDynamic"

Name of the function that initializes variables realated to dynamically loaded scalar function class.

const string IG.Lib.ScalarFunctionLoader.VarNameNumParameters = "_numParam"

Name of variable (internal in class defined in loadable script) that holds the number of parameters.

const string IG.Lib.ScalarFunctionLoader.VarNameReturnedValueName = "_returnedValueName"

Name of variable (internal in class defined in loadable script) that holds the name of local variable (defined within functions in the dynamically loaded script) where returned value is stored.

const string IG.Lib.ScalarFunctionLoader.DefaultReturnedValueName = "ret"

Default name of the variable that holds returned value in script functions.

const string IG.Lib.ScalarFunctionLoader.VarNameFunctionArgumentParametersName = "_functionArgumentParametersName"

Name of variable (internal in class defined in loadable script) that holds the names of function argument (defined within functions in the dynamically loaded script) through which independent variable is passed.

const string IG.Lib.ScalarFunctionLoader.DefaultFunctionArgumentParametersName = "parameters"

Default name of vector of parameters in function arguments in script functions.

const string IG.Lib.ScalarFunctionLoader.VarNameFunctionArgumentGradientName = "_functionArgumentGradientName"

const string IG.Lib.ScalarFunctionLoader.DefaultFunctionArgumentGradientName = "gradient"

Default name of gradient vector in function arguments in script functions.

const string IG.Lib.ScalarFunctionLoader.VarNameFunctionArgumentHessianName = "_functionArgumentHessianName"

const string IG.Lib.ScalarFunctionLoader.DefaultFunctionArgumentHessianName = "hessian"

Default name of hessian vector in function arguments in script functions.

const string IG.Lib.ScalarFunctionLoader.DefaultIndependentVariableBaseName = "x"

Default base name of the independent variables (components of parameter vector) in expression definitions used in scripts to define calculation of function values, derivatives, etc.

const string IG.Lib.ScalarFunctionLoader.VarNameIndependentVariableNames = "_independentVariableNames"

const string IG.Lib.ScalarFunctionLoader.VarNameValueDefinitionString = "_valueDefinitionString"

Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function value.

const string IG.Lib.ScalarFunctionLoader.VarNameGradientDefinitionStrings = "_gradientDefinitionStrings"

Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function derivative.

const string IG.Lib.ScalarFunctionLoader.VarNameHessianDefinitionStrings = "_hessianDefinitionStrings"

Name of the variable (internal in class defined in loadable script) that holds user definition (as string) of function second derivative.

const string IG.Lib.ScalarFunctionLoader.FuncNameValueDefinition = "ReferenceValue"

Name of the function (internal in class defined in loadable script) that defines calculation of function value.

const string IG.Lib.ScalarFunctionLoader.FuncNameGradientDefinition = "ReferenceGradientPlain"

Name of the function (internal in class defined in loadable script) that defines calculation of function gradient.

const string IG.Lib.ScalarFunctionLoader.FuncNameHessianDefinition = "ReferenceHessianPlain"

Name of the function (internal in class defined in loadable script) that defines calculation of function hessian.

const string IG.Lib.ScalarFunctionLoader.VarNameValueDefined = "_valueDefined"

Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function value is implemented.

const string IG.Lib.ScalarFunctionLoader.VarNameGradientDefined = "_gradientDefined"

Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function gradient is implemented.

const string IG.Lib.ScalarFunctionLoader.VarNameHessianDefined = "_hessianDefined"

Name of the variable (internal in class defined in loadable script) that holds a flag telling whether calculation of function hessian is implemented.

string IG.Lib.ScalarFunctionLoader._returnedValueName = DefaultReturnedValueName
| private

string IG.Lib.ScalarFunctionLoader._functionArgumentParametersName = DefaultFunctionArgumentParametersName
| private

string IG.Lib.ScalarFunctionLoader._functionArgumentGradientName = DefaultFunctionArgumentGradientName
| private

string IG.Lib.ScalarFunctionLoader._functionArgumentHessianName = DefaultFunctionArgumentHessianName
| private

string IG.Lib.ScalarFunctionLoader._independentVariableBaseName = DefaultIndependentVariableBaseName
| private

string IG.Lib.ScalarFunctionLoader._valueDefinitionString
| private

string IG.Lib.ScalarFunctionLoader._code
| private

int IG.Lib.ScalarFunctionLoader._numParameters
| private

string [] IG.Lib.ScalarFunctionLoader._independentVariableNames = null
| private

string [] IG.Lib.ScalarFunctionLoader._gradientDefinitionStrings = null
| private

string [][] IG.Lib.ScalarFunctionLoader._hessianDefinitionStrings = null
| private

ScriptLoaderBase IG.Lib.ScalarFunctionLoader._loader
| private

bool IG.Lib.ScalarFunctionLoader._iscompiled = false
| private

string IG.Lib.ScalarFunctionLoader._scriptClassName
| private

LoadableScriptScalarFunctionBase IG.Lib.ScalarFunctionLoader._creator
| private

LoadableScalarFunctionBase IG.Lib.ScalarFunctionLoader._function
| private

## Property Documentation

object IG.Lib.ScalarFunctionLoader.Lock
| get

Current object's central lock object.

bool IG.Lib.ScalarFunctionLoader.ValueDefined
| get

Whether calculation of function value is defined.

bool IG.Lib.ScalarFunctionLoader.GradientDefined
| get

Whether calculation of function gradient is defined.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

bool IG.Lib.ScalarFunctionLoader.HessianDefined
| get

Whether calculation of function Hessian is defined.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.ReturnedValueName
| get set

Name of variable (within functions in the loadable scripts) that temporarily holds the returned value(s). Set to constant DefaultReturnedValueName by default.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.FunctionArgumentParametersName
| get set

Name of parameters vector in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentParametersName by default.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.FunctionArgumentGradientName
| get set

Name of gradient vector in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentGradientName by default.

string IG.Lib.ScalarFunctionLoader.FunctionArgumentHessianName
| get set

Name of Hessian matrix in function arguments (in functions in the loadable scripts). Set to constant DefaultFunctionArgumentHessianName by default.

int IG.Lib.ScalarFunctionLoader.NumParameters
| get set

Number of parameters of the scalar function that will be defined by a generated script

- dimension of space in which the scalar function is defined.

Referenced by IG.Num.Func2dFromScalarScript.CreateScalarFunction(), and IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.IndependentVariableBaseName
| get set

Base name from which names of individual components of independent variables (names of parameters used within fucntion definitions in scripts) are derived in the case that these names are not defined.

string [] IG.Lib.ScalarFunctionLoader.IndependentVariableNames
| get set

Names of variables (within functions in the loadable scripts) that hold the independent variables (components of vector of parameters).

Referenced by IG.Num.Func2dFromScalarScript.CreateScalarFunction(), and IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.ValueDefinitionString
| get set

Expression that defines function value.

Referenced by IG.Num.Func2dFromScalarScript.CreateScalarFunction(), and IG.Lib.ScalarFunctionLoader.Example().

string [] IG.Lib.ScalarFunctionLoader.GradientDefinitionStrings
| get set

Expressions that defines function gradient components.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

string [][] IG.Lib.ScalarFunctionLoader.HessianDefinitionStrings
| get set

Expressions that define function hessian components.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

string IG.Lib.ScalarFunctionLoader.Code
| get protected set

Generated script code.

Referenced by IG.Lib.ScalarFunctionLoader.Example().

ScriptLoaderBase IG.Lib.ScalarFunctionLoader.Loader
| get protected set

Script loader used to load and instantiate real function class generated from script.

$A Igor Jun10 Aug10;

bool IG.Lib.ScalarFunctionLoader.IsCompiled
| get protected set

Whether the current function definition has been compiled or not.

string IG.Lib.ScalarFunctionLoader.ScriptClassName
| get protected set

Name of the script class that containe definition of the compiled real function class.

LoadableScriptScalarFunctionBase IG.Lib.ScalarFunctionLoader.Creator
| get

Returns an object of the dynamically compiled class that can create function objects.

LoadableScalarFunctionBase IG.Lib.ScalarFunctionLoader.Function
| get protected set

Returns an instance of a scalar function created by the current loader.

Loader provides a property through which a scalar function created on demand can be accessed. If compiled scripts the invalid (e.g. when some contents are changed) the function will be created anew at next access, so it is always consistent with the loader data.

As alternative, the scalar function can be created by the CreateScalarFunction call, but this call creates a neew object every time. This property creates a single function that can be used by anoone using this property.

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

- igbase/interpreters/scriptloader/ScalarFunctionScriptLoader.cs