Classes | |
| class | EpetraExt::InArgsGetterSetter_x_dot |
| Class that gets and sets x_dot in an InArgs object. More... | |
| class | EpetraExt::InArgsGetterSetter_x |
| Class that gets and sets x in an InArgs object. More... | |
| class | EpetraExt::InArgsGetterSetter_p |
| Class that gets and sets p(l) in an InArgs object. More... | |
| class | EpetraExt::OutArgsGetterSetter_f |
| Class that gets and sets f in an OutArgs object. More... | |
| class | EpetraExt::OutArgsGetterSetter_g |
| Class that gets and sets g(j) in an OutArgs object. More... | |
Functions | |
| void | EpetraExt::gatherModelNominalValues (const ModelEvaluator &model, ModelEvaluator::InArgs *nominalValues) |
| Gather the nominal values from a model evaluator. | |
| void | EpetraExt::gatherModelBounds (const ModelEvaluator &model, ModelEvaluator::InArgs *lowerBounds, ModelEvaluator::InArgs *upperBounds) |
| Gather the lower and upper bounds from a model evaluator. | |
| void | EpetraExt::scaleModelVars (const ModelEvaluator::InArgs &origVars, const ModelEvaluator::InArgs &varScalings, ModelEvaluator::InArgs *scaledVars, Teuchos::FancyOStream *out=0, Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_LOW) |
| Scale the original unscaled variables into the scaled variables. | |
| void | EpetraExt::scaleModelBounds (const ModelEvaluator::InArgs &origLowerBounds, const ModelEvaluator::InArgs &origUpperBounds, const double infBnd, const ModelEvaluator::InArgs &varScalings, ModelEvaluator::InArgs *scaledLowerBounds, ModelEvaluator::InArgs *scaledUpperBounds, Teuchos::FancyOStream *out=0, Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_LOW) |
| Scale the lower and upper model variable bounds. | |
| void | EpetraExt::unscaleModelVars (const ModelEvaluator::InArgs &scaledVars, const ModelEvaluator::InArgs &varScalings, ModelEvaluator::InArgs *origVars, Teuchos::FancyOStream *out=0, Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_LOW) |
| Unscale the scaled variables. | |
| void | EpetraExt::scaleModelFuncs (const ModelEvaluator::OutArgs &origFuncs, const ModelEvaluator::InArgs &varScalings, const ModelEvaluator::OutArgs &funcScalings, ModelEvaluator::OutArgs *scaledFuncs, bool *allFuncsWhereScaled, Teuchos::FancyOStream *out=0, Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_LOW) |
| Scale the output functions and their derivative objects. | |
| Teuchos::RefCountPtr< const Epetra_Vector > | EpetraExt::createInverseModelScalingVector (Teuchos::RefCountPtr< const Epetra_Vector > const &scalingVector) |
| Create an inverse scaling vector. | |
| void | EpetraExt::scaleModelVarsGivenInverseScaling (const Epetra_Vector &origVars, const Epetra_Vector &invVarScaling, Epetra_Vector *scaledVars) |
| Scale a vector given its inverse scaling vector. | |
| void | EpetraExt::scaleModelVarBoundsGivenInverseScaling (const Epetra_Vector &origLowerBounds, const Epetra_Vector &origUpperBounds, const double infBnd, const Epetra_Vector &invVarScaling, Epetra_Vector *scaledLowerBounds, Epetra_Vector *scaledUpperBounds) |
| Scale the model variable bounds. | |
| void | EpetraExt::unscaleModelVarsGivenInverseScaling (const Epetra_Vector &origVars, const Epetra_Vector &invVarScaling, Epetra_Vector *scaledVars) |
| Unscale a vector given its inverse scaling vector. | |
| void | EpetraExt::scaleModelFuncGivenForwardScaling (const Epetra_Vector &fwdFuncScaling, Epetra_Vector *funcs) |
| Scale (in place) an output function vector given its forward scaling vector. | |
| void | EpetraExt::scaleModelFuncFirstDerivOp (const Epetra_Vector *invVarScaling, const Epetra_Vector *fwdFuncScaling, Epetra_Operator *funcDerivOp, bool *didScaling) |
| Scale (in place) an output first-order function derivative object represented as an Epetra_Operator given its function and variable scaling. | |
| void | EpetraExt::scaleModelFuncFirstDeriv (const ModelEvaluator::Derivative &origFuncDeriv, const Epetra_Vector *invVarScaling, const Epetra_Vector *fwdFuncScaling, ModelEvaluator::Derivative *scaledFuncDeriv, bool *didScaling) |
| Scale (in place) an output first-order function derivative object given its function and variable scaling. | |
The scaling vectors are stored in EpetraExt::ModelEvaluator::InArgs and EpetraExt::ModelEvaluator::OutArgs objects in order to enhance maintainability and to avoid programming errors. This will result in some wasted space but it should not be excessive if used carefully.
First, consider scaling of the state function. Reguardless of how the state function scaling is computed, it will be represented as a positive vector s_f that defines a diagonal matrix S_f = diag(s_f) that transforms the state function:
f(...) = S_f * f_hat(...)
where f_hat(...) is the original unscaled state function as computed by the underlying EpetraExt::ModelEvaluator object and f(...) is the scaled state function.
Next, consider the scaling of the state varaibles. The scaling for the state variables is defined by a positive vector s_x>/tt> defines a diagonal scaling matrix S_x = diag(s_x) that transforms the variables as:
x = S_x * x_hat
where x_hat is the original unscaled state variable vector as defined by the underlying EpetraExt::ModelEvaluator object and x is the scaled state varaible vector. Note that when the scaled variables x are passed into evalModel that they must be unscaled as:
x_hat = inv(S_x) * x
where inv(S_x) is the inverse of the diagonals of S_x which is stored as a positive vector inv_s_x. Since unscaling the variables as shown above is more common than scaling the original variables, the scaling vector will be stored as inv_s_x and not as s_x.
Note how these scalings affect the state function:
f( x_dot, x, ... ) = S_f * f_hat( inv(S_x)*x_dot, inv(S_x)*x, ... )
which has the state/state Jacobian:
W = alpha * d(f)/d(x_dot) + beta * d(f)/d(x)
= S_f * ( alpha * d(f_hat)/d(x_hat) + beta * d(f_hat)/d(x) ) * inv(S_x)
Currently, these functions do not handle scalings of the parameters p(l) or of the auxilary response functions g(j)(...).
The state varaible and state function scaling gives the following scaled quantities:
f = S_f * f_hat
W = S_f * W_hat * inv(S_x)
DfDp(l) = S_f * DfDp_hat(l), for l=0...Np-1
g(j) = g_hat(j), for j=0...Ng-1
DgDx_dot(j) = DgDx_dot_hat(j) * inv(S_x), for j=0...Ng-1
DgDx(j) = DgDx_hat(j) * inv(S_x), for j=0...Ng-1
DgDp(j,l) = DgDp_hat(j,l), for j=0...Ng-1, l=0...Np-1
ToDo: Describe how scaling of the state function S_f affects the Hessian-vector products an how you just need to scale the Lagrange mutipliers as:
u^T * f(...) = u^T * (S_f * f_hat(...)) = u_f^T * f_hat(...)
where u_f = S_f * u.
ToDo: Also describe how scaling of the state varaibles S_x affects Hessian-vector products and other related quantities.
These scaling tools must be updated whenever the InArgs or OutArgs classes are augmented. However, not every use case with the model evaluator requires scaling so scaling with respect to some inputs and some outputs may never be needed and therefore never need to be seen by these tools. However, there is some danger in ignoring inputs and outputs in these scaling tools since some objects may be silently unscaled and could cause hard to track down bugs.
ToDo: Finish documentation!
|
||||||||||||
|
Gather the nominal values from a model evaluator. ToDo: Finish documentation! ToDo: Perhaps refactor the EpetraExt::ModelEvaluator interface to return nominal values as a single InArgs object? Definition at line 284 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||
|
Gather the lower and upper bounds from a model evaluator. ToDo: Finish documentation! ToDo: Perhaps refactor the EpetraExt::ModelEvaluator interface to return lower and upper bounds as two different InArgs objects? Definition at line 318 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||
|
Scale the original unscaled variables into the scaled variables.
origVars, varScalings, and *scaledVars will all have been created by the same EpetraExt::ModelEvaluator::createOutArgs() function call.
Definition at line 354 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||||||||||||||
|
Scale the lower and upper model variable bounds. ToDo: Finish documentation! Definition at line 430 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||
|
Unscale the scaled variables.
Definition at line 477 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||||||||||
|
Scale the output functions and their derivative objects.
Epetra_MultiVector (or Epetra_Vector) or dynamic castable to Epetra_RowMatrix can be explicitly scaled by this function. Objects that are simply Epetra_Operator objects can not and will not be scaled by this function and the client is on thier own.ToDo: Consider using some composite Epetra_Operator classes to create implicitly scaled Epetra_Operator objects and put in an option for doing this or not. Definition at line 569 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
|
Create an inverse scaling vector.
This function may actually result in |
|
||||||||||||||||
|
Scale a vector given its inverse scaling vector.
This function is used by the Definition at line 730 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||||||
|
Scale the model variable bounds.
Definition at line 747 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||
|
Unscale a vector given its inverse scaling vector.
This function is used by the function Definition at line 760 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||
|
Scale (in place) an output function vector given its forward scaling vector.
This function is used by the Definition at line 771 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||
|
Scale (in place) an output first-order function derivative object represented as an Epetra_Operator given its function and variable scaling.
This function is used by the Definition at line 783 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
|
||||||||||||||||||||||||
|
Scale (in place) an output first-order function derivative object given its function and variable scaling.
This function is used by the Definition at line 807 of file EpetraExt_ModelEvaluatorScalingTools.cpp. |
1.3.9.1