All Frameworks Class Hierarchy This Framework Indexes
OptimizationInterfaces Class CATOptValuesAndDerivativesAdapter
Usage: you can derive this class.
public class CATOptValuesAndDerivativesAdapter
CAA Adapter to CATIOptValuesAndDerivativesAccess Interface.
Role: This class should be derived to implement features extension to CATIOptValuesAndDerivativesAccess.
CATIOptValuesAndDerivativesAccess is the interface used by the algorithms of PEO to indentify and use features that provide an access to their derivatives.
- See also:
- CATIOptValuesAndDerivativesAccess
Constructor and Destructor Index
- o
CATOptValuesAndDerivativesAdapter()
-
- o
~CATOptValuesAndDerivativesAdapter()
-
Method Index
- o
GetDerivativeErrorMessages(CATListOfCATString&)
- Returns an error message if the tests of the existence of the derivatives has failed.
- o
GetFirstOrderDerivative(double*&)
- Returns the first order derivatives with respect to the variables.
- o
GetMagnitude(CATUnicodeString&)
- Returns the name of the magnitude used by the underlying contraint.
- o
GetNthOrderDerivative(double*&,int)
- Returns the second order derivatives with respect to the variables.
- o
GetNumberOfParameters(int&)
- Returns the number of parameters involved in the calculus of the derivative.
- o
GetNumberOfValues()
- Returns the number of values actually output by this sensor.
- o
GetOutputErrorMessages(CATListOfCATString&)
- Returns an error message if the method GetOutputValues has failed.
- o
GetOutputErrors(CATListOfInt&)
- Retrieves the status of each output.
- o
GetOutputValues(double*&)
- Retreives the values output by the feature.
- o
GetParametersDelta(CATListOfDouble&)
- Gets the parameters variations for the calculus of the derivative.
- o
GetParameters(CATLISTV(CATBaseUnknown_var)*&)
- Returns the parameters involved in the calculus of the derivative.
- o
GetSecondOrderDerivative(double*&)
- Returns the second order derivatives with respect to the variables.
- o
IsNumberOfOutputsVariable(int&)
- Specifies if the feature implementing this interface may output a different number of values after each call to GetOutputValues().
- o
SetFirstOrderDerivative(double*)
- Sets the first order derivatives with respect to the variables.
- o
SetParametersDelta(CATListOfDouble&)
- Specifies the parameters variations for the calculus of the derivative.
- o
SetParameters(CATLISTV(CATBaseUnknown_var)*)
- Specifies the parameters with respect to the derivatives of the object (local sensor or else) are calculated.
- o
SetSecondOrderDerivative(double*)
- Sets the second order derivatives with respect to the variables.
- o
TestDerivativesExistence(CATListOfInt&,int&)
- Tests the existence of the derivatives of the feature implementing this interface with respect to the parameters passed in argument.
Constructor and Destructor
o CATOptValuesAndDerivativesAdapter
| public CATOptValuesAndDerivativesAdapter( | ) |
-
o ~CATOptValuesAndDerivativesAdapter
| public virtual ~CATOptValuesAndDerivativesAdapter( | ) |
-
Methods
o GetDerivativeErrorMessages
| public virtual GetDerivativeErrorMessages( | | oErrorMessages) |
-
Returns an error message if the tests of the existence of the derivatives has failed.
- Parameters:
-
- oErrorMessages
- A list of CATString that contains the error messages.
o GetFirstOrderDerivative
| public virtual GetFirstOrderDerivative( | | oFirstOrderDerivatives) |
-
Returns the first order derivatives with respect to the variables.
Those variables are specified with the
SetParameters method of the feature implementing this interface. Note that since a local sensor can output many different values (one for each node of the mesh covered by the sensor)
each corresponding to a constraint, the derivatives are output in a list of list. Each sub list correspond to the gradient
of one constraint with respect to all the variables.
- Parameters:
-
- oFirstOrderDerivatives
- { {dLSNode1/dx1, dLSNode2/dx1,...}, {dLSNode1/dx2, dLSNode2/dx2,...}, ...., } If there is one node in the local area of the sensor { {dLSNode1/dx1}, {dLSNode1/dx2}, . . . , {dLSNode1/dxn} }.
Where x1, . . . , xn are the parameterswith respcet to which the derivatives are calculated (passed through the SetParameters method).
- Returns:
- SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
o GetMagnitude
| public virtual GetMagnitude( | | oNameOfTheMagnitude) |
-
Returns the name of the magnitude used by the underlying contraint.
MASS, LENGTH, ENERGY, ...
o GetNthOrderDerivative
| public GetNthOrderDerivative( | | oNthOrderDerivatives, |
| | iOrder) |
-
Returns the second order derivatives with respect to the variables.
(Given by the
SetParameters method). of the feature implementing this interface.
- Returns:
- SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
- Parameters:
-
- oNthOrderDerivatives
- a one dim array of values.
- iOrder
- the order of the derivatives (> 2).
o GetNumberOfParameters
| public virtual GetNumberOfParameters( | | oNumberOfParameters) |
-
Returns the number of parameters involved in the calculus of the derivative.
- Parameters:
-
- oNumberOfParameters
- The number of parameters with respect to which the deirvatives must be calculated.
- Returns:
- S_OK when the parameters has been set. E_FAIL when the list is empty.
o GetNumberOfValues
| public virtual GetNumberOfValues( | ) |
-
Returns the number of values actually output by this sensor. Beware: this number can change anytime if the model is remeshed.
Hence the number of list of values output by GetFirstOrderDerivatives and GetSecondOrderDerivatives can vary accordingly. However the number
of values inside each sub-list is definitely set when the function SetParameters is called and correspond to the number of parameters passed
in argument.
o GetOutputErrorMessages
| public virtual GetOutputErrorMessages( | | oErrorMessages) |
-
Returns an error message if the method GetOutputValues has failed.
- Parameters:
-
- oErrorMessages
- A list of CATString that contains the error messages.
o GetOutputErrors
| public virtual GetOutputErrors( | | oList) |
-
Retrieves the status of each output.
- Parameters:
-
- oListThe
- list of status.
- Returns:
- SUCCEEDED when all values are meaningful.
o GetOutputValues
| public virtual GetOutputValues( | | oOutputList) |
-
Retreives the values output by the feature.
- Parameters:
-
- oOutputList
- The list of values output by the feature. Note that the size of the list is given by the method
GetNumberOfValues.
- Returns:
- SUCCEEDED when all values are meaningful.
o GetParametersDelta
| public virtual GetParametersDelta( | | oDeltas) |
-
Gets the parameters variations for the calculus of the derivative.
- Returns:
- S_OK if the list has been filled for each parameter, E_FAIL otherwise.
o GetParameters
| public virtual GetParameters( | | oParamList) |
-
Returns the parameters involved in the calculus of the derivative.
(Given by the
SetParameters method).
- Returns:
- SUCCEEDED when the parameters has been set. E_FAIL when the list is empty.
o GetSecondOrderDerivative
| public virtual GetSecondOrderDerivative( | | oSecondOrderDerivatives) |
-
Returns the second order derivatives with respect to the variables.
Those variables are specified with the
SetParameters method of the feature implementing this interface. Note that since a local sensor can output many different values (one for each node of the mesh covered by the sensor)
each corresponding to a constraint, the derivatives are output in a list of list. Each sub list correspond to the
Hessian matrix stored row by row.
- Parameters:
-
- oSecondOrderDerivatives.
- A pointer toward a vector : { { {dLSNode1/dx1dx1, dLSNode1/dx1dx2,...},
{dLSNode1/dx2dx1, dLSNode1/dx2dx2,...}, ...., },
{ {dLSNode2/dx1dx1, dLSNode2/dx1dx2,...}, {dLSNode2/dx2dx1, dLSNode2/dx2dx2,...}, ...., }, .... }.
- Returns:
- SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
o IsNumberOfOutputsVariable
| public virtual IsNumberOfOutputsVariable( | | oAnswer) |
-
Specifies if the feature implementing this interface may output a different number of values after each call to GetOutputValues().
By default returns yes since it is the most secure mode of using the lists of results.
- Returns:
- oAnswer
o SetFirstOrderDerivative
| public virtual SetFirstOrderDerivative( | | iFirstOrderDerivatives) |
-
Sets the first order derivatives with respect to the variables.
Those variables are specified with the
SetParameters method of the feature implementing this interface. of the feature implementing this interface.
Note that since a local sensor can output many different values (one for each node of the mesh covered by the sensor)
each corresponding to a constraint, the derivatives are output in a list of list. Each sub list correspond to the gradient
of one constraint with respect to all the variables.
- Parameters:
-
- iFirstOrderDerivatives
- a pointer toward a vector { {dLSNode1/dx1, dLSNode2/dx1,...}, {dLSNode1/dx2, dLSNode2/dx2,...}, ...., } If there is one node in the local area of the sensor { {dLSNode1/dx1}, {dLSNode1/dx2}, . . . , {dLSNode1/dxn} }.
Where x1, . . . , xn are the parameters with respect to which the derivatives are calculated (passed through the
SeParameters method).
- Returns:
- SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
o SetParametersDelta
| public virtual SetParametersDelta( | const | iDeltas) |
-
Specifies the parameters variations for the calculus of the derivative.
If nothing is specified it is set to 1/1000 of the current values of the parameter.
- Returns:
- SUCCEEDED if the delta is accepted, E_FAIL otherwise.
o SetParameters
| public virtual SetParameters( | | iParamList) |
-
Specifies the parameters with respect to the derivatives of the object (local sensor or else) are calculated.
- Parameters:
-
- iParamList
- The list of parameters (variables of the derivative).
o SetSecondOrderDerivative
| public virtual SetSecondOrderDerivative( | | iSecondOrderDerivatives) |
-
Sets the second order derivatives with respect to the variables.
Those variables are specified with the
SetParameters method) of the feature implementing this interface. of the feature implementing this interface.
Note that since a local sensor can output many different values (one for each node of the mesh covered by the sensor)
each corresponding to a constraint, the derivatives are output in a list of list. Each sub list correspond to the
Hessian matrix stored row by row.
- Parameters:
-
- oSecondOrderDerivatives.
- A pointer toward a vector : { { {dLSNode1/dx1dx1, dLSNode1/dx1dx2,...},
{dLSNode1/dx2dx1, dLSNode1/dx2dx2,...}, ...., },
{ {dLSNode2/dx1dx1, dLSNode2/dx1dx2,...}, {dLSNode2/dx2dx1, dLSNode2/dx2dx2,...}, ...., }, .... }.
- Returns:
- SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
o TestDerivativesExistence
| public virtual TestDerivativesExistence( | | oExistence, |
| | oNumberOfSucceededTests) |
-
Tests the existence of the derivatives of the feature implementing this interface with respect to the parameters passed in argument.
Used to test which derivative is missing in case of E_FAIL return by the previous method.
- Parameters:
-
- oExistence
- A list of int (0 for no existence, 1 for existence).
- oNumberOfSucceededTests
- Number of 1 in the returned list.
This object is included in the file: CATOptValuesAndDerivativesAdapter.h
If needed, your Imakefile.mk should include the module: OptimizationItf