IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Single objective optimization analysis results. Used to transfer parameters input (e.g. vector of parameters, request flags) to the analysis function and to store analysis output results (e.g. objective and constraint functions, their gradients, error codes, and flags indicating what has actually been calculated). REMARKS: Property CopyReferences specifies whether only references are copied when individial object fields are assigned and set (when the property is true), or values are actually copied (when false - deep copy). Each setter method also has the variant that always copies only the reference (function name appended by "Reference"). This makes possible to avoid duplication of allocated data and also to avoid having different data with the same references. AGREEMENTS: Optimization problem is defined as minimize f(x), subject to: c_i(x) less or equal 0, i=0...NI-1 c_j(x)=0, j=NI...NI+NE-1. Here x is vector of parameters, f(x) is the objective function, and c_i(x) and c_j(c) are constraint functions. NI is number of inequality constraints and NE is number of equality constraints. If there are equality constraints then they are listed after inequality constraints. More...
Public Member Functions | |
AnalysisResults () | |
1 parameter, no constraints, 1 objective function. No gradients required More... | |
AnalysisResults (bool reqGradients) | |
1 parameter, no constraints, 1 objective function. More... | |
AnalysisResults (int numParameters) | |
Specified number of parameters, 1 objective, no constraints. No gradients required. More... | |
AnalysisResults (int numParameters, bool reqGradients) | |
Specified number of parameters, 1 objective, no constraints. No gradients required. More... | |
AnalysisResults (int numParameters, int numConstraints) | |
Specified number of parameters and constraints, 1 objective. No gradients required. More... | |
AnalysisResults (int numParameters, int numConstraints, bool reqGradients) | |
Specified number of parameters and constraints, 1 objective. No gradients required. More... | |
virtual bool | IsEqualityConstraint (int which) |
Returns true if the specified constraint is an equality constraint, and false otherwise. More... | |
virtual IVector | GetParameters () |
Returns vector of optimization parameters. More... | |
virtual void | SetParameters (IVector value) |
Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetParametersReference (IVector reference) |
Sets the vector of optimization parameters. Only the reference is copied. More... | |
virtual double | GetParameter (int index) |
Returns specific optimization parameter. Throws exception if not defined or index out of bounds. More... | |
virtual void | SetParameter (int index, double value) |
Sets the specified optimization parameter. More... | |
virtual double | GetObjective () |
Returns the value of the objective function. More... | |
virtual void | SetObjective (double value) |
Sets the value of the objective function. More... | |
virtual IVector | GetObjectiveGradient () |
Returns the objective function gradient. More... | |
virtual void | SetObjectiveGradient (IVector value) |
Sets the objective function gradient. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetObjectiveGradientReference (IVector reference) |
Sets the objective function gradient. Only the reference is copied. More... | |
virtual double | GetObjectiveGradient (int index) |
Returns the specified component of the objective function gradient. More... | |
virtual void | SetObjectiveGradient (int index, double value) |
Sets the specified component of the objective function gradient. More... | |
virtual List< double > | GetConstraints () |
Returns a list of constraint function values. More... | |
virtual void | SetConstraints (List< double > values) |
Sets the list of constraint function values. If CopyReferences=true (false by default) then only the list reference is copied. More... | |
virtual void | SetConstraintsReference (List< double > reference) |
Sets the list of constraint function values. Only the list reference is copied. More... | |
virtual double | GetConstraint (int which) |
Returns the specified constraint function value. More... | |
virtual void | SetConstraint (int which, double value) |
Sets the specified constraint function value. More... | |
virtual List< IVector > | GetConstraintGradients () |
Returns a list of constraint function gradients. More... | |
virtual void | SetConstraintGradients (List< IVector > values) |
Sets constraint function gradients. If CopyReferences=true (false by default) then only the list reference is copied. More... | |
virtual void | SetConstraintGradientsReference (List< IVector > reference) |
Sets constraint function gradients. Only the list reference is copied. More... | |
virtual IVector | GetConstraintGradient (int which) |
Returns the gradient of the specified constraint function. More... | |
virtual double | GetConstraintGradient (int which, int index) |
Returns the specific constraint function gradient component. More... | |
virtual void | SetConstraintGradient (int which, IVector value) |
Sets the specified constraint function gradient. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetConstraintGradientReference (int which, IVector reference) |
Sets the specified constraint function gradient. Only the reference is copied. More... | |
virtual void | SetConstraintGradient (int which, int index, double value) |
Sets the specified constraint fuction gradient component. More... | |
virtual IMatrix | GetObjectiveHessian () |
Returns the objective function's Hessian. More... | |
virtual void | SetObjectiveHessian (IMatrix value) |
Sets the objective functions' Hessian. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetObjectiveHessianReference (IMatrix reference) |
Sets the objective functions' Hessian. Only the reference is copied. More... | |
virtual double | GetObjectiveHessian (int rowIndex, int columnIndex) |
Returns the specified component of the objective function Hessian. More... | |
virtual void | SetObjectiveHessian (int rowIndex, int columnIndex, double value) |
Sets the specified component of the objective function's Hessian. More... | |
virtual List< IMatrix > | GetConstraintHessians () |
Returns the list of constraint functions' Hessians. More... | |
virtual void | SetConstraintHessians (List< IMatrix > values) |
Sets constraint functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied. More... | |
virtual void | SetConstraintHessiansReference (List< IMatrix > reference) |
Sets constraint functios' Hessians. Only the list reference is copied. More... | |
virtual IMatrix | GetConstraintHessian (int which) |
Returns Hessian of the specified constraint function. More... | |
virtual double | GetConstraintHessian (int which, int rowIndex, int columnIndex) |
Returns the specified component of Hessian of the specified constraint function. More... | |
virtual void | SetConstraintHessian (int which, IMatrix value) |
Sets the specified constraint function's Hessian. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetConstraintHessianReference (int which, IMatrix reference) |
Sets the specified constraint function's Hessian. Only the reference is copied. More... | |
virtual void | SetConstraintHessian (int which, int rowIndex, int columnIndex, double value) |
Sets the specified component of the specified constraint's Hessian. More... | |
virtual void | NullifyAll () |
Sets all objects (parameters and result objects) to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection. More... | |
virtual void | NullifyResults () |
Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection. More... | |
virtual void | AllocateParameters () |
Allocates space for parameters. More... | |
virtual void | AllocateRequested () |
Allocates space for all requested result objects. More... | |
virtual void | AllocateObjectiveGradient () |
Allocate space for objective function gradient. More... | |
virtual void | AllocateObjectiveHessian () |
Allocates space for objective function Hessian. More... | |
virtual void | AllocateConstraintsList () |
Allocates space for list of constraint functions. More... | |
virtual void | AllocateConstraintGradientsList () |
Allocates space for list of constraint function gradients. More... | |
virtual void | AllocateConstrainGradients () |
Allocates space for constraint function gradients (including for the list, if necessarty). More... | |
virtual void | AllocateConstraintGradient (int which) |
Allocates space for the specified constraint function gradient. More... | |
virtual void | AllocateConstraintHessiansList () |
Allocates space for the list of constraint functions' Hessians. More... | |
virtual void | AllocateConstraintHessians () |
Allocates space for constraint functions' Hessians (including space for the list, if necessary). More... | |
virtual void | AllocateConstraintHessian (int which) |
Allocates space for the specified constraint fucnction's Hessian. More... | |
virtual void | ResetResults () |
Sets all calculated flags to false, error code to 0 (no error) and error string to null. More... | |
virtual void | SetDimensions (int numParameters, int numConstraints) |
Sets the dimension of the analysis results object according to the specified values. More... | |
virtual void | SetDimensions (int numParameters, int numObjectives, int numConstraints) |
Sets the dimension of the analysis results object according to the specified values. More... | |
virtual void | PrepareResultStorage () |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false. More... | |
virtual void | PrepareResultStorage (bool resetCalculatedFlags) |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags. More... | |
virtual void | PrepareResultStorage (int numParameters, int numConstraints) |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false. More... | |
virtual void | PrepareResultStorage (int numParameters, int numObjectives, int numConstraints) |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false. More... | |
virtual void | PrepareResultStorage (int numParameters, int numObjectives, int numConstraints, bool resetCalculatedFlags) |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags. More... | |
virtual void | Copy (IAnalysisResults results) |
Copies data from another analysis results. More... | |
virtual IAnalysisResults | GetCopy () |
Returns an exact deep copy of the current object. More... | |
virtual bool | IsViolated (int which, double equalityTolerance) |
Returns true if the specified constraint is violated according to the current analysis results, false otherwise. More... | |
virtual bool | IsViolated (int which) |
Returns true if the specified constraint is violated according to the current analysis results, false otherwise. More... | |
virtual bool | IsFeasible (double equalityTolerance) |
Returns true if the current analysis results represent a feasible point. Feasible point is one where no constraints are violated. For unconstraint problems this method always returns true. More... | |
virtual bool | IsFeasible () |
Returns true if the current analysis results represent a feasible point. Feasible point is one where no constraints are violated. For unconstraint problems this method always returns true. More... | |
virtual int | GetNumViolatedConstraints (double equalityTolerance) |
Returns number of violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual int | GetNumViolatedConstraints () |
Returns number of violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual double | GetSumResiduals (double equalityTolerance) |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual double | GetSumResiduals () |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual double | GetMaximalResidual (double equalityTolerance) |
Returns the largest constraint function value corresponding to any violated constraint in the current analysis results, or 0 if there are no violated constraints. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual double | GetMaximalResidual () |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0. More... | |
virtual double | GetPenaltyTerm (int which, IPenaltyEvaluator evaluator) |
Returns value of the penalty term corresponding to the specified constraint, calculated by the specified penalty evaluator. More... | |
virtual double | GetSumPenaltyTerms (IPenaltyEvaluator evaluator) |
Returns sum of the penalty terms corresponding to all constraint, calculated by the specified penalty evaluator. More... | |
virtual double | GetMaxPenaltyTerm (IPenaltyEvaluator evaluator) |
Returns sum of the penalty terms corresponding to all constraint, calculated by the specified penalty evaluator. More... | |
override string | ToString () |
Returns a string representation of the current analysis results object in a standard IGLib form. More... | |
string | ToStringMath () |
Returns a string representation of the current analysis results object in a standard IGLib form (Mathematica-like format but with C representation of numbers). More... | |
Static Public Member Functions | |
static string | ToString (IAnalysisResults anres) |
Returns a string representation of the specified analysis results object in a standard IGLib form. More... | |
static string | ToStringRequestMath (IAnalysisResults anres) |
Returns a string representation of the specified analysis request object in a standard IGLib form (Mathematica-like format but with C representation of numbers). More... | |
static string | ToStringMath (IAnalysisResults anres) |
Returns a string representation of the specified analysis results object in a standard IGLib form (Mathematica-like format but with C representation of numbers). More... | |
static void | LoadStringRequestMath (string requestString, ref AnalysisResults anres) |
Reads analysis request data. More... | |
static void | LoadStringMath (string analysisOutputString, ref AnalysisResults anres) |
Reads analysis results data. More... | |
static void | SaveRequestMath (IAnalysisResults anres, string filePath) |
Saves the specified analysis request to a file. If the file already exists then it is overwritten. More... | |
static void | SaveRequestMath (IAnalysisResults anres, string filePath, bool append) |
Saves the specified analysis request to a file. More... | |
static void | SaveMath (IAnalysisResults anres, string filePath) |
Saves the specified analysis results to a file. If the file already exists then it is overwritten. More... | |
static void | SaveMath (IAnalysisResults anres, string filePath, bool append) |
Saves the specified analysis results to a file. More... | |
static void | LoadRequestMath (string filePath, ref AnalysisResults anResults) |
Loads analysis request data from a file in standard mathematical format and stores it in the specified analysis results object. More... | |
static void | LoadMath (string filePath, ref AnalysisResults anResults) |
Loads analysis results from a file in standard mathematical format and stores it in the specified analysis results object. More... | |
static void | SaveRequestJson (AnalysisResults anResulsts, string filePath) |
Saves (serializes) the specified analysis request to the specified JSON file. File is owerwritten if it exists. More... | |
static void | SaveRequestJson (AnalysisResults anResults, string filePath, bool append) |
Saves (serializes) the specified analysis request 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 | LoadRequestJson (string filePath, ref AnalysisResults anResultsRestored) |
Restores (deserializes) analysis request from the specified file in JSON format. More... | |
static void | SaveJson (AnalysisResults anResulsts, string filePath) |
Saves (serializes) the specified analysis results to the specified JSON file. File is owerwritten if it exists. More... | |
static void | SaveJson (AnalysisResults anResults, string filePath, bool append) |
Saves (serializes) the specified analysis results 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 AnalysisResults anResultsRestored) |
Restores (deserializes) analysis results from the specified file in JSON format. More... | |
static AnalysisResults | CreateExample (int numParameters, int numConstraints, bool reqObjective, bool reqConstraints, bool reqObjectiveGradient, bool reqConstraintGradients, bool reqObjectiveHessian, bool reqConstraintHessians) |
Creates an example analysis results object according to parameters, with some arbitrary result components. More... | |
Static Protected Member Functions | |
static void | AppendRequestFlagsMath (StringBuilder sb, IAnalysisResults anres) |
Protected Attributes | |
int | _numParameters = 0 |
int | _numObjectives = 1 |
int | _numConstraints = 0 |
int | _numEqualityConstraints = 0 |
IVector | _parameters |
double | _objective |
IVector | _objectiveGradient |
IMatrix | _objectiveHessian |
List< double > | _constraints |
List< IVector > | _constraintGradients |
List< IMatrix > | _constraintHessians |
bool | _copyReferences = false |
bool | _reqObjective = false |
bool | _reqConstraints = false |
bool | _reqObjectiveGradient = false |
bool | _reqConstraintGradients = false |
bool | _reqObjectiveHessian = false |
bool | _reqConstraintHessians = false |
int | _errorCode = 0 |
string | _errorString = null |
bool | _calcObjective = false |
bool | _calcConstraints = false |
bool | _calcObjectiveGradient = false |
bool | _calcConstraintGradients = false |
bool | _calcObjectiveHessian = false |
bool | _calcConstraintHessians = false |
Properties | |
virtual int | NumParameters [get, set] |
Number of parameters. More... | |
virtual int | NumObjectives [get, set] |
Number of objective functions (normally 1 for this type, but can be 0). More... | |
virtual int | NumConstraints [get, set] |
Number of constraints. More... | |
virtual int | NumEqualityConstraints [get, set] |
Number of equality constraints. More... | |
virtual int | NumInequalityConstraints [get] |
Returns number of inequality constraints. More... | |
virtual bool | CopyReferences [get, set] |
Indicates whether just references can be copied when setting optimization parameters or results. If false then deep copy is always performed. Default is false. More... | |
virtual IVector | Parameters [get, set] |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning. More... | |
virtual double | Objective [get, set] |
Value of the objective function. More... | |
virtual IVector | ObjectiveGradient [get, set] |
Objective function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
virtual List< double > | Constraints [get, set] |
Constraint function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual List< IVector > | ConstraintGradients [get, set] |
Constraint function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual IMatrix | ObjectiveHessian [get, set] |
Objective function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
virtual List< IMatrix > | ConstraintHessians [get, set] |
Constraint functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual bool | ReqObjective [get, set] |
Indicates whether calculation of objective function is/was requested. More... | |
virtual bool | ReqObjectiveGradient [get, set] |
Indicates whether calculation of objective function gradient is/was requested. More... | |
virtual bool | ReqObjectiveHessian [get, set] |
Indicates whether calculation of objective function Hessian is/was requested. More... | |
virtual bool | ReqConstraints [get, set] |
Indicates whether calculation of constraint functions is/was requested. More... | |
virtual bool | ReqConstraintGradients [get, set] |
Indicates whether calculation of constraint functions gradient is/was requested. More... | |
virtual bool | ReqConstraintHessians [get, set] |
Indicates whether calculation of constraint functions Hessian is/was requested. More... | |
virtual int | ErrorCode [get, set] |
Error code. 0 - everything is OK. negative value - something went wrong. More... | |
virtual String | ErrorString [get, set] |
Error string indicating what went wrong. More... | |
virtual bool | Calculated [get, set] |
Collectively gets or sets calculated flags. Set false: all calculated flags are set to false. Set true: all calculated flags for which the corresponding request flags are true, are set to truee, others are set to false. Get: returns true if all the flags for which the corresponding request flags are true, are also true. Otherwise returns false. More... | |
virtual bool | CalculatedObjective [get, set] |
Indicates whether calculation of objective function is/was requested. More... | |
virtual bool | CalculatedObjectiveGradient [get, set] |
Indicates whether calculation of objective function gradient is/was requested. More... | |
virtual bool | CalculatedObjectiveHessian [get, set] |
Indicates whether calculation of objective function Hessian is/was requested. More... | |
virtual bool | CalculatedConstraints [get, set] |
Indicates whether calculation of constraint functions is/was requested. More... | |
virtual bool | CalculatedConstraintGradients [get, set] |
Indicates whether calculation of constraint functions gradient is/was requested. More... | |
virtual bool | CalculatedConstraintHessians [get, set] |
Indicates whether calculation of constraint functions Hessian is/was requested. More... | |
Properties inherited from IG.Num.IAnalysisResults | |
int | NumParameters [get, set] |
Number of parameters. More... | |
int | NumObjectives [get, set] |
Number of objective functions (normally 1 for this type, but can be 0). More... | |
int | NumConstraints [get, set] |
Number of constraints. More... | |
int | NumEqualityConstraints [get, set] |
Number of equality constraints. More... | |
bool | CopyReferences [get, set] |
Indicates whether just references can be copied when setting optimization parameters or results. If false then deep copy is always be performed. Default is false. More... | |
IVector | Parameters [get, set] |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning. More... | |
double | Objective [get, set] |
Value of the objective function. More... | |
IVector | ObjectiveGradient [get, set] |
Objective function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
List< double > | Constraints [get, set] |
Constraint function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
List< IVector > | ConstraintGradients [get, set] |
Constraint function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
IMatrix | ObjectiveHessian [get, set] |
Objective function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
List< IMatrix > | ConstraintHessians [get, set] |
Constraint functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
bool | ReqObjective [get, set] |
Indicates whether calculation of objective function is/was requested. More... | |
bool | ReqObjectiveGradient [get, set] |
Indicates whether calculation of objective function gradient is/was requested. More... | |
bool | ReqObjectiveHessian [get, set] |
Indicates whether calculation of objective function Hessian is/was requested. More... | |
bool | ReqConstraints [get, set] |
Indicates whether calculation of constraint functions is/was requested. More... | |
bool | ReqConstraintGradients [get, set] |
Indicates whether calculation of constraint functions gradient is/was requested. More... | |
bool | ReqConstraintHessians [get, set] |
Indicates whether calculation of constraint functions Hessian is/was requested. More... | |
int | ErrorCode [get, set] |
Error code. 0 - everything is OK. negative value - something went wrong. More... | |
String | ErrorString [get, set] |
Error string indicating what went wrong. More... | |
bool | Calculated [get, set] |
Collectively gets or sets calculated flags. Set false: all calculated flags are set to false. Set true: all calculated flags for which the corresponding request flags are true, are set to truee, others are set to false. Get: returns true if all the flags for which the corresponding request flags are true, are also true. Otherwise returns false. More... | |
bool | CalculatedObjective [get, set] |
Indicates whether calculation of objective function is/was requested. More... | |
bool | CalculatedObjectiveGradient [get, set] |
Indicates whether calculation of objective function gradient is/was requested. More... | |
bool | CalculatedObjectiveHessian [get, set] |
Indicates whether calculation of objective function Hessian is/was requested. More... | |
bool | CalculatedConstraints [get, set] |
Indicates whether calculation of constraint functions is/was requested. More... | |
bool | CalculatedConstraintGradients [get, set] |
Indicates whether calculation of constraint functions gradient is/was requested. More... | |
bool | CalculatedConstraintHessians [get, set] |
Indicates whether calculation of constraint functions Hessian is/was requested. More... | |
Static Private Member Functions | |
static string | ToStringMath (bool value) |
Returns a atring representation of a boolean value: "0" for false and "1" for true. More... | |
static void | ReadAnalysisRequest (string filePath, ref IVector parameters, ref bool reqcalcobj, ref bool reqcalcconstr, ref bool reqcalcgradobj, ref bool reqcalcgradconstr, ref string cd) |
Read the analysis data from data file Format: { { p1, p2, … }, { reqcalcobj, reqcalcconstr, reqcalcgradobj, reqcalcgradconstr }, cd } More... | |
static void | GetAnalysisRequest (string requestString, ref IVector parameters, ref bool reqcalcobj, ref bool reqcalcconstr, ref bool reqcalcgradobj, ref bool reqcalcgradconstr, ref string cd) |
Read the analysis request data from data file Format: { { p1, p2, … }, { reqcalcobj, reqcalcconstr, reqcalcgradobj, reqcalcgradconstr }, cd } More... | |
static void | ReadAnalysisResult (string filePath, ref IVector parameters, ref bool calcobj, ref bool calcconstr, ref bool calcgradobj, ref bool calcgradconstr, ref double obj, ref IVector constr, ref IVector dobjdp, ref IVector[] dconstr, ref int errorcode, ref bool reqcalcobj, ref bool reqcalcconstr, ref bool reqcalcgradobj, ref bool reqcalcgradconstr) |
Read the analysis result data from data file Format: More... | |
static void | GetAnalysisResult (string requestString, ref IVector parameters, ref bool calcobj, ref bool calcconstr, ref bool calcgradobj, ref bool calcgradconstr, ref double obj, ref IVector constr, ref IVector dobjdp, ref IVector[] dconstr, ref int errorcode, ref bool reqcalcobj, ref bool reqcalcconstr, ref bool reqcalcgradobj, ref bool reqcalcgradconstr) |
Read the analysis result data from data file Format: More... | |
Single objective optimization analysis results. Used to transfer parameters input (e.g. vector of parameters, request flags) to the analysis function and to store analysis output results (e.g. objective and constraint functions, their gradients, error codes, and flags indicating what has actually been calculated). REMARKS: Property CopyReferences specifies whether only references are copied when individial object fields are assigned and set (when the property is true), or values are actually copied (when false - deep copy). Each setter method also has the variant that always copies only the reference (function name appended by "Reference"). This makes possible to avoid duplication of allocated data and also to avoid having different data with the same references. AGREEMENTS: Optimization problem is defined as minimize f(x), subject to: c_i(x) less or equal 0, i=0...NI-1 c_j(x)=0, j=NI...NI+NE-1. Here x is vector of parameters, f(x) is the objective function, and c_i(x) and c_j(c) are constraint functions. NI is number of inequality constraints and NE is number of equality constraints. If there are equality constraints then they are listed after inequality constraints.
$A Igor Jan08 Jun08;
|
inline |
1 parameter, no constraints, 1 objective function. No gradients required
|
inline |
1 parameter, no constraints, 1 objective function.
reqGradients | Whether gradient of the objective function is required. |
|
inline |
Specified number of parameters, 1 objective, no constraints. No gradients required.
numParameters | Number of parameters. |
|
inline |
Specified number of parameters, 1 objective, no constraints. No gradients required.
numParameters | Number of parameters. |
reqGradients | Whether gradients are requested. |
|
inline |
Specified number of parameters and constraints, 1 objective. No gradients required.
numParameters | Number of parameters. |
numConstraints | Number of constraints. |
|
inline |
Specified number of parameters and constraints, 1 objective. No gradients required.
numParameters | Number of parameters. |
numConstraints | Number of constraints. |
reqGradients | Whether calcullation of gradients is required. |
|
inlinevirtual |
Returns true if the specified constraint is an equality constraint, and false otherwise.
which | Index of constraint to determine the type. |
|
inlinevirtual |
Returns vector of optimization parameters.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the vector of optimization parameters. Only the reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
Referenced by IG.Num.AnalysisResults.CreateExample().
|
inlinevirtual |
Returns specific optimization parameter. Throws exception if not defined or index out of bounds.
index | Index of parameter to be returned (counting from 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified optimization parameter.
index | Index of parameter to be set (counting from 0). |
value | Parameter value. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the value of the objective function.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the value of the objective function.
value | Value to be assigned to the objective function. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the objective function gradient.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the objective function gradient. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the objective function gradient. Only the reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the specified component of the objective function gradient.
index | Index of the component. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified component of the objective function gradient.
index | Index of objective gradient component to be set. |
value | Value of the objective gradient component. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns a list of constraint function values.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the list of constraint function values. If CopyReferences=true (false by default) then only the list reference is copied.
values | Values of constraint functions. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the list of constraint function values. Only the list reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the specified constraint function value.
which | Specifies which constraint function to return (counting from 0). |
Implements IG.Num.IAnalysisResults.
Referenced by IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
inlinevirtual |
Sets the specified constraint function value.
which | Specifies which constraint function is set (counting from 0). |
value | Assigned value of the constraint function. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns a list of constraint function gradients.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets constraint function gradients. If CopyReferences=true (false by default) then only the list reference is copied.
values | Value to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets constraint function gradients. Only the list reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the gradient of the specified constraint function.
which | Specifies which constraint function to take (couonted from 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the specific constraint function gradient component.
which | Specifies which constraint function to take (couonted from 0). |
index | Specifies gradient component (conted form 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified constraint function gradient. If CopyReferences=true (false by default) then only the reference is copied.
which | Specifies which constraint function to take (couonted from 0). |
value | Value of the gradient to be assigned. |
Implements IG.Num.IAnalysisResults.
References IG.Num.IVector.GetCopy().
|
inlinevirtual |
Sets the specified constraint function gradient. Only the reference is copied.
which | Specifies which constraint function to take (couonted from 0). |
reference | Gradient reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified constraint fuction gradient component.
which | Specifies which constraint function to take (couonted from 0). |
index | Specified index of gradient coponent to be set. |
value | Value to be assigned to the specified component. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the objective function's Hessian.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the objective functions' Hessian. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the objective functions' Hessian. Only the reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the specified component of the objective function Hessian.
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified component of the objective function's Hessian.
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
value | Value to be assigned to Hessian. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the list of constraint functions' Hessians.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets constraint functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied.
values | List of Hessians to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets constraint functios' Hessians. Only the list reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns Hessian of the specified constraint function.
which | Specifies which constraint function it applies to (counting from 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the specified component of Hessian of the specified constraint function.
which | Specifies which constraint function it applies to (counting from 0). |
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified constraint function's Hessian. If CopyReferences=true (false by default) then only the reference is copied.
which | Specifies which constraint function it applies to (counting from 0). |
value | Hessian matrix to be assigned. |
Implements IG.Num.IAnalysisResults.
References IG.Num.IMatrix.GetCopy().
|
inlinevirtual |
Sets the specified constraint function's Hessian. Only the reference is copied.
which | Specifies which constraint function it applies to (counting from 0). |
reference | Hessian matrix reference to be assigned. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the specified component of the specified constraint's Hessian.
which | Specifies which constraint function it applies to (counting from 0). |
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
value | Value to which Hessian element is set. |
Value to which Hessian element is set.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets all objects (parameters and result objects) to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for parameters.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for all requested result objects.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocate space for objective function gradient.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for objective function Hessian.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for list of constraint functions.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for list of constraint function gradients.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for constraint function gradients (including for the list, if necessarty).
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for the specified constraint function gradient.
which | Specifies which constraint function it applies to (countinf form 0). |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for the list of constraint functions' Hessians.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Allocates space for constraint functions' Hessians (including space for the list, if necessary).
Implements IG.Num.IAnalysisResults.
References IG.Num.m.
|
inlinevirtual |
Allocates space for the specified constraint fucnction's Hessian.
which | Specifies which constraint function it applies to (conting form 0). |
Implements IG.Num.IAnalysisResults.
References IG.Num.m.
|
inlinevirtual |
Sets all calculated flags to false, error code to 0 (no error) and error string to null.
Implements IG.Num.IAnalysisResults.
Referenced by IG.Num.OptFileManager.ServerAnalyse().
|
inlinevirtual |
Sets the dimension of the analysis results object according to the specified values.
Number of objective functions is set to 1.
numParameters | Number of parameters. |
numConstraints | Number of constraints. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Sets the dimension of the analysis results object according to the specified values.
numParameters | Number of parameters. |
numObjectives | Number of objective functions. |
numConstraints | Number of constraints. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false.
Things whose calculation is not requested are not calculated.
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags.
Things whose calculation is not requested are not calculated.
resetCalculatedFlags | Whether the calculation flags are reset to false or not. |
Implements IG.Num.IAnalysisResults.
References IG.Num.VectorBase.Resize(), and IG.Num.MatrixBase.Resize().
|
inlinevirtual |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false.
This method also sets dimensions before preparing the storage (i.e. number of parameters and constraints while number of objective functions is set to 1).
Things whose calculation is not requested are not calculated.
numParameters | Number of parameters. |
numConstraints | Number of constraints. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags, and resets calculation flags to false.
This method also sets dimensions before preparing the storage (i.e. number of parameters, objective functions and constraints).
Things whose calculation is not requested are not calculated.
numParameters | Number of parameters. |
numObjectives | Number of objective functions. |
numConstraints | Number of constraints. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Prepares data storage for results (allocates the appropriate vectors, matrices, lists, etc.) according to the numbers of parameters, constraint functions, and request flags.
This method also sets dimensions before preparing the storage (i.e. number of parameters, objective functions and constraints).
Things whose calculation is not requested are not calculated.
numParameters | Number of parameters. |
numObjectives | Number of objective functions. |
numConstraints | Number of constraints. |
resetCalculatedFlags | Whether the calculation flags are reset to false or not. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Copies data from another analysis results.
results | Analysis results which data is copied from. |
Implements IG.Num.IAnalysisResults.
References IG.Num.IAnalysisResults.CalculatedConstraintGradients, IG.Num.IAnalysisResults.CalculatedConstraintHessians, IG.Num.IAnalysisResults.CalculatedConstraints, IG.Num.IAnalysisResults.CalculatedObjective, IG.Num.IAnalysisResults.CalculatedObjectiveGradient, IG.Num.IAnalysisResults.CalculatedObjectiveHessian, IG.Num.IAnalysisResults.ConstraintGradients, IG.Num.IAnalysisResults.ConstraintHessians, IG.Num.IAnalysisResults.Constraints, IG.Num.IAnalysisResults.ErrorCode, IG.Num.IAnalysisResults.ErrorString, IG.Num.IAnalysisResults.NumConstraints, IG.Num.IAnalysisResults.NumEqualityConstraints, IG.Num.IAnalysisResults.NumObjectives, IG.Num.IAnalysisResults.NumParameters, IG.Num.IAnalysisResults.Objective, IG.Num.IAnalysisResults.ObjectiveGradient, IG.Num.IAnalysisResults.ObjectiveHessian, IG.Num.IAnalysisResults.Parameters, IG.Num.IAnalysisResults.ReqConstraintGradients, IG.Num.IAnalysisResults.ReqConstraintHessians, IG.Num.IAnalysisResults.ReqConstraints, IG.Num.IAnalysisResults.ReqObjective, IG.Num.IAnalysisResults.ReqObjectiveGradient, and IG.Num.IAnalysisResults.ReqObjectiveHessian.
Referenced by IG.Num.AnalysisResults.GetCopy().
|
inlinevirtual |
Returns an exact deep copy of the current object.
Implements IG.Num.IAnalysisResults.
References IG.Num.AnalysisResults.Copy().
|
inlinevirtual |
Returns true if the specified constraint is violated according to the current analysis results, false otherwise.
which | Specifies the constraint in question. |
equalityTolerance | Tolerance for violation of equality constraints. If constraint function corresponding to equality conatraint is less or equal than tolerance then the corresponding constraint is considered non-violated. |
IndexOutOfRangeException | when constraint index is smaller lesser than 0 or greater than the number of constraints. |
InvalidOperationException | when constraints are not evaluated. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns true if the specified constraint is violated according to the current analysis results, false otherwise.
which | Specifies the constraint in question. |
IndexOutOfRangeException | when constraint index is smaller lesser than 0 or greater than the number of constraints. |
InvalidOperationException | when constraints are not evaluated. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns true if the current analysis results represent a feasible point. Feasible point is one where no constraints are violated. For unconstraint problems this method always returns true.
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns true if the current analysis results represent a feasible point. Feasible point is one where no constraints are violated. For unconstraint problems this method always returns true.
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns number of violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0.
equalityTolerance | Tolerance for violation of equality constraints. If constraint function corresponding to equality conatraint is less or equal than tolerance then the corresponding constraint is considered non-violated. |
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns number of violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0.
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0.
equalityTolerance | Tolerance for violation of equality constraints. If constraint function corresponding to equality conatraint is less or equal than tolerance then the corresponding constraint is considered non-violated. |
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0.
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns the largest constraint function value corresponding to any violated constraint in the current analysis results, or 0 if there are no violated constraints. Specific constraint is violated if the corresponding constraint function is greater than 0.
equalityTolerance | Tolerance for violation of equality constraints. If constraint function corresponding to equality conatraint is less or equal than tolerance then the corresponding constraint is considered non-violated. |
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns sum of constraint function values corresponding to violated constraints in the current analysis results. Specific constraint is violated if the corresponding constraint function is greater than 0.
InvalidOperationException | If constraint optimization results do not contain evaluated constraint values. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns value of the penalty term corresponding to the specified constraint, calculated by the specified penalty evaluator.
which | Specifies the constraint in question. |
evaluator | Penalty function evaluator that evaluates penalty functions. |
Implements IG.Num.IAnalysisResults.
References IG.Num.IPenaltyEvaluator.PenaltyValue().
|
inlinevirtual |
Returns sum of the penalty terms corresponding to all constraint, calculated by the specified penalty evaluator.
evaluator | Penalty function evaluator that evaluates penalty functions. |
Implements IG.Num.IAnalysisResults.
|
inlinevirtual |
Returns sum of the penalty terms corresponding to all constraint, calculated by the specified penalty evaluator.
evaluator | Penalty function evaluator that evaluates penalty functions. |
Implements IG.Num.IAnalysisResults.
|
inlinestaticprivate |
Returns a atring representation of a boolean value: "0" for false and "1" for true.
value | Value whose string representation is returned. |
Referenced by IG.Num.AnalysisResultsExtensions.ToStringMath().
|
inlinestaticprotected |
|
inlinestatic |
Returns a string representation of the specified analysis results object in a standard IGLib form.
anres | Object whose string representation is returned. |
Referenced by IG.Script.LoadableScriptShellNeuralBase.TestAnalysis(), and IG.Num.AnalysisResultsExtensions.ToString().
|
inlinestatic |
Returns a string representation of the specified analysis request object in a standard IGLib form (Mathematica-like format but with C representation of numbers).
anres | Object whose string representation is returned. |
References IG.Num.IAnalysisResults.Parameters, and IG.Num.VectorBase.ToStringMath().
Referenced by IG.Num.AnalysisResultsExtensions.ToStringMathRequest().
|
inlinestatic |
Returns a string representation of the specified analysis results object in a standard IGLib form (Mathematica-like format but with C representation of numbers).
anres | Object whose string representation is returned. |
References IG.Num.IAnalysisResults.CalculatedConstraintGradients, IG.Num.IAnalysisResults.CalculatedConstraints, IG.Num.IAnalysisResults.CalculatedObjective, IG.Num.IAnalysisResults.CalculatedObjectiveGradient, IG.Num.IAnalysisResults.ErrorCode, IG.Num.IAnalysisResults.GetConstraint(), IG.Num.IAnalysisResults.GetConstraintGradient(), IG.Num.IAnalysisResults.NumConstraints, IG.Num.IAnalysisResults.Objective, IG.Num.IAnalysisResults.ObjectiveGradient, IG.Num.IAnalysisResults.Parameters, and IG.Num.VectorBase.ToStringMath().
|
inlinestatic |
Reads analysis request data.
requestString | |
anres |
$A Igor Mar11; Tako78 Apr11;
|
inlinestatic |
Reads analysis results data.
analysisOutputString | String from which data is read. |
anres | Object where results are stored. |
$A Igor Mar11; Tako78 Apr11;
|
inlinestatic |
Saves the specified analysis request to a file. If the file already exists then it is overwritten.
anres | Object from which analysis request is saved. |
filePath | Path to the file where analysis request is stored. |
Referenced by IG.Num.AnalysisResultsExtensions.SaveRequestMath(), and IG.Num.OptFileManager.WriteAnalysisInputMath().
|
inlinestatic |
Saves the specified analysis request to a file.
anres | Object from which analysis request is saved. |
filePath | Path to the file where analysis request is stored. |
append | If true then contents are appended to the end of the file if the file already exists. |
|
inlinestatic |
Saves the specified analysis results to a file. If the file already exists then it is overwritten.
anres | Object from which analysis results are saved. |
filePath | Path to the file where analysis results are stored. |
Referenced by IG.Num.AnalysisResultsExtensions.SaveMath(), and IG.Num.OptFileManager.WriteAnalysisOutputMath().
|
inlinestatic |
Saves the specified analysis results to a file.
anres | Object from which analysis results are saved. |
filePath | Path to the file where analysis results are stored. |
append | If true then contents are appended to the end of the file if the file already exists. |
|
inlinestatic |
Loads analysis request data from a file in standard mathematical format and stores it in the specified analysis results object.
filePath | Path to the file from which object is read. |
anResults | Object where data is stored. |
Referenced by IG.Num.OptFileManager.ReadAnalysisInputMath().
|
inlinestatic |
Loads analysis results from a file in standard mathematical format and stores it in the specified analysis results object.
filePath | Path to the file from which object is read. |
anResults | Object where data is stored. |
Referenced by IG.Num.OptFileManager.ReadAnalysisOutputMath().
|
inlinestatic |
Saves (serializes) the specified analysis request to the specified JSON file. File is owerwritten if it exists.
anResulsts | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
|
inlinestatic |
Saves (serializes) the specified analysis request 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.
anResults | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
append | Specifies whether serialized data is appended at the end of the file in the case that the file already exists. |
|
inlinestatic |
Restores (deserializes) analysis request from the specified file in JSON format.
filePath | File from which object is restored. |
anResultsRestored | Object that is restored by deserialization. |
|
inlinestatic |
Saves (serializes) the specified analysis results to the specified JSON file. File is owerwritten if it exists.
anResulsts | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults().
|
inlinestatic |
Saves (serializes) the specified analysis results 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.
anResults | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
append | Specifies whether serialized data is appended at the end of the file in the case that the file already exists. |
|
inlinestatic |
Restores (deserializes) analysis results from the specified file in JSON format.
filePath | File from which object is restored. |
anResultsRestored | Object that is restored by deserialization. |
|
inlinestaticprivate |
Read the analysis data from data file Format: { { p1, p2, … }, { reqcalcobj, reqcalcconstr, reqcalcgradobj, reqcalcgradconstr }, cd }
filePath | Path to the file where training data are saved. |
parameters | Input and output parameters: { p1, p2, … }. |
reqcalcobj | Flag: reqcalcobj. |
reqcalcconstr | Flag: reqcalcconstr. |
reqcalcgradobj | Flag: reqcalcgradobj. |
reqcalcgradconstr | Flag: reqcalcgradconstr. |
cd | String: cd. |
$A Tako78 Mar11;
|
inlinestaticprivate |
Read the analysis request data from data file Format: { { p1, p2, … }, { reqcalcobj, reqcalcconstr, reqcalcgradobj, reqcalcgradconstr }, cd }
requestString | String with request analysis data. |
parameters | Input and output parameters: { p1, p2, … }. |
reqcalcobj | Flag: reqcalcobj. |
reqcalcconstr | Flag: reqcalcconstr. |
reqcalcgradobj | Flag: reqcalcgradobj. |
reqcalcgradconstr | Flag: reqcalcgradconstr. |
cd | String: cd. |
$A Tako78 Mar11;
References IG.Lib.UtilStr.ToBoolean().
|
inlinestaticprivate |
Read the analysis result data from data file Format:
filePath | Path to the file where training data are saved. |
parameters | Input and output parameters: { p1, p2, … }. |
calcobj | Flag for the objective function. |
calcconstr | Flag for constraint functions. |
calcgradobj | Gradient of the objective function. |
calcgradconstr | Gradients of constraint functions. |
obj | Value of the objective functions. |
constr | Values of the constraint functions. |
dobjdp | Derivatives of the objective function. |
dconstr | Derivatives of individual constraint functions. |
errorcode | Integer error code of analysis. |
reqcalcobj | Flag for calculation of the various values. |
reqcalcconstr | Flag for calculation of the various values. |
reqcalcgradobj | Flag for calculation of the various values. |
reqcalcgradconstr | Flag for calculation of the various values. |
$A Tako78 Apr11;
|
inlinestaticprivate |
Read the analysis result data from data file Format:
requestString | String with result analysis data. |
parameters | Input and output parameters: { p1, p2, … }. |
calcobj | Flag for the objective function. |
calcconstr | Flag for constraint functions. |
calcgradobj | Gradient of the objective function. |
calcgradconstr | Gradients of constraint functions. |
obj | Value of the objective functions. |
constr | Values of the constraint functions. |
dobjdp | Derivatives of the objective function. |
dconstr | Derivatives of individual constraint functions. |
errorcode | Integer error code of analysis. |
reqcalcobj | Flag for calculation of the various values. |
reqcalcconstr | Flag for calculation of the various values. |
reqcalcgradobj | Flag for calculation of the various values. |
reqcalcgradconstr | Flag for calculation of the various values. |
$A Tako78 Apr11;
References IG.Lib.UtilStr.ToBoolean().
|
inline |
Returns a string representation of the current analysis results object in a standard IGLib form.
|
inline |
Returns a string representation of the current analysis results object in a standard IGLib form (Mathematica-like format but with C representation of numbers).
|
inlinestatic |
Creates an example analysis results object according to parameters, with some arbitrary result components.
numParameters | Number of prameters of the optimization problem. |
numConstraints | Number of constraints. |
reqObjective | Whether calculation of the objective function is required. |
reqConstraints | Whether calculation of constraint functions is required. |
reqObjectiveGradient | Whether calculation of objective gradient is required. |
reqConstraintGradients | Whether calculation of constraint gradients is required. |
reqObjectiveHessian | Whether calculation of objective Hessian is required. |
reqConstraintHessians | Whether calculation of constraint Hessians is required. |
References IG.Num.VectorBase.Add(), IG.Num.AnalysisResults.CalculatedConstraintGradients, IG.Num.AnalysisResults.CalculatedConstraintHessians, IG.Num.AnalysisResults.CalculatedConstraints, IG.Num.AnalysisResults.CalculatedObjective, IG.Num.AnalysisResults.CalculatedObjectiveGradient, IG.Num.AnalysisResults.CalculatedObjectiveHessian, IG.Num.AnalysisResults.ConstraintGradients, IG.Num.AnalysisResults.ConstraintHessians, IG.Num.AnalysisResults.Constraints, IG.Num.AnalysisResults.NumConstraints, IG.Num.AnalysisResults.NumObjectives, IG.Num.AnalysisResults.NumParameters, IG.Num.AnalysisResults.Objective, IG.Num.AnalysisResults.ObjectiveGradient, IG.Num.AnalysisResults.ObjectiveHessian, IG.Num.AnalysisResults.ReqConstraintGradients, IG.Num.AnalysisResults.ReqConstraintHessians, IG.Num.AnalysisResults.ReqConstraints, IG.Num.AnalysisResults.ReqObjective, IG.Num.AnalysisResults.ReqObjectiveGradient, IG.Num.AnalysisResults.ReqObjectiveHessian, and IG.Num.AnalysisResults.SetParametersReference().
Referenced by IG.Lib.SerializerBase.TestSerializationAll().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
getset |
Number of parameters.
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain(), IG.Num.AnalysisResults.CreateExample(), and IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
getset |
Number of objective functions (normally 1 for this type, but can be 0).
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Number of constraints.
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain(), IG.Num.AnalysisResults.CreateExample(), and IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
getset |
Number of equality constraints.
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain().
|
get |
Returns number of inequality constraints.
|
getset |
Indicates whether just references can be copied when setting optimization parameters or results. If false then deep copy is always performed. Default is false.
|
getset |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning.
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
getset |
Value of the objective function.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), IG.Num.AnalysisResults.CreateExample(), and IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
getset |
Objective function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Constraint function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Constraint function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Objective function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Constraint functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of objective function is/was requested.
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Num.AnalysisRequestDto.CopyFromPlain(), IG.Num.AnalysisResults.CreateExample(), and IG.Script.LoadableScriptShellNeuralBase.TestAnalysis().
|
getset |
Indicates whether calculation of objective function gradient is/was requested.
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of objective function Hessian is/was requested.
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions is/was requested.
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions gradient is/was requested.
Referenced by IG.Num.OptFileManager.ClientTestCalculateAnalysisResults(), IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions Hessian is/was requested.
Referenced by IG.Num.AnalysisRequestDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Error code. 0 - everything is OK. negative value - something went wrong.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain().
|
getset |
Error string indicating what went wrong.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain().
|
getset |
Collectively gets or sets calculated flags. Set false: all calculated flags are set to false. Set true: all calculated flags for which the corresponding request flags are true, are set to truee, others are set to false. Get: returns true if all the flags for which the corresponding request flags are true, are also true. Otherwise returns false.
|
getset |
Indicates whether calculation of objective function is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of objective function gradient is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of objective function Hessian is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions gradient is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().
|
getset |
Indicates whether calculation of constraint functions Hessian is/was requested.
Referenced by IG.Num.AnalysisResultsDto.CopyFromPlain(), and IG.Num.AnalysisResults.CreateExample().