All Frameworks Class Hierarchy This Framework Previous Indexes
OptimizationInterfaces Class CATOptValuesAndDerivativesAdapter
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---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
GetParameters(CATLISTV(CATBaseUnknown_var)*&)
- Returns the parameters involved in the calculus of the derivative.
- o
GetParametersDelta(CATListOfDouble&)
- Gets the parameters variations for 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
SetParameters(CATLISTV(CATBaseUnknown_var)*)
- Specifies the parameters with respect to the derivatives of the object (local sensor or else) are calculated.
- o
SetParametersDelta(CATListOfDouble&)
- Specifies the parameters variations for the calculus of the derivative.
- 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
-
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 HRESULT GetFirstOrderDerivative( | double*& | oFirstOrderDerivatives) const |
-
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
-
Returns the name of the magnitude used by the underlying contraint.
MASS, LENGTH, ENERGY, ...
o GetNthOrderDerivative
public HRESULT GetNthOrderDerivative( | double*& | oNthOrderDerivatives, |
| int | iOrder) const |
-
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 HRESULT GetNumberOfParameters( | int& | oNumberOfParameters) const |
-
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 int GetNumberOfValues( | )const |
-
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
-
Returns an error message if the method GetOutputValues has failed.
- Parameters:
-
- oErrorMessages
- A list of CATString that contains the error messages.
o GetOutputErrors
-
Retrieves the status of each output.
- Parameters:
-
- oListThe
- list of status.
- Returns:
- SUCCEEDED when all values are meaningful.
o GetOutputValues
public virtual HRESULT GetOutputValues( | double*& | 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 GetParameters
-
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 GetParametersDelta
-
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 GetSecondOrderDerivative
public virtual HRESULT GetSecondOrderDerivative( | double*& | oSecondOrderDerivatives) const |
-
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 HRESULT IsNumberOfOutputsVariable( | int& | 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 HRESULT SetFirstOrderDerivative( | double* | iFirstOrderDerivatives) const |
-
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 SetParameters
-
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 SetParametersDelta
-
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 SetSecondOrderDerivative
public virtual HRESULT SetSecondOrderDerivative( | double* | iSecondOrderDerivatives) const |
-
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 HRESULT TestDerivativesExistence( | CATListOfInt& | oExistence, |
| int& | oNumberOfSucceededTests) const |
-
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