All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

OptimizationInterfaces Interface CATIOptValuesAndDerivativesAccess

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATIOptValuesAndDerivativesAccess
 

Usage: you can reimplement this interface by deriving the supplied CATOptValuesAndderivativesAdapter adapter class.


interface CATIOptValuesAndDerivativesAccess

This interface describes the basic behaviour of an object that provides multiple values and its own derivatives in the context of optimization.
This is the case of some Analysis sensors. The values of the sensor are retreived through GetOutputValues, and its derivatives through GetFirstOrderDerivatives (if and only if the parameters with respect to which the derivatives must be calculated are set through the method SetParameters).

BOA information: this interface CANNOT be implemented using the BOA (Basic Object Adapter). To know more about the BOA, refer to the CAA Encyclopedia home page. Click Middleware at the bottom left, then click the Object Modeler tab page. Several articles deal with the BOA.


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 feature.
o GetNthOrderDerivative(double*&,int)
Returns the nth 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 the feature that implements this interface.
o GetOutputErrorMessages(CATListOfCATString&)
Returns an error message if the method GetOutputValues has failed.
o GetOutputErrors(CATListOfInt&)
Retrevieves the status of each output.
o GetOutputValues(double*&)
Retrevieves 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 which 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.

Methods


o GetDerivativeErrorMessages
public virtual HRESULT GetDerivativeErrorMessages(CATListOfCATString& oErrorMessages) const = 0
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 = 0
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 void GetMagnitude(CATUnicodeString& oNameOfTheMagnitude)const = 0
Returns the name of the magnitude used by the underlying feature.
o GetNthOrderDerivative
public virtual HRESULT GetNthOrderDerivative(double*& oNthOrderDerivatives,
int iOrder) const = 0
Returns the nth order derivatives with respect to the variables. Those variables are specified with 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
an one dim array of values.
iOrder
the order of the derivatives (> 2).
o GetNumberOfParameters
public virtual HRESULT GetNumberOfParameters(int& oNumberOfParameters) const = 0
Returns the number of parameters involved in the calculus of the derivative. (Given by the SetParameters method.).
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 = 0
Returns the number of values actually output by the feature that implements this interface. 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 corresponds to the number of parameters passed in argument.
o GetOutputErrorMessages
public virtual HRESULT GetOutputErrorMessages(CATListOfCATString& oErrorMessages) const = 0
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 HRESULT GetOutputErrors(CATListOfInt& oList)= 0
Retrevieves the status of each output.
Parameters:
oListThe
list of status.
Returns:
SUCCEEDED when all values of the output are meaningful.
o GetOutputValues
public virtual HRESULT GetOutputValues(double*& oOutputList)= 0
Retrevieves 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
public virtual HRESULT GetParameters(CATLISTV(CATBaseUnknown_var)*& oParamList) const = 0
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
public virtual HRESULT GetParametersDelta(CATListOfDouble& oDeltas) const = 0
Gets the parameters variations for the calculus of the derivative.
Parameters:
oDeltas
The list of small variations that can be used to calculate the derivatives.
Returns:
S_OK if the list has been filled for each parameter, E_FAIL otherwise.
o GetSecondOrderDerivative
public virtual HRESULT GetSecondOrderDerivative(double*& oSecondOrderDerivatives) const = 0
Returns the second order derivatives with respect to the variables. Those variables 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)= 0
Specifies if the feature implementing this interface may output a different number of values after each call to GetOutputValues. 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 = 0
Sets 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:
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
SetParameters method).
Returns:
SUCCEEDED when all derivatives where computed correctly, E_FAIL when one derivative fails, E_NOTIMPL if derivatives are not supported.
o SetParameters
public virtual HRESULT SetParameters(CATLISTV(CATBaseUnknown_var)* iParamList) = 0
Specifies the parameters with respect to which the derivatives of the object (local sensor or else) are calculated.
Parameters:
iParamList
The list of parameters (variables of the derivative).
o SetParametersDelta
public virtual HRESULT SetParametersDelta( const CATListOfDouble& iDeltas) = 0
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 = 0
Sets 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 TestDerivativesExistence
public virtual HRESULT TestDerivativesExistence(CATListOfInt& oExistence,
int& oNumberOfSucceededTests) const = 0
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: CATIOptValuesAndDerivativesAccess.h
If needed, your Imakefile.mk should include the module: OptimizationItf

Copyright © 2003, Dassault Systèmes. All rights reserved.